Error   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 46
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getReason() 0 4 1
A getMessage() 0 4 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