Passed
Push — master ( 2f714f...1c67eb )
by Sebastian
02:15
created

Mailcode_Factory_Exception   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 3 1
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Factory_Exception} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Core
7
 * @see Mailcode_Factory_Exception
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Factory-specific exception.
16
 *
17
 * @package Mailcode
18
 * @subpackage Core
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
class Mailcode_Factory_Exception extends Mailcode_Exception
22
{
23
   /**
24
    * @var Mailcode_Commands_Command|NULL
25
    */
26
    protected $command;
27
    
28
   /**
29
    * @param string $message
30
    * @param string|NULL $details
31
    * @param int|NULL $code
32
    * @param \Exception|NULL $previous
33
    * @param Mailcode_Commands_Command|NULL $command
34
    */
35
    public function __construct(string $message, $details=null, $code=null, $previous=null, Mailcode_Commands_Command $command=null)
36
    {
37
        parent::__construct($message, $details, $code, $previous);
38
        
39
        $this->command = $command;
40
    }
41
    
42
   /**
43
    * Retrieves the erroneous command, if any.
44
    * 
45
    * @return Mailcode_Commands_Command|NULL
46
    */
47
    public function getCommand() : ?Mailcode_Commands_Command
48
    {
49
        return $this->command;
50
    }
51
}
52