JobEvent::getJob()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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
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 3
    public function __construct(string $type, Job $job)
28
    {
29 3
        parent::__construct($type);
30 3
        $this->job  = $job;
31 3
    }
32
33
    /**
34
     * @return Job
35
     */
36 1
    public function getJob() : Job
37
    {
38 1
        return $this->job;
39
    }
40
}
41