Test Setup Failed
Push — master ( 21f1bb...1dec6d )
by Php Easy Api
04:35
created

DefaultJob::start()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
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
    /**
42
     * @return mixed|void
43
     */
44
    public function start()
45
    {
46
        // TODO: Implement start() method.
47
    }
48
49
    /**
50
     * @return mixed|void
51
     */
52
    public function stop()
53
    {
54
        // TODO: Implement stop() method.
55
    }
56
57
    /**
58
     * @return mixed|void
59
     */
60
    public function status()
61
    {
62
        // TODO: Implement status() method.
63
    }
64
}