Skip to content

Commit

Permalink
Merge pull request #76 from PHPCSStandards/php-8.3/generic-scopeinden…
Browse files Browse the repository at this point in the history
…t-bugfix

PHP 8.3 | Generic/ScopeIndent: bug fix - missing defensive coding
  • Loading branch information
jrfnl authored Dec 4, 2023
2 parents b737635 + eeee4e6 commit 814d4a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,11 @@ public function process(File $phpcsFile, $stackPtr)
if ($tokens[$i]['code'] === T_CONSTANT_ENCAPSED_STRING
|| $tokens[$i]['code'] === T_DOUBLE_QUOTED_STRING
) {
$i = $phpcsFile->findNext($tokens[$i]['code'], ($i + 1), null, true);
$i--;
$nextNonTextString = $phpcsFile->findNext($tokens[$i]['code'], ($i + 1), null, true);
if ($nextNonTextString !== false) {
$i = ($nextNonTextString - 1);
}

continue;
}

Expand Down

0 comments on commit 814d4a7

Please sign in to comment.