| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function findDispatchable(): array |
||
| 20 | { |
||
| 21 | return $this->createQueryBuilder('o') |
||
| 22 | ->andWhere('o.dispatchAt <= :now') |
||
| 23 | ->andWhere('o.state = :state') |
||
| 24 | ->setParameter('now', new DateTime()) |
||
| 25 | ->setParameter('state', ScheduledMessage::STATE_PENDING) |
||
| 26 | ->setMaxResults(100) // this is just a very basic 'hack' to prevent memory problems |
||
| 27 | ->getQuery() |
||
| 28 | ->getResult() |
||
| 29 | ; |
||
| 32 |