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 ( 4c36ba...7392fc )
by Gregorio
01:32
created

TwilioSmsMessage::provideFeedback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
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 $applicationSid = null;
16
17
    /**
18
     * @var null|float
19
     */
20
    public $maxPrice = null;
21
22
    /**
23
     * @var null|boolean
24
     */
25
    public $provideFeedback = null;
26
27
    /**
28
     * @var null|integer
29
     */
30
    public $validityPeriod = null;
31
32
    /**
33
     * Get the from address of this message.
34
     *
35
     * @return null|string
36
     */
37
    public function getFrom()
38
    {
39
        if ($this->from) {
40
            return $this->from;
41
        }
42
43
        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...
44
            return $this->alphaNumSender;
45
        }
46
    }
47
48
    /**
49
     * Set the alphanumeric sender.
50
     *
51
     * @param string $sender
52
     * @return $this
53
     */
54
    public function sender($sender)
55
    {
56
        $this->alphaNumSender = $sender;
57
58
        return $this;
59
    }
60
61
    /**
62
     * Set application SID for the message status callback.
63
     *
64
     * @param string $applicationSid
65
     * @return $this
66
     */
67
    public function applicationSid($applicationSid)
68
    {
69
        $this->applicationSid = $applicationSid;
70
71
        return $this;
72
    }
73
74
    /**
75
     * Set the max price (in USD dollars).
76
     *
77
     * @param float $maxPrice
78
     * @return $this
79
     */
80
    public function maxPrice($maxPrice)
81
    {
82
        $this->maxPrice = $maxPrice;
83
84
        return $this;
85
    }
86
87
    /**
88
     * Set the provide feedback option.
89
     *
90
     * @param boolean $provideFeedback
91
     * @return $this
92
     */
93
    public function provideFeedback($provideFeedback)
94
    {
95
        $this->provideFeedback = $provideFeedback;
96
97
        return $this;
98
    }
99
100
    /**
101
     * Set the validity period (in seconds).
102
     *
103
     * @param integer $validityPeriod
104
     * @return $this
105
     */
106
    public function validityPeriod($validityPeriod)
107
    {
108
        $this->validityPeriod = $validityPeriod;
109
110
        return $this;
111
    }
112
}
113