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.

Text   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 90.91%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 76
ccs 20
cts 22
cp 0.9091
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getTitle() 0 4 1
A getPayload() 0 4 1
A getImageUrl() 0 4 1
A jsonSerialize() 0 12 2
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\QuickReply;
4
5
use Tgallice\FBMessenger\Model\QuickReply;
6
7
class Text extends QuickReply
8
{
9
    /**
10
     * @var string
11
     */
12
    private $title;
13
14
    /**
15
     * Payload
16
     *
17
     * @var string
18
     */
19
    private $payload;
20
    
21
    /**
22
     * @var string
23
     */
24
    private $image_url;
25
    
26
    /**
27
     * @param string $title
28
     * @param string $payload
29
     */
30 9
    public function __construct($title, $payload, $image_url = null)
31
    {
32 9
        parent::__construct(QuickReply::TYPE_TEXT);
33
    
34 9
        self::validateTitleSize($title);
35 8
        $this->title = $title;
36
    
37 8
        QuickReply::validatePayload($payload);
38 7
        $this->payload = $payload;
39
        
40 7
        $this->image_url = $image_url;
41 7
    }
42
    
43
    /**
44
     * @return string
45
     */
46 1
    public function getTitle()
47
    {
48 1
        return $this->title;
49
    }
50
    
51
    /**
52
     * @return string
53
     */
54 1
    public function getPayload()
55
    {
56 1
        return $this->payload;
57
    }
58
    
59
    /**
60
     * @return string
61
     */
62
    public function getImageUrl()
63
    {
64
        return $this->image_url;
65
    }
66
    
67
    /**
68
     * @inheritdoc
69
     */
70 2
    public function jsonSerialize()
71
    {
72 2
        $json = parent::jsonSerialize();
73 2
        $json['title'] = $this->title;
74 2
        $json['payload'] = $this->payload;
75
    
76 2
        if(!empty($this->image_url)) {
77 1
            $json['image_url'] = $this->image_url;
78 1
        }
79
        
80 2
        return $json;
81
    }
82
}
83