Skip to content

Commit e8bdb51

Browse files
committed
2 parents d185d58 + fd107c9 commit e8bdb51

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ public function register()
5555
public function process(File $phpcsFile, $stackPtr)
5656
{
5757
$tokens = $phpcsFile->getTokens();
58+
if (isset($tokens[($stackPtr + 2)]) === false) {
59+
// Syntax error or live coding, bow out.
60+
return;
61+
}
5862

5963
$ignoreBefore = false;
6064
$prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);

0 commit comments

Comments
 (0)