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 ( da90f7...c29a3b )
by Gallice
35s
created

Button   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 33
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getText() 0 4 1
A getButtons() 0 4 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Attachment\Structured;
4
5
use Tgallice\FBMessenger\Attachment\Structured;
6
use Tgallice\FBMessenger\Model\Button as ButtonModel;
7
8
class Button extends Structured
9
{
10
    const TEMPLATE_TYPE = 'button';
11
12
    /**
13
     * @param null|string $text
14
     * @param ButtonModel[] $buttons
15
     */
16 7
    public function __construct($text = null, array $buttons = [])
17
    {
18 7
        $this->payload = [
19 7
            'template_type' => self::TEMPLATE_TYPE,
20 7
            'text' => $text,
21 7
            'buttons' => $buttons,
22
        ];
23 7
    }
24
25
    /**
26
     * @return null|string
27
     */
28 1
    public function getText()
29
    {
30 1
        return $this->payload['text'];
31
    }
32
33
    /**
34
     * @return array
35
     */
36 1
    public function getButtons()
37
    {
38 1
        return $this->payload['buttons'];
39
    }
40
}
41