Skip to content

Commit 28d5a29

Browse files
committed
Additional fix for bug #20093. Forgot about whitespace.
1 parent 0ee23b2 commit 28d5a29

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

CodeSniffer/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ class MyClass
6565
}
6666

6767
$x = $f?FALSE:true;
68+
$x = $f? FALSE:true;
6869
?>

CodeSniffer/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function getErrorList($testFile='LowerCaseConstantUnitTest.inc')
6060
47 => 1,
6161
48 => 1,
6262
67 => 1,
63+
68 => 1,
6364
);
6465
break;
6566
case 'LowerCaseConstantUnitTest.js':

CodeSniffer/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ class MyClass
6565
}
6666

6767
$x = $f?false:TRUE;
68+
$x = $f? false:TRUE;
6869
?>

CodeSniffer/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function getErrorList()
5656
47 => 1,
5757
48 => 1,
5858
67 => 1,
59+
68 => 1,
5960
);
6061

6162
}//end getErrorList()

CodeSniffer/Tokenizers/PHP.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,21 +445,23 @@ public function tokenizeString($string, $eolChar='\n')
445445
&& $token[0] === T_STRING
446446
&& $tokens[($stackPtr + 1)] === ':'
447447
&& $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM
448-
&& $tokens[($stackPtr - 1)] !== '?'
449448
) {
450449
$stopTokens = array(
451450
T_CASE,
452451
T_SEMICOLON,
453452
T_OPEN_CURLY_BRACKET,
453+
T_INLINE_THEN,
454454
);
455455

456-
for ($x = ($newStackPtr - 2); $x > 0; $x--) {
456+
for ($x = ($newStackPtr - 1); $x > 0; $x--) {
457457
if (in_array($finalTokens[$x]['code'], $stopTokens) === true) {
458458
break;
459459
}
460460
}
461461

462-
if ($finalTokens[$x]['code'] !== T_CASE) {
462+
if ($finalTokens[$x]['code'] !== T_CASE
463+
&& $finalTokens[$x]['code'] !== T_INLINE_THEN
464+
) {
463465
$finalTokens[$newStackPtr] = array(
464466
'content' => $token[1].':',
465467
'code' => T_GOTO_LABEL,

0 commit comments

Comments
 (0)