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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
A getPayload() 0 4 1
A jsonSerialize() 0 7 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