Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/NestingLevel: ensure the sniff bails if
scope_closer
is not…
… set Quoting @jrfnl: "Only checking for the scope_opener, when accessing/using both the scope_opener and scope_closer indexes, is probably fine in practical terms. However, the part of the code base which sets these indexes is not sufficiently covered by tests, nor does it document that those indexes will only be set if both can be set, so there may be edge case exceptions" (#684 (comment)). The sniff was already working fine before this change. Checking if `scope_closer` is just an extra precaution to err on the side of caution. This commit also updates the related code comment to better reflect what the if condition does.
- Loading branch information