Skip to content

Commit fc6d400

Browse files
committed
Add E_EXIT to the list of non-operand tokens of the OperatorSpacing sniff
1 parent 1371c59 commit fc6d400

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function register()
7979
$this->nonOperandTokens += [
8080
T_RETURN => T_RETURN,
8181
T_ECHO => T_ECHO,
82+
T_EXIT => T_EXIT,
8283
T_PRINT => T_PRINT,
8384
T_YIELD => T_YIELD,
8485
];

src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,5 +463,7 @@ $a = [$a, - $b];
463463
$a = $a[- $b];
464464
$a = $a ? - $b : - $b;
465465

466+
exit -1;
467+
466468
/* Intentional parse error. This has to be the last test in the file. */
467469
$a = 10 +

src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,5 +457,7 @@ $a = [$a, - $b];
457457
$a = $a[- $b];
458458
$a = $a ? - $b : - $b;
459459

460+
exit -1;
461+
460462
/* Intentional parse error. This has to be the last test in the file. */
461463
$a = 10 +

0 commit comments

Comments
 (0)