Test Failed
Push — master ( e0bb23...a0e316 )
by Antonio Carlos
31:20
created

src/Checkers/Queue.php (3 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace PragmaRX\Health\Checkers;
4
5
use Illuminate\Queue\Worker;
6
use Queue as IlluminateQueue;
7
use Illuminate\Queue\WorkerOptions;
8
use PragmaRX\Health\Support\Result;
9
10
class Queue extends Base
11
{
12
    /**
13
     * Check resource.
14
     *
15
     * @return Result
16
     */
17
    public function check()
18
    {
19
        IlluminateQueue::pushOn(
20
            $this->target->name,
21
            instantiate($this->target->testJob)
0 ignored issues
show
The property testJob does not seem to exist in PragmaRX\Health\Support\Target.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
22
        );
23
24
        $worker = instantiate(Worker::class);
25
26
        $connection = $this->target->connection
0 ignored issues
show
The property connection does not seem to exist in PragmaRX\Health\Support\Target.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
27
            ?: app('config')['queue.default'];
28
29
        $queue = app('config')->get(
30
            "queue.connections.{$connection}.queue",
31
            'default'
32
        );
33
34
        $worker->setCache(instantiate($this->target->cacheInstance)->driver());
0 ignored issues
show
The property cacheInstance does not seem to exist in PragmaRX\Health\Support\Target.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
35
36
        $worker->runNextJob($connection, $queue, $this->gatherWorkerOptions());
37
38
        return $this->makeResult(true);
39
    }
40
41
    /**
42
     * Gather all of the queue worker options as a single object.
43
     *
44
     * @return \Illuminate\Queue\WorkerOptions
45
     */
46
    protected function gatherWorkerOptions()
47
    {
48
        return new WorkerOptions(0, 0, 0, 0, 0, false);
49
    }
50
}
51