@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * The two token types we're looking for. |
| 13 | 13 | * @var array |
| 14 | 14 | */ |
| 15 | - protected $booleans = ['T_FALSE', 'T_TRUE']; |
|
| 15 | + protected $booleans = [ 'T_FALSE', 'T_TRUE' ]; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Returns the token types that this sniff is interested in. |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function register() |
| 22 | 22 | { |
| 23 | - return [T_FUNCTION]; |
|
| 23 | + return [ T_FUNCTION ]; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $tokens = $phpcsFile->getTokens(); |
| 37 | 37 | |
| 38 | - $token = $tokens[$stackPtr]; |
|
| 39 | - $openParenIndex = $token['parenthesis_opener']; |
|
| 40 | - $closedParenIndex = $token['parenthesis_closer']; |
|
| 38 | + $token = $tokens[ $stackPtr ]; |
|
| 39 | + $openParenIndex = $token[ 'parenthesis_opener' ]; |
|
| 40 | + $closedParenIndex = $token[ 'parenthesis_closer' ]; |
|
| 41 | 41 | |
| 42 | - for ($index=$openParenIndex+1; $index <= $closedParenIndex; $index++) { |
|
| 43 | - if (in_array($tokens[$index]['type'], $this->booleans)) { |
|
| 42 | + for ($index = $openParenIndex + 1; $index <= $closedParenIndex; $index++) { |
|
| 43 | + if (in_array($tokens[ $index ][ 'type' ], $this->booleans)) { |
|
| 44 | 44 | $phpcsFile->addError("Function/method contains a flag parameter.", $stackPtr); |
| 45 | 45 | continue; |
| 46 | 46 | } |