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
created

Attachment::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model;
4
5
use Tgallice\FBMessenger\Model\Attachment\Template;
6
7
class Attachment implements \JsonSerializable
8
{
9
    const TYPE_IMAGE = 'image';
10
    const TYPE_FILE = 'file';
11
12
    const TYPE_TEMPLATE = 'template';
13
14
    /**
15
     * @var string
16
     */
17
    private $type;
18
19
    /**
20
     * @var array|Template
21
     */
22
    private $payload;
23
24 17
    public function __construct($type, $payload = [])
25
    {
26 17
        $this->type = $type;
27 17
        $this->payload = $payload;
28 17
    }
29
30
    /**
31
     * @return string
32
     */
33 4
    public function getType()
34
    {
35 4
        return $this->type;
36
    }
37
38
    /**
39
     * @return array|Template
40
     */
41 3
    public function getPayload()
42
    {
43 3
        return $this->payload;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 1
    public function jsonSerialize()
50
    {
51
        return [
52 1
            'type' => $this->type,
53 1
            'payload' => $this->payload,
54 1
        ];
55
    }
56
}
57