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

Element::getImageUrl()   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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Attachment\Template\Receipt;
4
5
use Tgallice\FBMessenger\Model\Attachment\Template\AbstractElement;
6
7
class Element extends AbstractElement
8
{
9
    /**
10
     * @var null|string
11
     */
12
    private $currency;
13
14
    /**
15
     * @var int
16
     */
17
    private $price;
18
19
    /**
20
     * @var int|null
21
     */
22
    private $quantity;
23
24
    /**
25
     * @param string $title
26
     * @param null $price
27
     * @param null|string $subtitle
28
     * @param null|int $quantity
29
     * @param null|string $currency
30
     * @param null|string $imageUrl
31
     */
32 8
    public function __construct(
33
        $title,
34
        $price = 0,
35
        $subtitle = null,
36
        $quantity = null,
37
        $currency = null,
38
        $imageUrl = null
39
    ) {
40
41 8
        parent::__construct($title, $subtitle, $imageUrl);
42 8
        $this->currency = $currency;
43 8
        $this->price = $price;
44 8
        $this->quantity = $quantity;
45 8
    }
46
47
    /**
48
     * @return int|null
49
     */
50 1
    public function getQuantity()
51
    {
52 1
        return $this->quantity;
53
    }
54
55
    /**
56
     * @return int|null
57
     */
58 1
    public function getPrice()
59
    {
60 1
        return $this->price;
61
    }
62
63
    /**
64
     * @return null|string
65
     */
66 1
    public function getCurrency()
67
    {
68 1
        return $this->currency;
69
    }
70
71
    /**
72
     * @return array
73
     */
74 1
    public function jsonSerialize()
75
    {
76
        return [
77 1
            'title' => $this->getTitle(),
78 1
            'subtitle' => $this->getSubtitle(),
79 1
            'quantity' => $this->quantity,
80 1
            'price' => $this->price,
81 1
            'currency' => $this->currency,
82 1
            'image_url' => $this->getImageUrl(),
83 1
        ];
84
    }
85
}
86