feat: Add Flysystem v2 and v3 compatibility #199
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change updates the library to be compatible with both Flysystem v2 and v3.
Key changes include:
composer.json
to allowleague/flysystem
versions^2.5 || ^3.0
.src/Storage/FlysystemStorage.php
to correctly handle exceptions and return values from Flysystem v2/v3 methods:fetch()
now catchesFilesystemException
during read and returnsnull
.save()
ensurestrue
is returned on success andfalse
onFilesystemException
.delete()
now correctly returnsfalse
if aFilesystemException
occurs (previously returnedtrue
).tests/Storage/FlysystemStorageTest.php
with new unit tests covering success and failure scenarios forfetch
,save
, anddelete
operations, including mocking Flysystem exceptions. This ensures the storage layer behaves as expected when underlying file operations fail.phpspec/prophecy-phpunit
to dev dependencies for mocking in tests.