phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Fix ArrayAccess destructuring assignment producing mixed.

Open mad-briller opened this issue 2 years ago • 2 comments

Fixes https://github.com/phpstan/phpstan/issues/9456

mad-briller avatar Feb 02 '24 18:02 mad-briller

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

phpstan-bot avatar Feb 02 '24 18:02 phpstan-bot

It appears changing the order of these operations breaks analysis of PrestaShop here: https://github.com/PrestaShop/PrestaShop/blob/develop/classes/LocalizationPack.php#L495

I can't seem to recreate an *ERROR* type from the $attributes['install'] == 1 expression in a NodeScopeResolver test or a Rule test for InvalidComparisonOperationRule, and (SimpleXMLElement|null) isn't instanceof ArrayAccess so i can't see how it would be affected anyway.

what's interesting is 2 lines above the expression is an offset access to the $attributes value which isn't reported as an issue.

not sure how to proceed; i've added a second commit which shows the rule test for the operation that i tried to recreate, a little advice or direction would be a big help, thanks

mad-briller avatar Feb 02 '24 19:02 mad-briller