| Conditions | 4 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 4.0047 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 2 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
|
| 46 | { |
||
| 47 | 2 | if ($this->supportsBelow('7.0') === false) { |
|
| 48 | 1 | return; |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | $tokens = $phpcsFile->getTokens(); |
|
| 52 | 1 | $token = $tokens[$stackPtr]; |
|
| 53 | |||
| 54 | // Bow out during live coding. |
||
| 55 | 1 | if (isset($token['parenthesis_opener'], $token['parenthesis_closer']) === false) { |
|
| 56 | 1 | return; |
|
| 57 | } |
||
| 58 | |||
| 59 | 1 | $hasBitwiseOr = $phpcsFile->findNext(T_BITWISE_OR, $token['parenthesis_opener'], $token['parenthesis_closer']); |
|
| 60 | |||
| 61 | 1 | if ($hasBitwiseOr === false) { |
|
| 62 | 1 | return; |
|
| 63 | } |
||
| 64 | |||
| 65 | 1 | $phpcsFile->addError( |
|
| 66 | 1 | 'Catching multiple exceptions within one statement is not supported in PHP 7.0 or earlier.', |
|
| 67 | $hasBitwiseOr, |
||
| 68 | 1 | 'Found' |
|
| 69 | ); |
||
| 70 | |||
| 71 | 1 | }//end process() |
|
| 72 | |||
| 74 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.