QueueProcessErrorEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getException() 0 4 1
1
<?php
2
3
namespace Gendoria\CommandQueueBundle\Event;
4
5
use Exception;
6
use Gendoria\CommandQueue\Command\CommandInterface;
7
use Gendoria\CommandQueue\CommandProcessor\CommandProcessorInterface;
8
use Gendoria\CommandQueue\Worker\WorkerInterface;
9
10
/**
11
 * Event raised, when queue worker is run.
12
 *
13
 * @author Tomasz Struczyński <[email protected]>
14
 */
15
class QueueProcessErrorEvent extends QueueProcessEvent
16
{
17
    /**
18
     * Exception.
19
     * 
20
     * @var Exception
21
     */
22
    private $exception;
23
    
24
    /**
25
     * Class constructor.
26
     *
27
     * @param WorkerInterface           $worker Worker processing this command.
28
     * @param CommandInterface          $command
29
     * @param CommandProcessorInterface $processor
30
     * @param Exception                 $e
31
     * @param string                    $subsystem Subsystem name.
32
     */
33 2
    public function __construct(WorkerInterface $worker, CommandInterface $command, CommandProcessorInterface $processor, Exception $e, $subsystem = null)
34
    {
35 2
        parent::__construct($worker, $command, $processor, $subsystem);
36 2
        $this->exception = $e;
37 2
    }
38
    
39
    /**
40
     * Return exception.
41
     * 
42
     * @return Exception
43
     */
44 1
    public function getException()
45
    {
46 1
        return $this->exception;
47
    }
48
}
49