Completed
Push — master ( c15062...be395d )
by Simon
03:01
created

SipgateMessage::getRecipient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Simonkub\Laravel\Notifications\Sipgate;
4
5
use Illuminate\Contracts\Support\Arrayable;
6
7
class SipgateMessage implements Arrayable
8
{
9
    /** @var string */
10
    protected $message;
11
12
    /** @var string */
13
    protected $recipient;
14
15
    /** @var string */
16
    protected $smsId;
17
18
    /** @var int */
19
    protected $sendAt;
20
21
    public function __construct($message = '')
22
    {
23
        $this->message = $message;
24
    }
25
26
    public static function create($message = '')
27
    {
28
        return new static($message);
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getSmsId()
35
    {
36
        return $this->smsId;
37
    }
38
39
    /**
40
     * @param  string  $smsId
41
     *
42
     * @return SipgateMessage
43
     */
44
    public function smsId(string $smsId)
45
    {
46
        $this->smsId = $smsId;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getMessage()
55
    {
56
        return $this->message;
57
    }
58
59
    /**
60
     * @param  string  $message
61
     * @return SipgateMessage
62
     */
63
    public function message(string $message)
64
    {
65
        $this->message = $message;
66
67
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getRecipient()
74
    {
75
        return $this->recipient;
76
    }
77
78
    /**
79
     * @param  string  $recipient
80
     * @return SipgateMessage
81
     */
82
    public function recipient(string $recipient)
83
    {
84
        $this->recipient = $recipient;
85
86
        return $this;
87
    }
88
89
    /**
90
     * @return int | null
91
     */
92
    public function getSendAt()
93
    {
94
        return $this->sendAt;
95
    }
96
97
    /**
98
     * @param  int  $sendAt
99
     * @return SipgateMessage
100
     */
101
    public function sendAt($sendAt)
102
    {
103
        $this->sendAt = $sendAt;
104
105
        return $this;
106
    }
107
108
    public function toArray()
109
    {
110
        return [
111
            'message' => $this->message,
112
            'recipient' => $this->recipient,
113
            'smsId' => $this->smsId,
114
            'sendAt' => $this->sendAt,
115
        ];
116
    }
117
}
118