We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
It would be nice, if the inferred type of
array_pad(list<string>, int, <string>)
was list<string> instead of just array.
list<string>
array
Code snippet:
https://phpstan.org/r/4ea29c2e-2200-4b09-bd7f-ee631736f6fc
Even more general the following could be inferred:
array_pad(list<TypeA>, int, <TypeB>) => list<TypeA|TypeB>
array_pad(array<TypeA>, int, <TypeB>) => array<array-key, TypeA|TypeB>
array_pad(non-empty-list<TypeA>, int<1, max>, <TypeB>) => non-empty-list<TypeA|TypeB>
array_pad(non-empty-array<TypeA>, int<1, max>, <TypeB>) => non-empty-array<array-key, TypeA|TypeB>
array_pad(list<TypeA>, int<1, max>, <TypeB>) => non-empty-list<TypeA|TypeB>
array_pad(array<TypeA>, int<1, max>, <TypeB>) => non-empty-array<array-key, TypeA|TypeB>
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Feature request
It would be nice, if the inferred type of
was
list<string>
instead of justarray
.Code snippet:
https://phpstan.org/r/4ea29c2e-2200-4b09-bd7f-ee631736f6fc
Even more general the following could be inferred:
array_pad(non-empty-list<TypeA>, int<1, max>, <TypeB>) => non-empty-list<TypeA|TypeB>
array_pad(non-empty-array<TypeA>, int<1, max>, <TypeB>) => non-empty-array<array-key, TypeA|TypeB>
array_pad(list<TypeA>, int<1, max>, <TypeB>) => non-empty-list<TypeA|TypeB>
array_pad(array<TypeA>, int<1, max>, <TypeB>) => non-empty-array<array-key, TypeA|TypeB>
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: