dcfec3de04
test(DateHashPathGenerator): add unit tests for path generation
...
Added comprehensive unit tests for DateHashPathGenerator to validate path generation
with and without directories, ensuring unique paths for identical files and proper
slugging of filenames.
2026-11-03 17:04:29 +01:00
4a41f429ac
fix(FileStream): handle resource creation failure in constructor
...
Ensure that an exception is thrown if the temporary stream cannot be created.
2026-11-03 16:54:25 +01:00
27e4361d10
refactor(StorageServiceProvider): improve disk configuration handling
...
Enhanced the boot method to filter eligible disks and allowed extensions
from the configuration, ensuring only valid entries are processed.
2026-11-03 16:51:06 +01:00
98a28c44b8
refactor(StorageServiceProvider): use Arr::string for driver assignment
...
Refactor driver assignment to use Arr::string for better clarity.
2026-11-03 16:46:43 +01:00
bb1129c209
fix(FileStream): improve stream validation in constructor
...
Ensure the stream is readable and metadata is correctly checked.
2026-11-03 16:44:42 +01:00
f956a47c35
style(StorageService): update phpcs line length disable comment
...
style(FileStream): ignore discouraged silenced errors for fopen
2026-11-03 16:40:35 +01:00
3d4ade6204
style(StorageService): disable line length check for facade comments
...
This change allows for longer comments in the StorageService facade without triggering PHPCS warnings.
2026-11-03 16:37:08 +01:00
5075caa54b
test: add unit tests for DiskName, FileStream, and SanitizedFile
...
- Implement tests for DiskName instantiation and validation.
- Add tests for FileStream instantiation and methods.
- Create tests for SanitizedFile instantiation and validation.
- Introduce TestDiskBackedEnum and TestDiskUnitEnum for testing purposes.
2026-11-03 16:32:09 +01:00
fc267c330c
feat(tests): add initial test structure and example tests
...
- Introduced Pest testing framework with basic test cases.
- Created TestCase and ExampleTest for unit testing.
- Updated phpunit.xml for improved test configuration.
2026-11-03 16:20:14 +01:00
3d50ba6ba2
chore: update phpcs and phpstan configurations
...
- Updated phpcs.xml to reflect the correct ruleset name and adjusted file paths.
- Modified phpstan.neon to include additional extensions and clarified parameters.
- Changed pint.json preset to psr12 and added versioning.
2026-11-03 16:17:24 +01:00
839b092b24
chore: add .gitattributes for line endings and export-ignore rules
...
This file sets default behavior for line endings and specifies files to exclude from Composer package archives.
2026-11-03 16:16:49 +01:00
92b8a7b7f1
refactor(StorageServiceConfig): rename getEligiblesDisks to getEligibleDisks
...
Improves method naming consistency in StorageServiceConfig.
2026-11-03 16:16:19 +01:00
3ab415139c
feat(MimeTypeChecker): add unsupported MIME types for SVG and XML
...
Added checks to prevent SVG and XML file types from being processed.
2026-11-03 16:15:57 +01:00
1521a91ec2
refactor(exceptions): replace StorageException with UnexpectedStorageException
...
Updated exception handling across the codebase to use UnexpectedStorageException for better clarity and specificity in error reporting.
2026-11-03 16:07:54 +01:00
9f4a6e417d
feat(StorageService): add methods to store files using SplFileObject
...
New methods for storing files have been implemented to enhance file handling capabilities.
2026-11-03 15:53:22 +01:00
f658df0c7b
refactor(FileStream): ensure resource is closed in destructor
...
Added a destructor to close the resource when the object is destroyed.
2026-11-03 15:53:12 +01:00
08fda2cdfd
refactor(StorageService): change remove methods to return bool
2026-11-03 15:53:07 +01:00
b56f43b5c8
refactor(SanitizedFile): remove unused Utils methods
...
Cleaned up the SanitizedFile class by removing unused validation logic related to file extensions and MIME types.
2026-11-03 15:49:14 +01:00
f6f99fdedf
feat(StorageFilePath): implement Stringable interface
...
Add __toString method to StorageFilePath for string representation.
2026-11-03 15:49:10 +01:00
8a54f09dae
style(PathGenerators): format code for consistency
2026-11-03 15:49:02 +01:00
c881e9abb8
refactor(Utils, DiskName): improve disk handling with enum support
...
Updated diskExists and DiskName constructor to handle
BackedEnum and UnitEnum types for better type safety.
2026-11-03 15:48:55 +01:00
b6b5066bc2
feat(FileSanitizerImpl): add mimeType and size to SanitizedFile
...
Enhance the SanitizedFile creation by including mimeType and file size.
2026-11-03 15:48:39 +01:00
d4c4d5b22a
refactor(Exceptions): format exception classes for consistency
...
Improves code readability by ensuring consistent formatting in exception classes.
2026-11-03 15:48:30 +01:00
cf9ca6bd5c
chore: update PHP CodeSniffer and add Pint configuration
...
- Updated phpcs.xml to use Php Coding Standard and optimized rules.
- Added pint.json for code style configuration.
- Adjusted phpstan.neon to include tests directory and set level to 10.
2026-11-03 15:38:09 +01:00
8225142fa7
feat(Facades): add StorageService facade with methods for file operations
...
Introduces a new StorageService facade to provide a simplified interface for file operations.
2026-11-03 15:36:45 +01:00
6840fc90b9
refactor(StorageGatewayImpl): specify return type for getStorageForDisk
...
Clarifies the return type of the getStorageForDisk method.
2026-11-03 15:34:07 +01:00
1234c46f8f
chore: remove FileStorageHelper class
...
This class is no longer needed as its functionality has been refactored or replaced.
2026-11-03 15:33:26 +01:00
88ae440bc7
refactor(DiskName): implement Stringable interface
...
Added __toString method to DiskName class for better string representation.
2026-11-03 15:32:48 +01:00
32b3953a31
intial work
2026-11-03 15:29:18 +01:00