guzzle-cache-middleware
guzzle-cache-middleware copied to clipboard
feat: Add Flysystem v2 and v3 compatibility
This change updates the library to be compatible with both Flysystem v2 and v3.
Key changes include:
- Updated
composer.jsonto allowleague/flysystemversions^2.5 || ^3.0. - Modified
src/Storage/FlysystemStorage.phpto correctly handle exceptions and return values from Flysystem v2/v3 methods:fetch()now catchesFilesystemExceptionduring read and returnsnull.save()ensurestrueis returned on success andfalseonFilesystemException.delete()now correctly returnsfalseif aFilesystemExceptionoccurs (previously returnedtrue).
- Added
tests/Storage/FlysystemStorageTest.phpwith new unit tests covering success and failure scenarios forfetch,save, anddeleteoperations, including mocking Flysystem exceptions. This ensures the storage layer behaves as expected when underlying file operations fail. - Added
phpspec/prophecy-phpunitto dev dependencies for mocking in tests.