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   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 1 Features 1
Metric Value
wmc 8
c 6
b 1
f 1
lcom 1
cbo 0
dl 0
loc 48
ccs 21
cts 21
cp 1
rs 10

6 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 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
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