-
-
Notifications
You must be signed in to change notification settings - Fork 913
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
List shapes #8789
Comments
Hi, I don't really understand the difference between:
and
Can you please explain where would they behave differently in PHPStan? |
Those examples match The following shapes are not allowed in
These patterns can emulate Psalm's behavior by outputting them as the intersection of an array shape and Also, PHPStan does not yet implement sealed array shapes, so proper support requires changes beyond the parser. |
What do you mean? They're going to behave exactly the same way?
Oh yeah, we could do the same thing here. If the ArrayShapeNode kind is |
Implemented: phpstan/phpstan-src#2202 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature request
List shapes is a variant of array shapes introduced in Psalm 5 that only support implicit and integer-indexed keys.
The first step is to just parse
list{}
as an alias forarray{}
for interoperability with Psalm.Did PHPStan help you today? Did it make you happy in any way?
This week I am writing an 8-page article to introduce PHPStan at the PHPerKaigi Japanese conference.
The text was updated successfully, but these errors were encountered: