Repository navigation
Report array&callable pass as wrong param
#5573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
VincentLanglet
merged 11 commits into
phpstan:2.1.x
from
phpstan-bot:create-pull-request/patch-k8eciuw
May 7, 2026
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d4dcc5c
Report missing iterable value type for array part of `array&callable`…
VincentLanglet 7507cc4
Revert missing iterable value type report for array&callable in Missi…
phpstan-bot 20dccde
Use narrowed iterable types in IntersectionType::isAcceptedBy() for a…
phpstan-bot 8bbf9bb
Move CallMethodsRule tests for array&callable to separate file and ad…
phpstan-bot ca76429
Use isSuperTypeOf as guard in IntersectionType::isAcceptedBy() instea…
phpstan-bot 3afa0ac
Remove doBaz() test case from bug-14549.php per reviewer request
phpstan-bot 3b83616
Add IntersectionType isAcceptedBy and isSubTypeOf tests for array&cal…
phpstan-bot 9759075
Improve IntersectionTypeTest comments and fix hasOffsetValue test case
phpstan-bot 507d88a
Add comment explaining isSuperTypeOf guard in IntersectionType::isAcc…
phpstan-bot 14d9af0
Add isAcceptedBy test for array&hasOffsetValue against union type arr…
phpstan-bot 631138c
Add isAcceptedBy test for array&hasOffsetValue with union accepting type
phpstan-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Report missing iterable value type for array part of
array&callable…
… intersections in `MissingTypehintCheck` - In `MissingTypehintCheck::getIterableTypesWithMissingValueTypehint()`, the special-case block for `array&callable` intersection types was skipping the array part entirely, never checking it for missing value types - Added a check for the array inner type's iterable value type before skipping it, so `callable-array`, `callable&array`, and `array&callable(...)` now correctly report `missingType.iterableValue` when the array has no value type - Updated test expectations for `doIntersection()` (gains a third error for the outer array) and `doFoo()` (now reports missing iterable value type) - Added new test case `doBaz()` with explicit `callable&array` parameter - All consumers of `MissingTypehintCheck` (method/function parameters, return types, properties, constants, @var tags, @phpstan-assert) are automatically fixed since they share the same check
- Loading branch information
commit d4dcc5cbc14ae57a040885bc3aa053cb021537df
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed the
doBaz()method frombug-14549.phpand its corresponding test expectation inMissingMethodParameterTypehintRuleTest.php. All 11,971 tests pass andmake phpstanreports no errors.