Fix hasOffsetValueType with object#4272
Conversation
2e36453 to
e5c5399
Compare
|
@ondrejmirtes you reported in #4164
The reason was the fact that I tried to fix this, but now I'm getting the a LegacyNodeScope test failure because is now understood as an error and not mixed ; it's related to phpstan-src/src/PhpDoc/TypeNodeResolver.php Line 1230 in 5a39902 Does the change seems ok to you ? If not any idea how I should fix it ? |
|
What I don't get currently is why is considered as mixed by PHPStan, and why is considered as Changing this might be a correct way to finish this PR ; I'm open to any advice ondrej. |
|
The behavior for So I had to update the test. |
|
This pull request has been marked as ready for review. |
| ], | ||
| [ | ||
| 'mixed', | ||
| '*ERROR*', |
There was a problem hiding this comment.
Phpdoc use array[array]
|
Thank you! |
Cf https://www.php.net/manual/en/language.types.array.php
Arrays and objects can not be used as keys. Doing so will result in a warning: Illegal offset type.
So ObjectType::toArrayKey should be an error.