JobProcessedEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 44
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getConnectionName() 0 4 1
A getJob() 0 4 1
1
<?php
2
3
namespace SfCod\QueueBundle\Event;
4
5
use SfCod\QueueBundle\Job\JobContractInterface;
6
use Symfony\Contracts\EventDispatcher\Event;
7
8
/**
9
 * Class JobProcessedEvent
10
 * Event on job processed event
11
 *
12
 * @author Virchenko Maksim <[email protected]>
13
 *
14
 * @package SfCod\QueueBundle\Events
15
 */
16
class JobProcessedEvent extends Event
17
{
18
    /**
19
     * The connection name.
20
     *
21
     * @var string
22
     */
23
    protected $connectionName;
24
25
    /**
26
     * The job instance.
27
     *
28
     * @var JobContractInterface
29
     */
30
    protected $job;
31
32
    /**
33
     * Create a new event instance.
34
     *
35
     * @param string $connectionName
36
     * @param JobContractInterface $job
37
     */
38
    public function __construct(string $connectionName, JobContractInterface $job)
39
    {
40
        $this->job = $job;
41
        $this->connectionName = $connectionName;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getConnectionName(): string
48
    {
49
        return $this->connectionName;
50
    }
51
52
    /**
53
     * @return JobContractInterface
54
     */
55
    public function getJob(): JobContractInterface
56
    {
57
        return $this->job;
58
    }
59
}
60