Completed
Push — master ( 42ab41...f5b0ad )
by Tomasz
02:38
created

ProcessorErrorException::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Gendoria\CommandQueue\Worker\Exception;
4
5
use Exception;
6
use Gendoria\CommandQueue\Command\CommandInterface;
7
use Gendoria\CommandQueue\CommandProcessor\CommandProcessorInterface;
8
9
/**
10
 * Exception thrown, when command translation has been unsuccessfull.
11
 *
12
 * @author Tomasz Struczyński <[email protected]>
13
 */
14
class ProcessorErrorException extends Exception
15
{
16
    /**
17
     * Command data.
18
     * 
19
     * @var CommandInterface
20
     */
21
    private $command;
22
    
23
    /**
24
     * Command processor.
25
     * 
26
     * @var CommandProcessorInterface
27
     */
28
    private $processor;
29
    
30
    /**
31
     * Class constructor.
32
     * 
33
     * @param CommandInterface $command
34
     * @param CommandProcessorInterface $processor
35
     * @param string $message
36
     * @param integer $code
37
     * @param Exception $previous
38
     */
39 2
    public function __construct(CommandInterface $command, CommandProcessorInterface $processor, $message = "", $code = 0, Exception $previous = null)
40
    {
41 2
        parent::__construct($message, $code, $previous);
42 2
        $this->command = $command;
43 2
        $this->processor = $processor;
44 2
    }
45
    
46
    /**
47
     * Get command.
48
     * 
49
     * @return CommandInterface
50
     */
51 1
    function getCommand()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
52
    {
53 1
        return $this->command;
54
    }
55
56
    /**
57
     * Get command processor.
58
     * 
59
     * @return CommandProcessorInterface
60
     */
61 1
    function getProcessor()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
62
    {
63 1
        return $this->processor;
64
    }
65
}
66