Skip to content

Consider ArrayAccess side effects for dead catch analysis#5117

Open
VincentLanglet wants to merge 1 commit intophpstan:2.1.xfrom
VincentLanglet:fix/11427
Open

Consider ArrayAccess side effects for dead catch analysis#5117
VincentLanglet wants to merge 1 commit intophpstan:2.1.xfrom
VincentLanglet:fix/11427

Conversation

@VincentLanglet
Copy link
Contributor

  • Synthesize offsetGet throw points in ArrayDimFetch handler for ArrayAccess objects
  • Synthesize offsetUnset throw points in Unset_ handler for ArrayAccess objects
  • Synthesize offsetExists throw points in Isset_ handler for ArrayAccess objects
  • offsetSet was already handled; this brings the other three operations to parity
  • New regression test in tests/PHPStan/Rules/Exceptions/data/bug-11427.php

From #4910

Closes phpstan/phpstan#11427

- Synthesize offsetGet throw points in ArrayDimFetch handler for ArrayAccess objects
- Synthesize offsetUnset throw points in Unset_ handler for ArrayAccess objects
- Synthesize offsetExists throw points in Isset_ handler for ArrayAccess objects
- offsetSet was already handled; this brings the other three operations to parity
- New regression test in tests/PHPStan/Rules/Exceptions/data/bug-11427.php
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants