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 ( 581fb3...6164d7 )
by Gregorio
01:53
created

TwilioSmsMessage::sender()   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 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 1
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
     * Get the from address of this message.
14
     *
15
     * @return null|string
16
     */
17
    public function getFrom()
18
    {
19
        if ($this->from) {
20
            return $this->from;
21
        }
22
23
        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...
24
            return $this->alphaNumSender;
25
        }
26
    }
27
28
    /**
29
     * Set the alphanumeric sender.
30
     *
31
     * @param $sender
32
     * @return $this
33
     */
34
    public function sender($sender)
35
    {
36
        $this->alphaNumSender = $sender;
37
38
        return $this;
39
    }
40
}
41