diff --git a/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php b/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php index 4ad62f8bb5..fc49c1ad6f 100644 --- a/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -1122,7 +1122,7 @@ public function process(File $phpcsFile, $stackPtr) if ($this->debug === true) { $type = str_replace('_', ' ', strtolower(substr($tokens[$i]['type'], 2))); $line = $tokens[$i]['line']; - echo "* ignoring single-line $type on line $line".PHP_EOL; + echo "* ignoring single-line $type on line $line *".PHP_EOL; } $i = $closer; @@ -1192,7 +1192,7 @@ public function process(File $phpcsFile, $stackPtr) if ($this->debug === true) { $line = $tokens[$i]['line']; $type = $tokens[$i]['type']; - echo "* ignoring single-line $type on line $line".PHP_EOL; + echo "* ignoring single-line $type on line $line *".PHP_EOL; } $i = $closer; @@ -1200,6 +1200,16 @@ public function process(File $phpcsFile, $stackPtr) } $condition = $tokens[$tokens[$i]['scope_condition']]['code']; + if ($condition === T_FN) { + if ($this->debug === true) { + $line = $tokens[$tokens[$i]['scope_condition']]['line']; + echo "* ignoring arrow function on line $line *".PHP_EOL; + } + + $i = $closer; + continue; + } + if (isset(Tokens::$scopeOpeners[$condition]) === true && in_array($condition, $this->nonIndentingScopes, true) === false ) { @@ -1239,7 +1249,7 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$i]['line'] === $tokens[$closer]['line']) { if ($this->debug === true) { $line = $tokens[$i]['line']; - echo "* ignoring single-line JS object on line $line".PHP_EOL; + echo "* ignoring single-line JS object on line $line *".PHP_EOL; } $i = $closer;