| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | protected function removeOlderThan($objectName, $field, \DateTime $olderThan) |
||
| 18 | { |
||
| 19 | /** @var DocumentManager $objectManager */ |
||
| 20 | $objectManager = $this->getObjectManager(); |
||
| 21 | $qb = $objectManager->createQueryBuilder($objectName); |
||
| 22 | $qb |
||
| 23 | ->remove() |
||
| 24 | ->field($field)->lt($olderThan); |
||
| 25 | |||
| 26 | $query = $qb->getQuery(); |
||
| 27 | $result = $query->execute(); |
||
| 28 | if (isset($result['n'])) { |
||
| 29 | 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.