Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2.004 |
Changes | 0 |
1 | <?php |
||
18 | 2 | protected function removeOlderThan($objectName, $field, \DateTime $olderThan) |
|
19 | { |
||
20 | /** @var DocumentManager $objectManager */ |
||
21 | 2 | $objectManager = $this->getObjectManager(); |
|
22 | 2 | $qb = $objectManager->createQueryBuilder($objectName); |
|
23 | $qb |
||
24 | 2 | ->remove() |
|
25 | 2 | ->field($field)->lt($olderThan); |
|
26 | |||
27 | 2 | $query = $qb->getQuery(); |
|
28 | 2 | $result = $query->execute(); |
|
29 | 2 | if (isset($result['n'])) { |
|
30 | 2 | return $result['n']; |
|
31 | } |
||
32 | |||
33 | return 0; |
||
34 | } |
||
35 | |||
49 |
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
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.