| Conditions | 5 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 65 | protected function getClassFromFile($path) |
||
| 66 | { |
||
| 67 | $count = count($tokens = token_get_all(file_get_contents($path))); |
||
| 68 | |||
| 69 | for ($i = 2; $i < $count; ++$i) { |
||
| 70 | if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) { |
||
| 71 | return $tokens[$i][1]; |
||
| 72 | } |
||
| 73 | } |
||
| 74 | } |
||
| 75 | } |
||
| 76 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.