JobQueueEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getJob() 0 3 1
A __construct() 0 4 1
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