Completed
Push — master ( 66ec7e...c9ec0a )
by Matze
07:32
created

JobEvent::getJob()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace BrainExe\Core\EventDispatcher;
4
5
use BrainExe\Core\MessageQueue\Job;
6
use BrainExe\Core\Traits\JsonSerializableTrait;
7
8
/**
9
 * @api
10
 */
11 View Code Duplication
class JobEvent extends AbstractEvent implements PushViaWebsocket
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    use JsonSerializableTrait;
14
15
    const ADDED   = 'message_queue.added';
16
    const HANDLED = 'message_queue.handled';
17
18
    /**
19
     * @var Job
20
     */
21
    private $job;
22
23
    /**
24
     * @param string $type
25
     * @param Job $job
26
     */
27
    public function __construct(string $type, Job $job)
28
    {
29
        parent::__construct($type);
30
        $this->job  = $job;
31
    }
32
33
    /**
34
     * @return Job
35
     */
36
    public function getJob() : Job
37
    {
38
        return $this->job;
39
    }
40
}
41