Test Failed
Pull Request — master (#1)
by
unknown
04:19
created

AfricasTalkingMessage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

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

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 content for this message.
15
     *
16
     * @param string $content
17
     * @return this
18
     */
19
    public function content(string $content): self
20
    {
21
        $this->content = trim($content);
22
23
        return $this;
24
    }
25
26
    /**
27
     * Set sender for this message.
28
     *
29
     * @param string $from
30
     * @return self
31
     */
32
    public function from(string $from): self
33
    {
34
        $this->from = trim($from);
35
36
        return $this;
37
    }
38
39
    /**
40
     * Get message content.
41
     *
42
     * @return string
43
     */
44
    public function getContent()
45
    {
46
        return $this->content;
47
    }
48
49
    /**
50
     * Get sender info.
51
     *
52
     * @return string
53
     */
54
    public function getSender()
55
    {
56
        return $this->from ?? config('services.africastalking.from');
57
    }
58
}
59