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.

FacebookPosterPost::getLink()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\FacebookPoster;
4
5
class FacebookPosterPost
6
{
7
    /**
8
     * The post message.
9
     *
10
     * @var string
11
     */
12
    protected $message;
13
14
    /**
15
     * The post link.
16
     *
17
     * @var string
18
     */
19
    protected $link;
20
21
    /**
22
     * Additional post parameters.
23
     *
24
     * @var array
25
     */
26
    protected array $params = [];
27
28
    /**
29
     * Create a new post instance.
30
     *
31
     * @param  string  $message
32
     * @return void
33
     */
34
    public function __construct($message)
35
    {
36
        $this->message = $message;
37
    }
38
39
    /**
40
     * Set the post message.
41
     */
42
    public function withMessage(?string $message)
43
    {
44
        $this->message = $message;
45
46
        return $this;
47
    }
48
49
    /**
50
     * Get the post message.
51
     */
52
    public function getMessage(): ?string
53 6
    {
54
        return $this->message;
55 6
    }
56 6
57
    /**
58
     * Set ths post link.
59
     */
60
    public function withLink(?string $link)
61
    {
62
        $this->link = $link;
63 6
64
        return $this;
65 6
    }
66
67
    /**
68
     * Get the post link.
69
     */
70
    public function getLink(): ?string
71
    {
72
        return $this->link;
73
    }
74
75 1
    /**
76
     * Set the post params.
77 1
     */
78
    public function withParams(array $params)
79 1
    {
80
        $this->params = $params;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get the post params.
87
     */
88
    public function getParams(): array
89 1
    {
90
        return $this->params;
91 1
    }
92 1
93
    /**
94 1
     * Get the filtered body.
95
     */
96
    public function getBody(): array
97
    {
98
        $body = array_merge([
99
            'message' => $this->message,
100
            'link' => $this->link,
101
        ], $this->params);
102
103
        return array_filter($body);
104
    }
105
}
106