Test Failed
Push — master ( a2d350...d0d57c )
by
unknown
16:25 queued 06:16
created

AfricasTalkingMessage::to()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 0
cp 0
crap 2
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
    /** @var string|null */
14
    protected $to;
15
16
    /**
17
     * Set content for this message.
18
     *
19 1
     * @param string $content
20
     * @return this
21 1
     */
22
    public function content(string $content): self
23 1
    {
24
        $this->content = trim($content);
25
26
        return $this;
27
    }
28
29
    /**
30
     * Set sender for this message.
31
     *
32 1
     * @param string $from
33
     * @return self
34 1
     */
35
    public function from(string $from): self
36 1
    {
37
        $this->from = trim($from);
38
39
        return $this;
40
    }
41
42
     /**
43
     * Set recipient for this message.
44 2
     *
45
     * @param string $from
46 2
     * @return self
47
     */
48
    public function to(string $to): self
49
    {
50
        $this->to = trim($to);
51
52
        return $this;
53
    }
54 3
55
    /**
56 3
     * Get message content.
57
     *
58
     * @return string
59
     */
60
    public function getContent()
61
    {
62
        return $this->content;
63
    }
64
65
    /**
66
     * Get sender info.
67
     *
68
     * @return string
69
     */
70
    public function getSender()
71
    {
72
        return $this->from ?? config('services.africastalking.from');
73
    }
74
75
    /**
76
     * Get recipient info.
77
     *
78
     * @return string
79
     */
80
    public function getTo()
81
    {
82
        return $this->to ?? null;
83
    }
84
}
85