Test Failed
Pull Request — master (#1)
by
unknown
05:13
created

AfricasTalkingMessage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 9
c 2
b 1
f 0
dl 0
loc 53
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A from() 0 5 1
A content() 0 5 1
A getContent() 0 3 1
A getSender() 0 3 1
1
<?php
2
3
namespace NotificationChannels\AfricasTalking;
4
5
class AfricasTalkingMessage
6
{
7
    /** @var string */
8
    protected $content;
9
10
    /** @var string|null */
11
    protected $from;
12
13
    /**
14
     * Set the content for this message
15
     * 
16
     * 
17
     * @param string $content
18
     * @return this
19
     */
20
    public function content(string $content): self
21
    {
22
        $this->content = trim($content);
23
24
        return $this;
25
    }
26
27
    /**
28
     * Set the sender for this message
29
     * 
30
     * @param string $from
31
     * @return this
32
     */
33
    public function from(string $from): self
34
    {
35
        $this->from = trim($from);
36
37
        return $this;
38
    }
39
40
    /**
41
     * Get Message Content
42
     * 
43
     * @return string
44
     */
45
    public function getContent()
46
    {
47
        return $this->content;
48
    }
49
50
    /**
51
     * Get Sender Info
52
     * 
53
     * @return string
54
     */
55
    public function getSender()
56
    {
57
        return $this->from ?? config('services.africastalking.from');
58
    }
59
}
60