1 | <?php |
||
2 | |||
3 | namespace Dtc\QueueBundle\ORM; |
||
4 | |||
5 | use Doctrine\ORM\EntityManager; |
||
0 ignored issues
–
show
|
|||
6 | use Doctrine\ORM\QueryBuilder; |
||
0 ignored issues
–
show
The type
Doctrine\ORM\QueryBuilder was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
7 | use Dtc\QueueBundle\Doctrine\DoctrineRunManager; |
||
8 | |||
9 | class RunManager extends DoctrineRunManager |
||
10 | { |
||
11 | 1 | use CommonTrait; |
|
0 ignored issues
–
show
|
|||
12 | |||
13 | 15 | public function getObjectManager() |
|
14 | { |
||
15 | 15 | return $this->getObjectManagerReset(); |
|
16 | } |
||
17 | |||
18 | /** |
||
19 | * @return array|mixed |
||
20 | * |
||
21 | * @throws \Exception |
||
22 | */ |
||
23 | 1 | protected function getOldLiveRuns() |
|
24 | { |
||
25 | /** @var EntityManager $objectManager */ |
||
26 | 1 | $objectManager = $this->getObjectManager(); |
|
27 | /** @var QueryBuilder $queryBuilder */ |
||
28 | 1 | $queryBuilder = $objectManager->createQueryBuilder(); |
|
29 | 1 | $queryBuilder->select(['r']) |
|
30 | 1 | ->from($this->getRunClass(), 'r'); |
|
31 | 1 | $time = time() - 86400; |
|
32 | 1 | $date = \DateTime::createFromFormat('U', strval($time)); |
|
33 | 1 | if (false === $date) { |
|
34 | throw new \Exception("Could not create DateTime object from $time"); |
||
35 | } |
||
36 | 1 | $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
37 | 1 | $queryBuilder->where('r.lastHeartbeatAt < :date'); |
|
38 | 1 | $queryBuilder->setParameter(':date', $date); |
|
39 | |||
40 | 1 | return $queryBuilder->getQuery()->getResult(); |
|
41 | } |
||
42 | } |
||
43 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths