Skip to content

Commit fc2f2dd

Browse files
committed
2 parents e5f3e8b + 5293f30 commit fc2f2dd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,16 @@ public function process(File $phpcsFile, $stackPtr)
211211
break;
212212
}
213213

214-
if ($tokens[$start]['code'] === T_OPEN_PARENTHESIS) {
214+
if (isset($tokens[$start]['parenthesis_closer']) === true
215+
&& $tokens[$start]['code'] === T_OPEN_PARENTHESIS
216+
) {
215217
$start = $tokens[$start]['parenthesis_closer'];
216218
continue;
217219
}
218220

219-
if ($tokens[$start]['code'] === T_OPEN_CURLY_BRACKET) {
221+
if (isset($tokens[$start]['bracket_closer']) === true
222+
&& $tokens[$start]['code'] === T_OPEN_CURLY_BRACKET
223+
) {
220224
$start = $tokens[$start]['bracket_closer'];
221225
continue;
222226
}

0 commit comments

Comments
 (0)