Skip to content

feat: add support for Laravel 13 and PHP 8.5 - #20

Merged
teofanis merged 2 commits into
teofanis:mainfrom
alright:feat/laravel-13-php-8.5
Aug 26, 2026
Merged

feat: add support for Laravel 13 and PHP 8.5#20
teofanis merged 2 commits into
teofanis:mainfrom
alright:feat/laravel-13-php-8.5

Conversation

@alright

@alright alright commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What / Why

Adds support for Laravel 13 and PHP 8.5 without dropping any currently supported version.

How

composer.json

  • illuminate/contracts: ^9.0||^10.0||^11.0||^12.0…||^13.0
  • orchestra/testbench (dev): ^10.0.0||^9.0.0^11.0.0||… (Testbench 11 is the line targeting Laravel 13)
  • php stays ^8.0 — it already admits 8.5, so no change was needed there.

CI

  • run-tests.yml: matrix is now php: [8.5, 8.4] × laravel: [13.*, 12.*, 11.*], with testbench: 11.* mapped to Laravel 13. Laravel 11 is excluded on PHP 8.5 since it predates that release and isn't tested against it upstream — 20 jobs, up from 8.
  • phpstan.yml and tag.yaml now run on PHP 8.5.

rector.php (separate commit, chore(rector): … — see notes below)

No source changes were required: the suite runs clean on 8.5 with zero PHP deprecations.

Screenshots / Output (if applicable)

Ran locally against real installs on each new matrix combination (plus L11 as a regression check):

PHP Laravel Stability Result
8.5 13.26.1 prefer-stable 47 passed (179 assertions)
8.5 13.12.0 prefer-lowest 47 passed
8.5 12.67.0 prefer-stable 47 passed
8.4 13.26.1 prefer-stable 47 passed
8.4 11.x-dev prefer-stable 47 passed
  • pest --display-deprecations --display-warnings --display-notices on PHP 8.5 / Laravel 13: no deprecations reported.
  • Type coverage still 100%.
  • spatie/laravel-package-tools: ^1.16 resolves to 1.93.x under Laravel 13, so no bump is needed there.

Type of change

  • Bug fix
  • New feature
  • Refactor / internal cleanup
  • Docs only
  • Tests only
  • Chore (CI, build, tooling)

Checklist

  • Tests added/updated and pass locally (composer test) — no new tests; the existing 47 cover the change, and they were run against every new matrix combination
  • Code formatted (./vendor/bin/pint) — rector.php is the only PHP file touched and it passes pint --test
  • No writes to vendor/composer/autoload_classmap.php (tests use hookpress.composer.classmap_path)
  • README / docs updated (if user-facing) — Requirements section notes the CI-tested versions
  • Backwards compatible (or breaking changes clearly documented) — constraints are only widened

Notes for reviewers

The second commit is tooling, split out so you can drop it if you'd rather handle it separately. composer run rector is currently broken on a fresh install, and one of its rules is actively dangerous:

  1. strictBooleans: has been removed from Rector's withPreparedSets() upstream, so rector.php throws Unknown named parameter $strictBooleans and the pre-commit hook aborts. The set no longer ships with Rector, so the flag is just dropped.
  2. ForeachToArrayAnyRector (PHP 8.4 set) rewrites the body of src/polyfills.php::array_any() into a call to array_any() — i.e. infinite recursion. It's now skipped for that one file.
  3. The Rector PHP set is bumped 8.4 → 8.5 to match.

Two things I deliberately left alone:

  • PHPStan reports 3 errors, but they already fail on main. I checked out main in a separate worktree, installed on PHP 8.4 / Laravel 12, and got the identical three. Since composer.lock is gitignored, CI always resolves the newest larastan/PHPStan, so this is pre-existing drift rather than fallout from this PR:

    • src/Commands/ShowCommand.php:21is_string() on a non-falsy-string always evaluates to true
    • src/Conditions/HasMethod.php:57, src/Conditions/HasProperty.php:52(string) $type on ReflectionType, whose __toString() is doc-deprecated since PHP 8.0 (it emits no runtime notice on 8.4 or 8.5 — I verified).

    fix: stop relying on the deprecated ReflectionType::__toString() #21 fixes all of these, off main and independent of this PR, so neither diff carries the other's changes. PHPStan goes green here once it lands.

  • Repo-wide pint churn. A current Pint reformats 18 unrelated files (fully_qualified_strict_types now applies more broadly). Per CONTRIBUTING's "no unrelated changes bundled in the PR", I left that out — it's independent of this change and belongs in its own chore(style) commit.

Widen `illuminate/contracts` to `^13.0` and allow `orchestra/testbench`
`^11.0`, which is the Testbench line that targets Laravel 13.

Extend the test matrix to PHP 8.5 and Laravel 13 (Testbench 11). Laravel
11 is excluded on PHP 8.5, as it predates that release and is not tested
against it upstream. PHPStan and the tag/release workflow now run on the
highest supported PHP.

The `php` constraint stays `^8.0` — it already admits 8.5.
Three fixes to make `composer run rector` usable again:

- `strictBooleans:` was removed from Rector's `withPreparedSets()`
  upstream, so the config threw `Unknown named parameter $strictBooleans`
  and the pre-commit hook aborted. The corresponding set no longer ships
  with Rector, so the flag is simply dropped.
- Bump the PHP set from 8.4 to 8.5.
- Skip `ForeachToArrayAnyRector` on `src/polyfills.php`. That polyfill
  *is* the PHP < 8.4 implementation of `array_any()`, so rewriting its
  body into a call to `array_any()` made it recurse forever.
@alright
alright force-pushed the feat/laravel-13-php-8.5 branch 2 times, most recently from a823411 to 2f684eb Compare August 25, 2026 13:35
@teofanis
teofanis merged commit bb01a12 into teofanis:main Aug 26, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants