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

TranslateErrorException::getCommandData()   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
7
/**
8
 * Exception thrown, when command translation has been unsuccessfull.
9
 *
10
 * @author Tomasz Struczyński <[email protected]>
11
 */
12
class TranslateErrorException extends Exception
13
{
14
    /**
15
     * Command data.
16
     * 
17
     * @var mixed
18
     */
19
    private $commandData;
20
    
21
    /**
22
     * Class constructor.
23
     * 
24
     * @param mixed $commandData
25
     * @param string $message
26
     * @param integer $code
27
     * @param Exception $previous
28
     */
29 1
    public function __construct($commandData, $message = "", $code = 0, Exception $previous = null)
30
    {
31 1
        parent::__construct($message, $code, $previous);
32 1
        $this->commandData = $commandData;
33 1
    }
34
    
35
    /**
36
     * Get command data.
37
     * 
38
     * @return mixed
39
     */
40 1
    function getCommandData()
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...
41
    {
42 1
        return $this->commandData;
43
    }
44
}
45