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   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 0
dl 0
loc 73
ccs 18
cts 30
cp 0.6
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A to() 0 6 1
A toUnknown() 0 4 1
A title() 0 6 1
A content() 0 6 1
A code() 0 6 1
A type() 0 6 1
A button() 0 6 1
A image() 0 6 1
A toArray() 0 4 1
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