JobQueueEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 2
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace JCIT\jobqueue\events;
5
6
use JCIT\jobqueue\interfaces\JobInterface;
7
use yii\base\Event;
8
9
class JobQueueEvent extends Event
10
{
11
    public const EVENT_JOB_QUEUE_PUT = 'put';
12
    public const EVENT_JOB_QUEUE_HANDLE = 'handle';
13
14
    /**
15
     * JobQueueEvent constructor.
16
     * @param JobInterface $job
17
     */
18 1
    public function __construct(
19
        private JobInterface $job
20
    ) {
21 1
        parent::__construct();
22 1
    }
23
24 1
    public function getJob(): JobInterface
25
    {
26 1
        return $this->job;
27
    }
28
}
29