Repository navigation
fix(args): unpacking an array shape with integer keys that is not a list passes as many arguments as it has keys - #14415
Merged
Conversation
…ist passes as many arguments as it has keys vimeo#13810 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Behaviour change
|
Contributor
✅ Performance: unchanged · Types: decreased
How to read this table
✅ laravel: issues +0 −1Memory 1 768 → 1 768 MB (<0.1 %) · Wall 75.9 → 76.0 s (+0.2 %) Weighted 53 513 → 53 503 (−10, −0.02 %): always −1
Removed (1)
✅ symfony: issues +0 −14Memory 3 606 → 3 606 MB (<0.1 %) · Wall 175.2 → 175.4 s (+0.1 %) Weighted 98 402 → 98 325 (−77, −0.08 %): L1 −7 · always −7
Removed (14)
✅ drupal: issues +0 −2Memory 4 851 → 4 851 MB (<0.1 %) · Wall 239.0 → 241.7 s (+1.2 %) Weighted 169 112 → 169 101 (−11, −0.01 %): L1 −1 · always −1
Removed (2)
head 55088fd · base a328b90 (merge-base) · workflow run |
…lues vimeo#13810 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 55088fd. Configure here.
Collaborator
|
Thanks @jirkace! |
alies-dev
added a commit
to psalm/psalm-plugin-laravel
that referenced
this pull request
Nov 21, 2026
* build: require Psalm 7.14 - Psalm 7.14 changes what the type fixtures report (PHP deprecations, unrequired-package functions, mixed-widened templates), and the fixtures updated in this PR no longer pass on 7.13. - Raise the floor in composer.json and in the Symfony Console job of tests.yml. * test: give the type and emission fixtures the composer.json Psalm 7.14 needs - Psalm 7.14 counts a vendor function as defined only if the composer.json next to the config requires its package (vimeo/psalm#14413); tests/Type and the EmissionApp fixture have none, so `now()`, `cache()`, `env()`, `trans()`, `route()` and `to_route()` became UndefinedFunction and `mixed` (22 type tests and `EmissionAppTest`). - The type tests select a differently named `composer.fixture.json` through `COMPOSER`, which leaves the plugin's project-root detection (a `composer.json` in the working directory) untouched. * test: expect the PHP deprecations Psalm 7.14 reports in collection callback fixtures - `is_a($string, Class::class)` is deprecated since PHP 8.6 (DeprecatedFunction) and an implicitly nullable parameter since PHP 8.4 (DeprecatedSyntax); Psalm reports both regardless of the analysed PHP version (vimeo/psalm#14413). - The fixtures keep those shapes because the narrowing of the two-argument `is_a()` and of a `= null` closure parameter is what they pin; the deprecation is now part of `--EXPECTF--`. * test: pin that an unbounded template given to getOrPut() and queued() now resolves to mixed - Psalm 7.14 no longer treats a bare template as decidably not a Closure for the `$value is callable` guard (vimeo/psalm#12672), so the result is widened with `mixed` and returning it as the template reports MixedReturnStatement; before, a possible Closure result stayed silent. - Rename GetOrPutClosureDefaultKnownLimitation.phpt to GetOrPutClosureDefaultUnboundedTemplateTest.phpt (positive coverage) and rewrite the three stub docblocks that cited the limitation. * test: pin the possibly-empty array-shape unpack of Paginator::fragment() as a known limitation - Psalm 7.14 unpacks `array{0?: string}` like a `list<string>` (vimeo/psalm#14415), so the call no longer resolves both the getter and the setter branch of `fragment()`; 7.13.2 did. - Rename PaginatorFragmentUnpackTest.phpt to PaginatorFragmentUnpackKnownLimitation.phpt and rewrite the docblocks of the stub and of RouteDomainKnownLimitation.phpt that cited the old behavior. * test: suppress Psalm 7.14's static-call false positive on a trait constructor in the Blade taint fixture - Psalm 7.14 analyses the synthetic constructor call for uninitialised properties as a static call on the parent's trait and reports InvalidStaticInvocation (a regression of vimeo/psalm#14413, reproducible without the plugin). - `BladeComponentTaintTest::the_bridge_adds_no_non_taint_issue` asserts no other issue, so the fixture class suppresses it. * fix: accept the value argument in Enumerable::when() and unless() callbacks - Laravel's Enumerable interface docblock types the callbacks as callable($this) and $value as bool, but Conditionable calls $callback($this, $value) and accepts any value - Psalm 7.13.2 keeps the concrete $this type in callable($this) (vimeo/psalm#14423), which surfaced the arity mismatch as InvalidScalarArgument - Stub Enumerable::when() and unless() with the Conditionable signature * docs: link the upstream Enumerable docblock fix from the when()/unless() stub * test: link the filed Psalm issues from the workarounds and known limitations - vimeo/psalm#14554 (trait constructor InvalidStaticInvocation), #14556 (array-shape unpack), #14555 (composer.json next to the config).
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.
Unpacking an array shape with integer keys that is not a list reports
TooFewArguments, and gives its values no types, although it passes one argument per key.Before
After
The values are passed in the order of the shape:
method_exists(...$c)witharray{1: string, 0: object}reports the swapped arguments (ArgumentTypeCoercion).Fixes #13810