Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible index error in NonExecutableCodeSniff
I was running into this while working on another sniff. One trivial example I found to demonstrate the bug is `<?php return array_map(`. This can happen when PHPCS runs on a file I'm currently typing in, but the file is not complete yet. I believe it's safe to assume the 'parenthesis_closer' array key only exists on T_OPEN_PARENTHESIS tokens, and the 'bracket_closer' key only on T_OPEN_CURLY_BRACKET tokens. I had a quick look at the tokenizer and I believe this is indeed the case. But I might be wrong. Sorry for not providing a test. I would love to, but I'm not familiar enough with the test setup here.
- Loading branch information