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::__construct()   B

Complexity

Conditions 5
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 5.3906

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
ccs 6
cts 8
cp 0.75
rs 8.8571
cc 5
eloc 7
nc 3
nop 2
crap 5.3906
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