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
Pull Request — master (#13)
by
unknown
07:29
created

MessagebirdMessage   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 0
dl 0
loc 56
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A __construct() 0 6 2
A setBody() 0 6 1
A setOriginator() 0 6 1
A setRecipients() 0 10 2
A setReference() 0 6 1
A toJson() 0 4 1
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 2
    public static function create($body = '')
13
    {
14 2
        return new static($body);
15
    }
16
17 12
    public function __construct($body = '')
18
    {
19 12
        if (!empty($body)) {
20 6
            $this->body = trim($body);
21 6
        }
22 12
    }
23
24 1
    public function setBody($body)
25
    {
26 1
        $this->body = trim($body);
27
28 1
        return $this;
29
    }
30
31 4
    public function setOriginator($originator)
32
    {
33 4
        $this->originator = $originator;
34
35 4
        return $this;
36
    }
37
38 7
    public function setRecipients($recipients)
39
    {
40 7
        if (is_array($recipients)) {
41 1
            $recipients = implode(',', $recipients);
42 1
        }
43
44 7
        $this->recipients = $recipients;
45
46 7
        return $this;
47
    }
48
49 2
    public function setReference($reference)
50
    {
51 2
        $this->reference = $reference;
52
53 2
        return $this;
54
    }
55
56 1
    public function toJson()
57
    {
58 1
        return json_encode($this);
59
    }
60
}
61