Test Failed
Pull Request — master (#1)
by
unknown
06:51 queued 03:18
created

AfricasTalkingMessage::from()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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