Skip to content

Commit

Permalink
The T_POW_EQUAL token does not exists on PHP version 5.5. Added a def…
Browse files Browse the repository at this point in the history
…ined check to make sure that it's used only on newer versions.
  • Loading branch information
waltertamboer committed Aug 21, 2015
1 parent c4e5611 commit 566bbc3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions PolderKnowledge/Sniffs/WhiteSpace/AssignmentSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

public function register()
{
return array(
$tokens = array(
T_EQUAL,
T_AND_EQUAL,
T_CONCAT_EQUAL,
Expand All @@ -51,10 +51,16 @@ public function register()
T_MUL_EQUAL,
T_OR_EQUAL,
T_PLUS_EQUAL,
T_POW_EQUAL,
T_SL_EQUAL,
T_SR_EQUAL,
T_XOR_EQUAL,
);

// T_POW_EQUAL is only available from PHP 5.6
if (defined('T_POW_EQUAL')) {
$tokens[] = T_POW_EQUAL;
}

return $tokens;
}
}

0 comments on commit 566bbc3

Please sign in to comment.