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
Pull Request — master (#9)
by Gallice
03:41 queued 55s
created

QuickReply   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 89.47%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 9
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 70
ccs 17
cts 19
cp 0.8947
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 12 5
A getContentType() 0 4 1
A getTitle() 0 4 1
A getPayload() 0 4 1
A jsonSerialize() 0 8 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model;
4
5
class QuickReply implements \JsonSerializable
6
{
7
    /**
8
     * @var string
9
     */
10
    private $title;
11
12
    /**
13
     * @var string
14
     */
15
    private $payload;
16
17
    /**
18
     * @var string
19
     */
20
    private $contentType = 'text';
21
22
    /**
23
     * @param string $title
24
     * @param string $payload
25
     */
26 5
    public function __construct($title, $payload)
27
    {
28 5
        if (empty($title) || mb_strlen($title) > 20) {
29
            throw new \InvalidArgumentException('$title should not exceed 20 characters.');
30
        }
31 5
        if (empty($payload) || mb_strlen($payload) > 1000) {
32
            throw new \InvalidArgumentException('$payload should not exceed 1000 characters.');
33
        }
34
35 5
        $this->title = $title;
36 5
        $this->payload = $payload;
37 5
    }
38
39
    /**
40
     * @return string
41
     */
42 1
    public function getContentType()
43
    {
44 1
        return $this->contentType;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 1
    public function getTitle()
51
    {
52 1
        return $this->title;
53
    }
54
55
    /**
56
     * @return string
57
     */
58 1
    public function getPayload()
59
    {
60 1
        return $this->payload;
61
    }
62
63
    /**
64
     * @inheritdoc
65
     */
66 1
    public function jsonSerialize()
67
    {
68
        return [
69 1
            'title' => $this->title,
70 1
            'payload' => $this->payload,
71 1
            'content_type' => $this->contentType,
72 1
        ];
73
    }
74
}
75