-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
- Create a file with a class defining a phpstan type alias with an array shape like
array{user?: string} - Create a second file with a class importing that type and using it for its method argument.
- In both classes, create a method taking that type alias as argument. Inside the method, write code accessing the
userkey without account for it being potentially undefined. - Generate the baseline file containing those 2 errors (one per file)
- Edit the type alias to be the shape
array{user: string} - Run phpstan again
- See that the errors from the file defining the type alias is properly reported as an unmatched ignored error but the error from the second file is not
- Run
phpstan clear-result-cache - Run phpstan again
- See that both ignored errors are reported as unmatched
Code snippet that reproduces the problem
No response
Expected output
I would expect a change in a type alias in a class to properly invalidate the result cache of files in which that type was imported and referenced, so that I don't need to clear the result cache to get a reliable output when using imported types.
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels