Test Setup Failed
Push — master ( 79a996...894c42 )
by Php Easy Api
04:27
created

DefaultJob::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 5
rs 10
c 1
b 1
f 0
1
<?php
2
3
namespace Resta\Worker;
4
5
use Resta\Contracts\JobContracts;
6
use Resta\Contracts\ApplicationContracts;
7
use Resta\Foundation\ApplicationProvider;
8
use Resta\Contracts\WorkerManagerContracts;
9
10
class DefaultJob extends ApplicationProvider implements JobContracts
11
{
12
    /**
13
     * @var null|object
14
     */
15
    protected $worker;
16
17
    /**
18
     * DefaultJob constructor.
19
     *
20
     * @param ApplicationContracts $app
21
     * @param WorkerManagerContracts $worker
22
     */
23
    public function __construct(ApplicationContracts $app,WorkerManagerContracts $worker)
24
    {
25
        parent::__construct($app);
26
27
        $this->worker = $worker;
28
    }
29
30
    /**
31
     * @return mixed|void
32
     */
33
    public function execute()
34
    {
35
        while(1){
36
            $this->worker->executeObject();
0 ignored issues
show
Bug introduced by
The method executeObject() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
            $this->worker->/** @scrutinizer ignore-call */ 
37
                           executeObject();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
            $this->worker->executeClosure();
38
        }
39
    }
40
41
}