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 ( a14aa2...098aef )
by Peter
07:47
created

MessagebirdMessage::toJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace NotificationChannels\Messagebird;
4
5
class MessagebirdMessage
6
{
7
    public $body;
8
    public $originator;
9
    public $recipients;
10
11 1
    public static function create($body = '')
12
    {
13 1
        return new static($body);
14
    }
15
16 11
    public function __construct($body = '')
17
    {
18 11
        if (! empty($body)) {
19 5
            $this->body = trim($body);
20 5
        }
21 11
    }
22
23 1
    public function setBody($body)
24
    {
25 1
        $this->body = trim($body);
26
27 1
        return $this;
28
    }
29
30 4
    public function setOriginator($originator)
31
    {
32 4
        $this->originator = $originator;
33
34 4
        return $this;
35
    }
36
37 6
    public function setRecipients($recipients)
38
    {
39 6
        if (is_array($recipients)) {
40 1
            $recipients = implode(',', $recipients);
41 1
        }
42
43 6
        $this->recipients = $recipients;
44
45 6
        return $this;
46
    }
47
48 1
    public function toJson()
49
    {
50 1
        return json_encode($this);
51
    }
52
}
53