Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | protected function getSource($packagePath) |
||
29 | { |
||
30 | $sources = [ |
||
31 | "{$packagePath}/resources/routes", |
||
32 | "{$packagePath}/routes", |
||
33 | ]; |
||
34 | |||
35 | foreach ($sources as $source) { |
||
36 | if ($this->files->isDirectory($source)) { |
||
37 | return $source; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | throw new InvalidArgumentException('Configuration not found.'); |
||
42 | } |
||
43 | } |
||
44 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.