Skip to content

[2.x] Update to opis/closure v4 and fix PHPStan#80

Open
dsevillamartin wants to merge 3 commits into2.xfrom
ds/2x-opis-closure
Open

[2.x] Update to opis/closure v4 and fix PHPStan#80
dsevillamartin wants to merge 3 commits into2.xfrom
ds/2x-opis-closure

Conversation

@dsevillamartin
Copy link
Copy Markdown
Member

@dsevillamartin dsevillamartin commented Mar 31, 2026

Changes proposed in this pull request:

  • Replace the closure package, which itself provided more modern support for opis/closure back in the day, with the original package that supports PHP 8.0-8.5. The old one had not been updated in 3+ years.

    PHP Deprecated:  Opis\Closure\unserialize(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in [vendor]/charescape\serialize-closure\functions.php
    

    There was a package rewrite with v4, but this only affects the data unserializing, and there's a v3 compatibility mode I enabled in case a queued job was created before the upgrade -- though not sure if we should really support this use case anyways. Unsure of what the harm on enabling the compat mode is.

  • Update PHPStan config so that it works again after major upgrade in flarum/phpstan package

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@dsevillamartin dsevillamartin requested a review from a team as a code owner March 31, 2026 15:07
@dsevillamartin dsevillamartin changed the title [2.x] Update to opis/closure v4 for PHP 8.0-8.5 support [2.x] Update to opis/closure v4 and fix PHPStan Mar 31, 2026
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