JobFailedEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
namespace yiicod\jobqueue\events;
4
5
use yii\base\Event;
6
7
/**
8
 * Class JobFailedEvent
9
 * Event on jobs failed
10
 *
11
 * @author Virchenko Maksim <[email protected]>
12
 *
13
 * @package yiicod\jobqueue\events
14
 */
15
class JobFailedEvent extends Event
16
{
17
    /**
18
     * The connection name.
19
     *
20
     * @var string
21
     */
22
    public $connectionName;
23
24
    /**
25
     * The job instance.
26
     *
27
     * @var \Illuminate\Contracts\Queue\Job
28
     */
29
    public $job;
30
31
    /**
32
     * The exception that caused the job to fail.
33
     *
34
     * @var \Exception
35
     */
36
    public $exception;
37
38
    /**
39
     * Create a new event instance.
40
     *
41
     * @param string $connectionName
42
     * @param \Illuminate\Contracts\Queue\Job $job
43
     * @param \Exception $exception
44
     * @param array $config
45
     */
46
    public function __construct($connectionName, $job, $exception, array $config = [])
47
    {
48
        parent::__construct($config);
49
50
        $this->job = $job;
51
        $this->exception = $exception;
52
        $this->connectionName = $connectionName;
53
    }
54
}
55