Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2.004 |
Changes | 0 |
1 | <?php |
||
17 | 2 | protected function removeOlderThan($objectName, $field, \DateTime $olderThan) |
|
18 | { |
||
19 | /** @var DocumentManager $objectManager */ |
||
20 | 2 | $objectManager = $this->getObjectManager(); |
|
21 | 2 | $qb = $objectManager->createQueryBuilder($objectName); |
|
22 | $qb |
||
23 | 2 | ->remove() |
|
24 | 2 | ->field($field)->lt($olderThan); |
|
25 | |||
26 | 2 | $query = $qb->getQuery(); |
|
27 | 2 | $result = $query->execute(); |
|
28 | 2 | if (isset($result['n'])) { |
|
29 | 2 | return $result['n']; |
|
30 | } |
||
31 | |||
32 | return 0; |
||
33 | } |
||
34 | |||
53 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.