JobFailedEvent   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

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