Skip to content

Commit f259845

Browse files
authored
Merge pull request #956 from PHPCSStandards/feature/generic-scopeindent-prevent-undefined-index-notice-debug-mode
Generic/ScopeIndent: bug fix for debug mode
2 parents aa409cb + ad559e4 commit f259845

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ public function process(File $phpcsFile, $stackPtr)
644644
}
645645

646646
$conditionToken = array_pop($openScopes);
647-
if ($this->debug === true) {
647+
if ($this->debug === true && $conditionToken !== null) {
648648
$line = $tokens[$conditionToken]['line'];
649649
$type = $tokens[$conditionToken]['type'];
650650
echo "\t=> removed open scope $conditionToken ($type) on line $line".PHP_EOL;

0 commit comments

Comments
 (0)