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 ( cda627...6f7b29 )
by
unknown
85:30 queued 78:40
created

TwitterDirectMessage::getRequestBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace NotificationChannels\Twitter;
4
5
class TwitterDirectMessage
6
{
7
    /** @var string */
8
    private $content;
9
10
    /**
11
     * @var  string
12
     */
13
    private $to;
14
15
    /**
16
     * @var  string
17
     */
18
    private $apiEndpoint = 'direct_messages/new';
19
20
    /*
21
     * @param  string $content
22
     */
23 5
    public function __construct($to, $content)
24
    {
25 5
        $this->to = $to;
26 5
        $this->content = $content;
27 5
    }
28
29
    /**
30
     * Get Twitter direct messsage content.
31
     *
32
     * @return  string
33
     */
34 3
    public function getContent()
35
    {
36 3
        return $this->content;
37
    }
38
39
    /**
40
     * Get Twitter direct message receiver.
41
     *
42
     * @return  string
43
     */
44 3
    public function getReceiver()
45
    {
46 3
        return $this->to;
47
    }
48
49
    /**
50
     * Return Twitter direct message api endpoint.
51
     * @return  string
52
     */
53 1
    public function getApiEndpoint()
54
    {
55 1
        return $this->apiEndpoint;
56
    }
57
58
    /**
59
     * Build Twitter request body.
60
     * @return  array
61
     */
62 1
    public function getRequestBody()
63
    {
64
        $body = [
65 1
            'screen_name' => $this->getReceiver(),
66 1
            'text'        => $this->getContent(),
67
        ];
68
69 1
        return $body;
70
    }
71
}
72