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

Attachment::getPayload()   A

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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_AUDIO = 'audio';
10
    const TYPE_FILE = 'file';
11
    const TYPE_IMAGE = 'image';
12
    const TYPE_VIDEO = 'video';
13
14
    const TYPE_TEMPLATE = 'template';
15
16
    /**
17
     * @var string
18
     */
19
    private $type;
20
21
    /**
22
     * @var array|Template
23
     */
24
    private $payload;
25
26
    /**
27
     * Attachment constructor.
28
     *
29
     * @param $type
30
     * @param array|Template $payload
31
     */
32 23
    public function __construct($type, $payload = [])
33
    {
34 23
        $this->type = $type;
35 23
        $this->payload = $payload;
36 23
    }
37
38
    /**
39
     * @return string
40
     */
41 6
    public function getType()
42
    {
43 6
        return $this->type;
44
    }
45
46
    /**
47
     * @return array|Template
48
     */
49 3
    public function getPayload()
50
    {
51 3
        return $this->payload;
52
    }
53
54
    /**
55
     * @return array
56
     */
57 1
    public function jsonSerialize()
58
    {
59
        return [
60 1
            'type' => $this->type,
61 1
            'payload' => $this->payload,
62 1
        ];
63
    }
64
}
65