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

JobFailedEvent::getConnectionName()   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 JobFailedEvent
11
 * Event on jobs failed
12
 *
13
 * @author Virchenko Maksim <[email protected]>
14
 *
15
 * @package SfCod\QueueBundle\Events
16
 */
17
class JobFailedEvent 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 that caused the job to fail.
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
     * @param array $config
0 ignored issues
show
Bug introduced by
There is no parameter named $config. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
47
     */
48
    public function __construct(string $connectionName, JobContractInterface $job, Exception $exception)
49
    {
50
        $this->job = $job;
51
        $this->exception = $exception;
52
        $this->connectionName = $connectionName;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getConnectionName(): string
59
    {
60
        return $this->connectionName;
61
    }
62
63
    /**
64
     * @return JobContractInterface
65
     */
66
    public function getJob(): JobContractInterface
67
    {
68
        return $this->job;
69
    }
70
71
    /**
72
     * @return Exception
73
     */
74
    public function getException(): Exception
75
    {
76
        return $this->exception;
77
    }
78
}
79