Skip to content

Commit 8f656d2

Browse files
committed
Respect coding standards
1 parent 32b59b9 commit 8f656d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
7373
$fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data);
7474
if ($fix === true) {
7575
$correctOpening = '<?php';
76-
if (isset($tokens[$stackPtr + 1]) === true && $tokens[$stackPtr + 1]['code'] !== T_WHITESPACE) {
77-
// Avoid creation of invalid open tags like <?phpecho if the original was <?echo
76+
if (isset($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
77+
// Avoid creation of invalid open tags like <?phpecho if the original was <?echo .
7878
$correctOpening .= ' ';
7979
}
80+
8081
$phpcsFile->fixer->replaceToken($stackPtr, $correctOpening);
8182
}
8283

0 commit comments

Comments
 (0)