Completed
Pull Request — master (#4)
by Simon
06:14
created

SipgateMessage   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 111
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 0
dl 0
loc 111
ccs 0
cts 53
cp 0
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A getSmsId() 0 4 1
A smsId() 0 6 1
A getMessage() 0 4 1
A message() 0 6 1
A getRecipient() 0 4 1
A recipient() 0 6 1
A getSendAt() 0 4 1
A sendAt() 0 6 1
A toArray() 0 9 1
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