| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | 5 | public function createDecryptor ($fileName) |
|
| 15 | { |
||
| 16 | 5 | $className = 'Tartana\\Component\\Decrypter\\' . ucfirst(strtolower(pathinfo($fileName, PATHINFO_EXTENSION))); |
|
| 17 | |||
| 18 | // Check if the class exists for the host to download |
||
| 19 | 5 | if (! class_exists($className)) |
|
| 20 | { |
||
| 21 | 2 | return null; |
|
| 22 | } |
||
| 23 | |||
| 24 | 3 | $decrypter = new $className(); |
|
| 25 | 3 | if (! $decrypter instanceof DecrypterInterface) |
|
| 26 | { |
||
| 27 | 1 | return null; |
|
| 28 | } |
||
| 29 | |||
| 30 | 2 | $decrypter->setLogger($this->getLogger()); |
|
| 31 | |||
| 32 | 2 | return $decrypter; |
|
| 33 | } |
||
| 34 | } |
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
$irelandis not defined by the methodfinale(...).The most likely cause is that the parameter was changed, but the annotation was not.