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.
Passed
Push — master ( ac5cf0...399d31 )
by Gallice
03:08
created

Element::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 5
crap 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Attachment\Template\ElementList;
4
5
use Tgallice\FBMessenger\Model\Attachment\Template\AbstractElement;
6
use Tgallice\FBMessenger\Model\Button;
7
use Tgallice\FBMessenger\Model\DefaultAction;
8
9
class Element extends AbstractElement
10
{
11
    /**
12
     * @var null|Button
13
     */
14
    private $button;
15
16
    /**
17
     * @var null|DefaultAction
18
     */
19
    private $defaultAction;
20
21
    /**
22
     * @param string $title
23
     * @param null|string $subtitle
24
     * @param null|string $imageUrl
25
     * @param Button|null $button
26
     * @param DefaultAction|null $defaultAction
27
     */
28 8
    public function __construct($title, $subtitle = null, $imageUrl = null, Button $button = null, DefaultAction $defaultAction = null)
29
    {
30 8
        parent::__construct($title, $subtitle, $imageUrl);
31 6
        $this->button = $button;
32 6
        $this->defaultAction = $defaultAction;
33 6
    }
34
35 1
    public function getButton()
36
    {
37 1
        return $this->button;
38
    }
39
40 1
    public function getDefaultAction()
41
    {
42 1
        return $this->defaultAction;
43
    }
44
45
    /**
46
     * @return array
47
     */
48 1 View Code Duplication
    public function jsonSerialize()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
49
    {
50
        return [
51 1
            'title' => $this->getTitle(),
52 1
            'subtitle' => $this->getSubtitle(),
53 1
            'image_url' => $this->getImageUrl(),
54 1
            'buttons' => $this->button ? [$this->button] : null,
55 1
            'default_action' => $this->defaultAction,
56 1
        ];
57
    }
58
}
59