Skip to content

AbstractArrayDeclarationSniff::getActualArrayKey(): catch catchable exceptions - #775

Merged
jrfnl merged 1 commit into
developfrom
feature/abstractarraydeclarationsniff-getactualarraykey-improve-exception-handling
Jul 27, 2026
Merged

jrfnl merged 1 commit into
developfrom
feature/abstractarraydeclarationsniff-getactualarraykey-improve-exception-handling

Conversation

@jrfnl

@jrfnl jrfnl commented Jul 27, 2026

Copy link
Copy Markdown
Member

As things were, if the eval()-ed code would result in a catchable exception, PHPCS would crash and exit.

This commit hardens the method by adding extra defensive coding to prevent this.

Includes tests.

…xceptions

As things were, if the `eval()`-ed code would result in a catchable exception, PHPCS would crash and exit.

This commit hardens the method by adding extra defensive coding to prevent this.

Includes tests.
@jrfnl

jrfnl commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Merging as the markdown lint failure is nonsense.

@jrfnl
jrfnl merged commit 533d077 into develop Jul 27, 2026
109 of 116 checks passed
@jrfnl
jrfnl deleted the feature/abstractarraydeclarationsniff-getactualarraykey-improve-exception-handling branch July 27, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant