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 ( efdcd2...9e411c )
by Peter
12:33
created

MessagebirdMessage::setRecipients()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace NotificationChannels\Messagebird;
4
5
class MessagebirdMessage
6
{
7
    public $body;
8
    public $originator;
9
    public $recipients;
10
    public $reference;
11
12
    public static function create($body = '')
13
    {
14
        return new static($body);
15
    }
16
17
    public function __construct($body = '')
18
    {
19
        if (! empty($body)) {
20
            $this->body = trim($body);
21
        }
22
    }
23
24
    public function setBody($body)
25
    {
26
        $this->body = trim($body);
27
28
        return $this;
29
    }
30
31
    public function setOriginator($originator)
32
    {
33
        $this->originator = $originator;
34
35
        return $this;
36
    }
37
38
    public function setRecipients($recipients)
39
    {
40
        if (is_array($recipients)) {
41
            $recipients = implode(',', $recipients);
42
        }
43
44
        $this->recipients = $recipients;
45
46
        return $this;
47
    }
48
49
    public function setReference($reference)
50
    {
51
        $this->reference = $reference;
52
53
        return $this;
54
    }
55
56
    public function setDatacoding($datacoding)
57
    {
58
        $this->datacoding = $datacoding;
0 ignored issues
show
Bug introduced by
The property datacoding does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
59
60
        return $this;
61
    }
62
63
    public function toJson()
64
    {
65
        return json_encode($this);
66
    }
67
}
68