Error::getMessage()   A
last analyzed

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
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the SmsGate package
7
 *
8
 * (c) SmsGate
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code
12
 */
13
14
namespace SmsGate;
15
16
/**
17
 * The value object for store error of send sms.
18
 *
19
 * @author Vitaliy Zhuk <[email protected]>
20
 */
21
class Error
22
{
23
    /**
24
     * @see ErrorReasons
25
     *
26
     * @var string
27
     */
28
    private $reason;
29
30
    /**
31
     * @var string
32
     */
33
    private $message;
34
35
    /**
36
     * Constructor.
37
     *
38
     * @param string $reason
39
     * @param string $message
40
     */
41 5
    public function __construct(string $reason, string $message = null)
42
    {
43 5
        $this->reason = $reason;
44 5
        $this->message = $message;
45 5
    }
46
47
    /**
48
     * Get the reason of error
49
     *
50
     * @return string
51
     */
52 2
    public function getReason(): string
53
    {
54 2
        return $this->reason;
55
    }
56
57
    /**
58
     * Get the message of error
59
     *
60
     * @return string
61
     */
62 2
    public function getMessage(): ?string
63
    {
64 2
        return $this->message;
65
    }
66
}
67