| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | 1 | public function process(PHP_CodeSniffer_File $file, $position) |
|
| 50 | { |
||
| 51 | 1 | $tokens = $file->getTokens(); |
|
| 52 | 1 | $classNameStart = $tokens[$position + 2]['content']; |
|
| 53 | |||
| 54 | 1 | if ($classNameStart === '\\') { |
|
| 55 | 1 | if ($this->isExcludedClassName($tokens[$position + 3]['content'])) { |
|
| 56 | 1 | return; |
|
| 57 | } |
||
| 58 | 1 | $file->addError('Class name after new/instanceof should not start with slash.', $position); |
|
| 59 | } |
||
| 60 | 1 | } |
|
| 61 | |||
| 76 |