| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
| 31 | { |
||
| 32 | $tokens = $phpcsFile->getTokens(); |
||
| 33 | |||
| 34 | $token = $tokens[$stackPtr]; |
||
| 35 | $openParenIndex = $token['parenthesis_opener']; |
||
| 36 | $closedParenIndex = $token['parenthesis_closer']; |
||
| 37 | |||
| 38 | for ($index=$openParenIndex+1; $index <= $closedParenIndex; $index++) { |
||
| 39 | if (in_array($tokens[$index]['type'], $this->booleans)) { |
||
| 40 | $phpcsFile->addError("Function/method contains a flag parameter.", $stackPtr); |
||
| 41 | continue; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |