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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 67
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getContent() 0 4 1
A getReceiver() 0 4 1
A getApiEndpoint() 0 4 1
A getRequestBody() 0 9 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