Skip to content
New issue

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

Fix ArrayAccess destructuring assignment producing mixed. #2903

Draft
wants to merge 2 commits into
base: 1.10.x
Choose a base branch
from

Conversation

mad-briller
Copy link
Contributor

@phpstan-bot
Copy link
Collaborator

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.

@mad-briller mad-briller changed the base branch from 1.11.x to 1.10.x February 2, 2024 18:31
@mad-briller mad-briller marked this pull request as draft February 2, 2024 18:53
@mad-briller
Copy link
Contributor Author

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 mad-briller force-pushed the array-access-destructure branch 3 times, most recently from 2aa8c47 to 1b5a7f8 Compare February 6, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants