Skip to content

Commit 566bbc3

Browse files
committed
The T_POW_EQUAL token does not exists on PHP version 5.5. Added a defined check to make sure that it's used only on newer versions.
1 parent c4e5611 commit 566bbc3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

PolderKnowledge/Sniffs/WhiteSpace/AssignmentSpacingSniff.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
4141

4242
public function register()
4343
{
44-
return array(
44+
$tokens = array(
4545
T_EQUAL,
4646
T_AND_EQUAL,
4747
T_CONCAT_EQUAL,
@@ -51,10 +51,16 @@ public function register()
5151
T_MUL_EQUAL,
5252
T_OR_EQUAL,
5353
T_PLUS_EQUAL,
54-
T_POW_EQUAL,
5554
T_SL_EQUAL,
5655
T_SR_EQUAL,
5756
T_XOR_EQUAL,
5857
);
58+
59+
// T_POW_EQUAL is only available from PHP 5.6
60+
if (defined('T_POW_EQUAL')) {
61+
$tokens[] = T_POW_EQUAL;
62+
}
63+
64+
return $tokens;
5965
}
6066
}

0 commit comments

Comments
 (0)