Repository navigation
Maintenance: dependency updates, root path support, Laravel temporary URLs - #98
Merged
Merged
Conversation
… URLs
- Bump PHP floor to ^8.3 (8.2 reaches EOL Dec 2026)
- Replace abandoned fzaninotto/faker with fakerphp/faker (drop-in)
- Bump laravel/pint 0.2 -> 1.30, phpunit 10 -> 11.5 (latest PHPUnit
compatible with flysystem-adapter-test-utilities; 12+ drops doc-comment
metadata support)
- Add getTemporaryUrl() to the adapter so Laravel's
Storage::disk('bunnycdn')->temporaryUrl() works out of the box (fixes #97)
- Restore the third constructor argument as a real 'root' path prefix,
scoping all operations (upload/read/list/delete/URLs) to a subdirectory
(fixes #96, discussion #30)
- Prevent accidental deletion of the storage zone root via deleteDirectory('')
- Harden parse_bunny_timestamp against malformed timestamps
- Fix json_decode edge case in client request() (numeric/bool file content
no longer type-errors on download)
- writeBatch now reports the failing target path instead of a numeric index
- PHPStan: level 0 -> 5 via phpstan.neon.dist; fix reported issues
(match on mixed IsDirectory, StorageAttributes vs FileAttributes returns)
- Convert @test doc-comments to #[Test] attributes (deprecated in PHPUnit 11)
- CI: checkout@v4, setup-php@v4, local phpstan run, codecov-action@v5,
PHP matrix 8.3-8.5, guarded steps keep legacy v1/v2 branches working
- README: PHP badge, root path + temporaryUrl documentation
There was a problem hiding this comment.
Pull request overview
Maintenance update for the Flysystem v3 BunnyCDN adapter: modernizes dependencies/tooling and restores a root-path prefix feature while improving temporary URL support for Laravel integrations.
Changes:
- Updated dependency floor/tooling (PHP ^8.3, PHPUnit 11.5, Pint 1.x, PHPStan config + CI integration).
- Added adapter root-path scoping and expanded test coverage (new
RootTest+ updated test suite). - Added Laravel-compatible temporary URL entrypoint (
getTemporaryUrl) and expanded temporary URL tests.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/UtilityClassTest.php | Migrates tests to PHPUnit 11 #[Test] attributes. |
| tests/TemporaryUrlTest.php | Adds coverage for Laravel-compatible temp URLs, options, and root-scoped signing. |
| tests/RootTest.php | New conformance + targeted tests for a root-scoped adapter. |
| tests/PrefixTest.php | Updates tests for PHPUnit 11 attributes and root-argument semantics. |
| tests/MockClient.php | Minor PHP 8+/style modernizations and docblock cleanup. |
| tests/FlysystemAdapterTest.php | Updates tests for PHPUnit 11 attributes and config instantiation style. |
| tests/ClientTest.php | Adjusts import ordering for PHPUnit function import. |
| src/WriteBatchFile.php | Simplifies constructor to promoted-properties shorthand. |
| src/Util.php | Docblock cleanup (no functional change). |
| src/Exceptions/NotFoundException.php | Class formatting simplification. |
| src/Exceptions/BunnyCDNException.php | Class formatting simplification. |
| src/BunnyCDNClient.php | Improves request() decoding behavior to avoid non-array JSON type pitfalls. |
| src/BunnyCDNAdapter.php | Implements root scoping, Laravel temp URL compatibility, and several bug fixes. |
| readme.md | Documents root support and Laravel temporary URL usage/config. |
| phpunit.xml | Updates PHPUnit schema reference for PHPUnit 11.5. |
| phpstan.neon.dist | Adds PHPStan level 5 baseline config. |
| composer.json | Updates PHP requirement and development tooling dependencies. |
| .gitignore | Adds PHPStan cache directory. |
| .github/workflows/php.yml | Updates CI matrix/tooling and adds guarded Pint/PHPStan execution. |
Suppressed comments (1)
.github/workflows/php.yml:41
- Same indentation issue for the remaining
stepsentries: they need to be nested understeps:(two spaces deeper than the key).
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Run linter
run: test -f vendor/bin/pint && vendor/bin/pint -v --test || echo 'pint not installed, skipping'
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ths in writeBatch errors, typed getTemporaryUrl
…N decode edge cases, full-URL temp URLs, writeBatch with root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Maintenance pass over the v3 line: dependency updates, two open-issue fixes, several latent bugs, and modernized CI/static analysis.
Dependency updates (composer.json)
^8.3— PHP 8.2 reaches EOL on 31 Dec 2026. (Pint 1.x also requires ^8.3.)fzaninotto/faker→fakerphp/faker— abandoned package; drop-in replacement, sameFaker\namespace.laravel/pint^0.2.3→^1.30— fixes PHP 8.5 deprecation warnings from the old Pint build.phpunit/phpunit^10.0→^11.5— 10.x is EOL. PHPUnit 12+ is not viable: it removed doc-comment metadata support, whichleague/flysystem-adapter-test-utilitiesstill relies on (test discovery drops from 158 → 22).Issue fixes
Storage::temporaryUrl()throwsThis driver does not support creating temporary URLsalthough adapter supportstemporaryUrl()#97 — LaravelStorage::temporaryUrl()throws "This driver does not support creating temporary URLs": Laravel'sFilesystemAdapteronly callsgetTemporaryUrl()on the adapter; it was never implemented. AddedBunnyCDNAdapter::getTemporaryUrl()(acceptsDateTimeInterfaceor minutes, plus signed query-param options) —Storage::disk('bunnycdn')->temporaryUrl()now works out of the box.rootsetting does not work: the third constructor argument (which previously threw "PrefixPath is no longer supported") is now a real root path prefix — v1 semantics restored. All operations (write/read/list/delete/move/copy/URLs) are scoped to the root; listed paths are root-relative; public and temporary URLs include the root and temporary-URL signatures are built from the root-scoped path. Documented in the README incl. the Laravelrootconfig.Bugs found during review
deleteDirectory('')could DELETE the storage zone root — now guarded withUnableToDeleteDirectory.request()json_decode edge case — a file whose content is numeric (123) ortruedecoded toint/boolanddownload()threw aTypeErroragainst itsstringreturn type. Non-array JSON payloads now return the raw body.parse_bunny_timestamp()— fatal error on malformed timestamps; now falls back to0.writeBatchfailure reporting —UnableToWriteFile::atLocation()received a numeric pool index instead of the target path.lastModified()/fileSize()relied on a return-typeTypeErrorfor directory paths; now an explicitUnableToRetrieveMetadata(same external behavior, flagged by PHPStan).Tooling / CI
phpstan.neon.dist; all reported issues fixed.@testdoc-comments to#[Test]attributes (deprecated in PHPUnit 11); import added.tests/RootTest.php— full flysystem conformance suite against a root-scoped adapter (63 tests) plus targeted root tests.php.yml):checkout@v4,setup-php@v4, PHP matrix8.3/8.4/8.5, localvendor/bin/phpstanrun (guarded so legacyv1/v2branches — which don't ship pint/phpstan — keep working),codecov-action@v5replacing the deprecated bash uploader.Verification
composer validate --strict, Pint, PHPStan level 5 — all cleanNotes
composer.lockstays gitignored (library convention)..git.broken/directory found in the repo root — untracked, not included in this PR.