Add Laravel 13 support and migrate to PHPStan 2#5
Merged
Conversation
Add illuminate/macroable ^13 and PHPUnit ^12 to supported ranges, and extend the CI matrix accordingly (PHP 8.2 excluded from PHPUnit 12). Migrate to PHPStan 2.0, fixing two stricter findings in Robots and HTMLParser and removing a now-unnecessary inline ignore. Changelog: added
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
Adds Laravel 13 compatibility, ensures the package works on PHP 8.3 and 8.4, and migrates static analysis to PHPStan 2.
Dependencies (
composer.json)illuminate/macroable:^11.0|^12.0→^11.0|^12.0|^13.0(Laravel 13)phpunit/phpunit:^10.0|^11.0→^10.0|^11.0|^12.0(Laravel 13 projects commonly use PHPUnit 12)phpstan/phpstan:^1.8→^2.0phpkept at^8.2;symfony/dom-crawlerkept at^6.1|^7.0CI
12.*to the PHPUnit matrix inrun-tests.yml, excludingPHP 8.2 + PHPUnit 12(PHPUnit 12 requires PHP ≥ 8.3).PHPStan 2 migration
Fixed the two stricter findings in code (no baseline added):
Robots.php— thearray<Robots::*>PHPDoc claimed no falsy values, flaggingarray_filteras a no-op. The real type fromexplode()isarray<string>(empty strings the filter legitimately removes).HTMLParser.php— removed a now-unnecessary@phpstan-ignore; tightening the param PHPDoc tostring|array<string>|nulllets the template resolve cleanly.Decisions
^8.2: the package only depends onilluminate/macroable(not the full framework), so it keeps Laravel 11/12 + PHP 8.2 compatibility. Laravel 13 already enforces PHP 8.3 via its own constraint.symfony/dom-crawlernot bumped to^8.0: v8 is beta and requires PHP ≥ 8.4.1, which would break PHP 8.3.^7.0already works with Laravel 13.Macroabletrait — so it would add no value while pulling in heavy dependencies.Verification
Locally on PHP 8.3: PHPStan 2 reports no errors, Pint passes, and all 32 tests (118 assertions) pass against
illuminate/macroablev13 + PHPUnit 12.