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

AbstractElement::getSubtitle()   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 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
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\Attachment\Template;
4
5
abstract class AbstractElement implements \JsonSerializable
6
{
7
    /**
8
     * @var string
9
     */
10
    private $title;
11
    
12
    /**
13
     * @var null|string
14
     */
15
    private $subtitle;
16
17
    /**
18
     * @var null|string
19
     */
20
    private $imageUrl;
21
22
    /**
23
     * @param string $title
24
     * @param null|string $subtitle
25
     * @param null|string $imageUrl
26
     */
27 25
    public function __construct($title, $subtitle = null, $imageUrl = null)
28
    {
29 25
        if (mb_strlen($title) > 80) {
30 2
            throw new \InvalidArgumentException('In a element, the "title" field should not exceed 80 characters.');
31
        }
32
33 23
        if (!empty($subtitle) && mb_strlen($subtitle) > 80) {
34 2
            throw new \InvalidArgumentException('In a element, the "subtitle" field should not exceed 80 characters.');
35
        }
36
        
37 21
        $this->title = $title;
38 21
        $this->subtitle = $subtitle;
39 21
        $this->imageUrl = $imageUrl;
40 21
    }
41
    
42
    /**
43
     * @return null|string
44
     */
45 6
    public function getImageUrl()
46
    {
47 6
        return $this->imageUrl;
48
    }
49
50
    /**
51
     * @return null|string
52
     */
53 4
    public function getSubtitle()
54
    {
55 4
        return $this->subtitle;
56
    }
57
58
    /**
59
     * @return string
60
     */
61 6
    public function getTitle()
62
    {
63 6
        return $this->title;
64
    }
65
66
    /**
67
     * @deprecated use the constructor argument instead
68
     * @param null|string $imageUrl
69
     */
70
    public function setImageUrl($imageUrl)
71
    {
72
        $this->imageUrl = $imageUrl;
73
    }
74
75
76
    /**
77
     * @deprecated use the constructor argument instead
78
     * @param null|string $subtitle
79
     */
80
    public function setSubtitle($subtitle)
81
    {
82
        if (!empty($subtitle) && mb_strlen($subtitle) > 80) {
83
            throw new \InvalidArgumentException('In a element, the "subtitle" field should not exceed 80 characters.');
84
        }
85
86
        $this->subtitle = $subtitle;
87
    }
88
}
89