Completed
Push — master ( 0d9294...008bc0 )
by
unknown
67:58 queued 27:57
created

JobExceptionOccurredEvent::getException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SfCod\QueueBundle\Event;
4
5
use Exception;
6
use SfCod\QueueBundle\Job\JobContractInterface;
7
use Symfony\Component\EventDispatcher\Event;
8
9
/**
10
 * Class JobExceptionOccurredEvent
11
 * Event on job exception occured
12
 *
13
 * @author Virchenko Maksim <[email protected]>
14
 *
15
 * @package SfCod\QueueBundle\Events
16
 */
17
class JobExceptionOccurredEvent extends Event
18
{
19
    /**
20
     * The connection name.
21
     *
22
     * @var string
23
     */
24
    protected $connectionName;
25
26
    /**
27
     * The job instance.
28
     *
29
     * @var JobContractInterface
30
     */
31
    protected $job;
32
33
    /**
34
     * The exception instance.
35
     *
36
     * @var \Exception
37
     */
38
    protected $exception;
39
40
    /**
41
     * Create a new event instance.
42
     *
43
     * @param string $connectionName
44
     * @param JobContractInterface $job
45
     * @param Exception $exception
46
     */
47
    public function __construct(string $connectionName, JobContractInterface $job, Exception $exception)
48
    {
49
        $this->job = $job;
50
        $this->exception = $exception;
51
        $this->connectionName = $connectionName;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getConnectionName(): string
58
    {
59
        return $this->connectionName;
60
    }
61
62
    /**
63
     * @return JobContractInterface
64
     */
65
    public function getJob(): JobContractInterface
66
    {
67
        return $this->job;
68
    }
69
70
    /**
71
     * @return Exception
72
     */
73
    public function getException(): Exception
74
    {
75
        return $this->exception;
76
    }
77
}
78