Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented May 21, 2021

While looking at issue #3362 in an attempt to debug it, @BinaryKitten and me came across a An error occurred during processing; checking has been aborted. The error message was: Undefined array key "" in /src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php on line 646 (Internal.Exception) error notice.

While this will probably only occur in exceptional circumstances, it was caused by an operator precedence issue in the scope closer check condition.

Adding the extra parentheses fixes the operator precedence snafu and prevents the above error notice.

Note: this does not fix #3362, but still, is one less bug to worry about ;-)

While looking at issue 3362 in an attempt to debug it, binarykitten and me came across a `An error occurred during processing; checking has been aborted. The error message was: Undefined array key "" in /src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php on line 646 (Internal.Exception)` error notice.

While this will probably only occur in exceptional circumstances, it was caused by an operator precedence issue in the scope closer check condition.

Adding the extra parentheses fixes the operator precedence snafu and prevents the above error notice.

Note: this does not fix 3362, but still, is one less bug to worry about ;-)
@gsherwood gsherwood merged commit 62dd954 into squizlabs:master Dec 18, 2022
@gsherwood gsherwood added this to the 3.7.2 milestone Dec 18, 2022
@gsherwood
Copy link
Member

Thanks for spotting this. Would be great to have a code sample to expose the issue, but it is 100% an error regardless.

@jrfnl jrfnl deleted the feature/3362-generic-scopeindent-debug branch December 18, 2022 23:30
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 18, 2022

Yeah, we tried to come up with an isolated code sample for this at the time, but that turned out to be pretty hard. Considering it is from quite a while back, I can barely remember how we managed to get that error in the first place.

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.

Generic.WhiteSpace.ScopeIndent false positive for arrow functions inside arrays

2 participants