UseIdenticalOverEqualWithSameTypeRector should not trust phpdoc#6880
UseIdenticalOverEqualWithSameTypeRector should not trust phpdoc#6880samsonasik merged 4 commits intorectorphp:mainfrom
Conversation
|
I am adding a obvious fix, but I am not sure about it, as we see tests failling now - these tests obviously expected a trustfully phpdoc. do we agree these other tests expectations are wrong as they shouldn't trust the phpdoc in the same way? I wonder whether we should/want to trust a array-shape when its produced by a php-src builtin function/method, but not when its based on a userland phpdoc (and whether we are able to differentiate the 2)? created a PHPStan upstream discussion. |
|
In this case, can we detect the type is being compared from an array shale? I'd keep it for other cases, as so far the rule has beem reliable. |
|
thanks for the suggestion. adapted accordingly |
|
Looking good, thank you @staabm |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
No description provided.