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 ( 969a81...5f333b )
by Talv
03:02
created

MsTeamsMessage::type()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\MsTeams;
4
5
class MsTeamsMessage
6
{
7
    private $payload = [];
8
9 2
    public function __construct($content = '')
10
    {
11 2
        $this->content($content);
12 2
    }
13
14 2
    public static function create($content = ''): self
15
    {
16 2
        return new static($content);
17
    }
18
19 1
    public function to($url): self
20
    {
21 1
        $this->payload['url'] = $url;
22
23 1
        return $this;
24
    }
25
26 2
    public function toUnknown() :bool
27
    {
28 2
        return empty($this->payload['url']);
29
    }
30
31 2
    public function title($title) : self
32
    {
33 2
        $this->payload['title'] = $title;
34
35 2
        return $this;
36
    }
37
38 2
    public function content($content) : self
39
    {
40 2
        $this->payload['text'] = $content;
41
42 2
        return $this;
43
    }
44
45
    public function code($content) : self
46
    {
47
        $this->payload['code'][] = $content;
48
49
        return $this;
50
    }
51
52
    public function type($type) : self
53
    {
54
        $this->payload['type'] = $type;
55
56
        return $this;
57
    }
58
59
    public function button($text, $url): self
60
    {
61
        $this->payload['buttons'][] = compact('text', 'url');
62
63
        return $this;
64
    }
65
66
    public function image($image): self
67
    {
68
        $this->payload['images'][] = $image;
69
70
        return $this;
71
    }
72
73 1
    public function toArray()
74
    {
75 1
        return $this->payload;
76
    }
77
}
78