Repository navigation
Add TypeTraverser::mapMemoized()
#6652
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
staabm
merged 25 commits into
phpstan:2.3.x
from
phpstan-bot:create-pull-request/patch-6ifasb5
Oct 5, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6787a50
Add `TypeTraverser::mapMemoized()` and compare shared array shape off…
staabm a4bd7b1
Test that a repeated missing iterable value type is reported once reg…
phpstan-bot 3b58c9d
bug number the duplicate error problem
staabm 2dd83cc
free the memo after traversal
staabm e5f1db7
revert hallucination
staabm c12cb48
Revert "revert hallucination"
staabm 3decdf4
Test that a repeated non-generic object type of a generic class is re…
phpstan-bot 25fd8b5
Collect only by key or by flag in TypeTraverser::mapMemoized() callbacks
phpstan-bot 8aa5634
Use TypeTraverser::mapMemoized() for callbacks independent of where a…
phpstan-bot 113e80b
Add a rule choosing between TypeTraverser::map() and mapMemoized() by…
phpstan-bot 5b95472
Hook TypeTraverserMapMemoizedRule on StaticCall
phpstan-bot f4eaf3f
Keep TypeTraverser::map() in GenericObjectTypeCheck::getGenericTypes()
phpstan-bot 3a769e8
Leave callbacks collecting by spl_object_id() to TypeTraverser::map()
phpstan-bot fc1a238
Make TypeTraverserMapMemoizedRule a regular rule
phpstan-bot 9374711
Drop the tests/ ignore for TypeTraverserMapMemoizedRule
phpstan-bot d81481c
Drop auto-fixing from TypeTraverserMapMemoizedRule
phpstan-bot 82cee5b
Revert the ConstantArrayType::checkOurKeys() accepts() cache
phpstan-bot 84388f6
Remove TypeTraverserMapMemoizedRule
phpstan-bot eb8f2d2
Use TypeTraverser::mapMemoized() only on the hot paths of big array s…
phpstan-bot da93e58
Revert merging template errors of all callables in GenericCallableRul…
phpstan-bot 8435521
Revert LocalTypeAliasesCheck::hasErrorType() to TypeTraverser::map()
phpstan-bot b13d051
Revert the lazy verbosity in ObjectShapeType::accepts()
phpstan-bot 6f1568e
Bump expected turbo version
staabm daff12b
cleanup
staabm 459355c
Bump expected turbo version
staabm 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?php | ||
|
|
||
| namespace Bug15350; | ||
|
|
||
| /** | ||
| * @template T | ||
| */ | ||
| class Box | ||
| { | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * @phpstan-type BareArr array | ||
| * @phpstan-type BareBox Box | ||
| */ | ||
| class Foo | ||
| { | ||
|
|
||
| /** | ||
| * @param callable(array): array $a | ||
| */ | ||
| public function inline($a): void | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * @param callable(BareArr): BareArr $a | ||
| */ | ||
| public function alias($a): void | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * @param callable(Box): Box $a | ||
| */ | ||
| public function inlineGeneric($a): void | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * @param callable(BareBox): BareBox $a | ||
| */ | ||
| public function aliasGeneric($a): void | ||
| { | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.