Skip to content

Return unsealed context shapes for PHPStan 2.2 compatibility - #99

Merged
sasezaki merged 1 commit into
struggle-for-php:1.1.xfrom
robotomarvin:1.1.x
May 28, 2026
Merged

sasezaki merged 1 commit into
struggle-for-php:1.1.xfrom
robotomarvin:1.1.x

Conversation

@robotomarvin

@robotomarvin robotomarvin commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #100

PHPStan 2.2 introduces sealed array shapes under bleedingEdge, so the sealed array{exception?: Throwable} returned by the Psr3 and BigQuery context type providers rejected real user contexts carrying extra keys. Route every provider result through a new UnsealedConstantArrayShape helper so the expected shape becomes array{exception?: Throwable, ...}. A method_exists guard keeps behaviour unchanged on PHPStan 2.1.x.

PHPStan 2.2 introduces sealed array shapes under bleedingEdge, so the
sealed `array{exception?: Throwable}` returned by the Psr3 and BigQuery
context type providers rejected real user contexts carrying extra keys.
Route every provider result through a new `UnsealedConstantArrayShape`
helper so the expected shape becomes `array{exception?: Throwable, ...}`.
A `method_exists` guard keeps behaviour unchanged on PHPStan 2.1.x.
@sasezaki

sasezaki commented May 28, 2026 •

Copy link
Copy Markdown
Member

@robotomarvin
Thank you for your pull request!
I will merge this.

Some actions failed, but I will fix those.

@sasezaki sasezaki added this to the 1.1.0 milestone May 28, 2026
@sasezaki sasezaki added the enhancement New feature or request label May 28, 2026
@sasezaki
sasezaki merged commit 655625e into struggle-for-php:1.1.x May 28, 2026
18 of 23 checks passed
@sasezaki sasezaki added Improvements 🔧 and removed enhancement New feature or request labels May 28, 2026
sasezaki added a commit that referenced this pull request May 28, 2026
Additional fixes related to #99(unsealed array support)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHPStan 2.2.0 bleeding edge - sealed arrays

2 participants