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
02:33
created

Element   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 120
ccs 28
cts 28
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getImageUrl() 0 4 1
A getSubtitle() 0 4 1
A getTitle() 0 4 1
A getQuantity() 0 4 1
A getPrice() 0 4 1
A getCurrency() 0 4 1
A jsonSerialize() 0 11 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Attachment\Template\Receipt;
4
5
class Element implements \JsonSerializable
6
{
7
    /**
8
     * @var null|string
9
     */
10
    private $currency;
11
12
    /**
13
     * @var null|string
14
     */
15
    private $imageUrl;
16
17
    /**
18
     * @var int
19
     */
20
    private $price;
21
22
    /**
23
     * @var int|null
24
     */
25
    private $quantity;
26
27
    /**
28
     * @var null|string
29
     */
30
    private $subtitle;
31
32
    /**
33
     * @var string
34
     */
35
    private $title;
36
37
    /**
38
     * @param string $title
39
     * @param null $price
40
     * @param null|string $subtitle
41
     * @param null|int $quantity
42
     * @param null|string $currency
43
     * @param null|string $imageUrl
44
     */
45 8
    public function __construct(
46
        $title,
47
        $price = 0,
48
        $subtitle = null,
49
        $quantity = null,
50
        $currency = null,
51
        $imageUrl = null
52
    ) {
53
54 8
        $this->currency = $currency;
55 8
        $this->imageUrl = $imageUrl;
56 8
        $this->price = $price;
57 8
        $this->quantity = $quantity;
58 8
        $this->subtitle = $subtitle;
59 8
        $this->title = $title;
60 8
    }
61
62
    /**
63
     * @return null|string
64
     */
65 1
    public function getImageUrl()
66
    {
67 1
        return $this->imageUrl;
68
    }
69
70
    /**
71
     * @return null|string
72
     */
73 1
    public function getSubtitle()
74
    {
75 1
        return $this->subtitle;
76
    }
77
78
    /**
79
     * @return string
80
     */
81 1
    public function getTitle()
82
    {
83 1
        return $this->title;
84
    }
85
86
    /**
87
     * @return int|null
88
     */
89 1
    public function getQuantity()
90
    {
91 1
        return $this->quantity;
92
    }
93
94
    /**
95
     * @return int|null
96
     */
97 1
    public function getPrice()
98
    {
99 1
        return $this->price;
100
    }
101
102
    /**
103
     * @return null|string
104
     */
105 1
    public function getCurrency()
106
    {
107 1
        return $this->currency;
108
    }
109
110
    /**
111
     * @return array
112
     */
113 1
    public function jsonSerialize()
114
    {
115
        return [
116 1
            'title' => $this->title,
117 1
            'subtitle' => $this->subtitle,
118 1
            'quantity' => $this->quantity,
119 1
            'price' => $this->price,
120 1
            'currency' => $this->currency,
121 1
            'image_url' => $this->imageUrl,
122 1
        ];
123
    }
124
}
125