Completed
Push — master ( 0c3913...67a509 )
by Tomasz
03:16
created

MultipleProcessorsException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Gendoria\CommandQueue\ProcessorFactory\Exception;
4
5
use Exception;
6
7
/**
8
 * Exception thrown, when multiple processors are registered for given command class.
9
 *
10
 * @author Tomasz Struczyński <[email protected]>
11
 */
12
class MultipleProcessorsException extends Exception
13
{
14
    /**
15
     * Command class.
16
     *
17
     * @var string
18
     */
19
    private $commandClassName;
20
    
21
    /**
22
     * Class constructor.
23
     *
24
     * @param string    $commandClassName
25
     * @param Exception $previous
26
     */
27 1
    public function __construct($commandClassName, Exception $previous = null)
28
    {
29 1
        $this->commandClassName = $commandClassName;
30 1
        parent::__construct("Multiple processors registered for command class ".$commandClassName, 500, $previous);
31 1
    }
32
    
33
    /**
34
     * Get command class name.
35
     *
36
     * @return string
37
     */
38 1
    public function getCommandClassName()
39
    {
40 1
        return $this->commandClassName;
41
    }
42
}
43