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.
Passed
Push — master ( 71cb78...a4ef4f )
by Atymic
10:56
created

DiscordMessage   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 14
c 2
b 1
f 0
dl 0
loc 85
ccs 15
cts 15
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A embed() 0 5 1
A __construct() 0 5 1
A create() 0 3 1
A components() 0 5 1
A body() 0 5 1
1
<?php
2
3
namespace NotificationChannels\Discord;
4
5
class DiscordMessage
6
{
7
    /**
8
     * The text content of the message.
9
     *
10
     * @var string
11
     */
12
    public $body;
13
14
    /**
15
     * The embedded object attached to the message.
16
     *
17
     * @var array
18
     */
19
    public $embed;
20
21
    /**
22
     * The component objects attached to the message.
23
     *
24
     * @var array
25
     */
26
    public $components;
27
28
    /**
29
     * @param string     $body
30
     * @param array|null $embed
31
     *
32
     * @return static
33
     */
34 1
    public static function create($body = '', $embed = [], $components = [])
35
    {
36 1
        return new static($body, $embed, $components);
37
    }
38
39
    /**
40
     * @param string $body
41
     * @param array  $embed
42
     */
43 4
    public function __construct($body = '', $embed = [], $components = [])
44
    {
45 4
        $this->body = $body;
46 4
        $this->embed = $embed;
47 4
        $this->components = $components;
48
    }
49
50
    /**
51
     * Set the text content of the message.
52
     *
53
     * @param string $body
54
     *
55
     * @return $this
56
     */
57 2
    public function body($body)
58
    {
59 2
        $this->body = $body;
60
61 2
        return $this;
62
    }
63
64
    /**
65
     * Set the embedded object.
66
     *
67
     * @param $embed
68
     *
69
     * @return $this
70
     */
71 1
    public function embed($embed)
72
    {
73 1
        $this->embed = $embed;
74
75 1
        return $this;
76
    }
77
78
    /**
79
     * Set the components object.
80
     *
81
     * @param $components
82
     *
83
     * @return $this
84
     */
85 1
    public function components($components)
86
    {
87 1
        $this->components = $components;
88
89 1
        return $this;
90
    }
91
}
92