GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 085ac4...03fbf9 )
by Atymic
20:31 queued 19:10
created

TwilioSmsMessage::forceDelivery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace NotificationChannels\Twilio;
4
5
class TwilioSmsMessage extends TwilioMessage
6
{
7
    /**
8
     * @var null|string
9
     */
10
    public $alphaNumSender = null;
11
12
    /**
13
     * @var null|string
14
     */
15
    public $messagingServiceSid = null;
16
17
    /**
18
     * @var null|string
19
     */
20
    public $applicationSid = null;
21
22
    /**
23
     * @var null|bool
24
     */
25
    public $forceDelivery = null;
26
27
    /**
28
     * @var null|float
29
     */
30
    public $maxPrice = null;
31
32
    /**
33
     * @var null|bool
34
     */
35
    public $provideFeedback = null;
36
37
    /**
38
     * @var null|int
39
     */
40
    public $validityPeriod = null;
41
42
    /**
43
     * Get the from address of this message.
44
     *
45
     * @return null|string
46
     */
47 12
    public function getFrom()
48
    {
49 12
        if ($this->from) {
50 4
            return $this->from;
51
        }
52
53 8
        if ($this->alphaNumSender && strlen($this->alphaNumSender) > 0) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->alphaNumSender of type null|string is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
54 2
            return $this->alphaNumSender;
55
        }
56 6
    }
57
58
    /**
59
     * Set the messaging service SID.
60
     *
61
     * @param  string $messagingServiceSid
62
     * @return $this
63
     */
64
    public function messagingServiceSid($messagingServiceSid)
65
    {
66
        $this->messagingServiceSid = $messagingServiceSid;
67
68
        return $this;
69
    }
70
71
    /**
72
     * Get the messaging service SID of this message.
73
     *
74
     * @return null|string
75
     */
76 8
    public function getMessagingServiceSid()
77
    {
78 8
        return $this->messagingServiceSid;
79
    }
80
81
    /**
82
     * Set the alphanumeric sender.
83
     *
84
     * @param string $sender
85
     * @return $this
86
     */
87 4
    public function sender($sender)
88
    {
89 4
        $this->alphaNumSender = $sender;
90
91 4
        return $this;
92
    }
93
94
    /**
95
     * Set application SID for the message status callback.
96
     *
97
     * @param string $applicationSid
98
     * @return $this
99
     */
100 4
    public function applicationSid($applicationSid)
101
    {
102 4
        $this->applicationSid = $applicationSid;
103
104 4
        return $this;
105
    }
106
107
    /**
108
     * Set force delivery (Deliver message without validation).
109
     *
110
     * @param bool $forceDelivery
111
     * @return $this
112
     */
113 1
    public function forceDelivery($forceDelivery)
114
    {
115 1
        $this->forceDelivery = $forceDelivery;
116
117 1
        return $this;
118
    }
119
120
    /**
121
     * Set the max price (in USD dollars).
122
     *
123
     * @param float $maxPrice
124
     * @return $this
125
     */
126 4
    public function maxPrice($maxPrice)
127
    {
128 4
        $this->maxPrice = $maxPrice;
129
130 4
        return $this;
131
    }
132
133
    /**
134
     * Set the provide feedback option.
135
     *
136
     * @param bool $provideFeedback
137
     * @return $this
138
     */
139 4
    public function provideFeedback($provideFeedback)
140
    {
141 4
        $this->provideFeedback = $provideFeedback;
142
143 4
        return $this;
144
    }
145
146
    /**
147
     * Set the validity period (in seconds).
148
     *
149
     * @param int $validityPeriod
150
     * @return $this
151
     */
152 4
    public function validityPeriod($validityPeriod)
153
    {
154 4
        $this->validityPeriod = $validityPeriod;
155
156 4
        return $this;
157
    }
158
}
159