| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| 1 | <?php |
||
| 48 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
| 49 | { |
||
| 50 | $nextClass = $phpcsFile->findNext($this->register(), ($stackPtr + 1)); |
||
| 51 | if ($nextClass !== false) { |
||
| 52 | $error = 'Only one trait is allowed in a file'; |
||
| 53 | $phpcsFile->addError($error, $nextClass, 'MultipleFound'); |
||
| 54 | } |
||
| 55 | |||
| 56 | }//end process() |
||
| 57 | |||
| 60 |
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.