-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
phpstan/phpstan-src
#3770Labels
Description
Bug report
There seems to be a small issue with specificity when using array_merge and array shapes.
It seems to force non-empty-array<'page'|'perPage', int>
over the more specific array{page: int, perPage?: int}
.
It also passes when rewritten with if statements without array_merge.
Code snippet that reproduces the problem
Expected output
I'm expecting it to pass since the array shape is more specific in that page is always present but perPage not always.
Also passes in Psalm
Did PHPStan help you today? Did it make you happy in any way?
Great project, keep it up!