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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 36
ccs 0
cts 14
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFrom() 0 10 4
A sender() 0 6 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
     * 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