Passed
Pull Request — master (#15)
by Sebastian
04:12
created

Mailcode_Collection_Error::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Commands_Command_ShowVariable} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Collection
7
 * @see Mailcode_Commands_Command_ShowVariable
8
 */
9
10
declare(strict_types=1);
11
12
namespace Mailcode;
13
14
/**
15
 * Mailcode command: show a variable value.
16
 *
17
 * @package Mailcode
18
 * @subpackage Collection
19
 * @author Sebastian Mordziol <[email protected]>
20
 */
21
abstract class Mailcode_Collection_Error
22
{
23
   /**
24
    * @var integer
25
    */
26
    protected int $code = 0;
27
28
   /**
29
    * @var string
30
    */
31
    protected string $matchedText = '';
32
33
   /**
34
    * @var string
35
    */
36
    protected string $message = '';
37
38
    protected ?Mailcode_Commands_Command $command = null;
39
    
40
    public function getCode() : int
41
    {
42
        return $this->code;
43
    }
44
    
45
    public function getMatchedText() : string
46
    {
47
        return $this->matchedText;
48
    }
49
    
50
    public function getMessage() : string
51
    {
52
        return $this->message;
53
    }
54
55
    public function getCommand() : ?Mailcode_Commands_Command
56
    {
57
        return $this->command;
58
    }
59
60
    public function isUnknownCommand() : bool
61
    {
62
        return $this->code === Mailcode_Commands_Command::VALIDATION_UNKNOWN_COMMAND_NAME;
63
    }
64
    
65
    public function isTypeNotSupported() : bool
66
    {
67
        return $this->code === Mailcode_Commands_Command::VALIDATION_ADDONS_NOT_SUPPORTED;
68
    }
69
}
70