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.

Button::getButtons()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Attachment\Template;
4
5
use Tgallice\FBMessenger\Model\Attachment\Template;
6
use Tgallice\FBMessenger\Model\Button as ButtonModel;
7
8
class Button extends Template
9
{
10
    /**
11
     * @var null|string
12
     */
13
    private $text;
14
15
    /**
16
     * @var ButtonModel[]
17
     */
18
    private $buttons;
19
20
    /**
21
     * @param null|string $text
22
     * @param ButtonModel[] $buttons
23
     */
24 6
    public function __construct($text, array $buttons)
25
    {
26 6
        $this->text = $text;
27 6
        $this->buttons = $buttons;
28 6
    }
29
30
    /**
31
     * @return null|string
32
     */
33 1
    public function getText()
34
    {
35 1
        return $this->text;
36
    }
37
38
    /**
39
     * @return array
40
     */
41 1
    public function getButtons()
42
    {
43 1
        return $this->buttons;
44
    }
45
46
    /**
47
     * @return string
48
     */
49 2
    public function getType()
50
    {
51 2
        return Template::TYPE_BUTTON;
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57 1
    public function jsonSerialize()
58
    {
59
        return [
60 1
            'template_type' => $this->getType(),
61 1
            'text' => $this->text,
62 1
            'buttons' => $this->buttons,
63 1
        ];
64
    }
65
}
66