You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 user key 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
The text was updated successfully, but these errors were encountered:
Bug report
array{user?: string}
user
key without account for it being potentially undefined.array{user: string}
phpstan clear-result-cache
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
The text was updated successfully, but these errors were encountered: