Message::__construct()   A
last analyzed

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
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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 message
18
 *
19
 * @author Vitaiy Zhuk <[email protected]>
20
 */
21
class Message
22
{
23
    /**
24
     * The name of sender
25
     *
26
     * @var string
27
     */
28
    private $sender;
29
30
    /**
31
     * The text of message
32
     *
33
     * @var string
34
     */
35
    private $message;
36
37
    /**
38
     * Constructor.
39
     *
40
     * @param string $message
41
     * @param string $sender
42
     */
43 4
    public function __construct(string $message, string $sender = null)
44
    {
45 4
        $this->message = $message;
46 4
        $this->sender = $sender;
47 4
    }
48
49
    /**
50
     * Get the name of sender
51
     *
52
     * @return null|string
53
     */
54 3
    public function getSender(): ?string
55
    {
56 3
        return $this->sender;
57
    }
58
59
    /**
60
     * Get the text of message
61
     *
62
     * @return string
63
     */
64 3
    public function getMessage(): string
65
    {
66 3
        return $this->message;
67
    }
68
}
69