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
Push — master ( da90f7...c29a3b )
by Gallice
35s
created

Receipt   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 141
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 15
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 141
ccs 46
cts 46
cp 1
rs 10

15 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getAddress() 0 4 1
A getAdjustments() 0 4 1
A getElements() 0 4 1
A getCurrency() 0 4 1
A getOrderNumber() 0 4 1
A getOrderUrl() 0 4 1
A getPaymentMethod() 0 4 1
A getRecipientName() 0 4 1
A getSummary() 0 4 1
A getTimestamp() 0 4 1
A setAddress() 0 4 1
A setAdjustments() 0 4 1
A setOrderUrl() 0 4 1
A setTimestamp() 0 4 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Attachment\Structured;
4
5
use Tgallice\FBMessenger\Attachment\Structured;
6
use Tgallice\FBMessenger\Model\Address;
7
use Tgallice\FBMessenger\Model\Adjustment;
8
use Tgallice\FBMessenger\Model\Receipt\Element;
9
use Tgallice\FBMessenger\Model\Summary;
10
11
class Receipt extends Structured
12
{
13
    const TEMPLATE_TYPE = 'receipt';
14
15
    /**
16
     * @param string $recipientName
17
     * @param string $orderNumber
18
     * @param string $currency
19
     * @param string $paymentMethod
20
     * @param Element[] $elements
21
     * @param Summary $summary
22
     */
23 19
    public function __construct($recipientName, $orderNumber, $currency, $paymentMethod, array $elements, Summary $summary)
24
    {
25 19
        $this->payload = [
26 19
            'template_type' => self::TEMPLATE_TYPE,
27 19
            'recipient_name' => $recipientName,
28 19
            'order_number' => $orderNumber,
29 19
            'currency' => $currency,
30 19
            'payment_method' => $paymentMethod,
31 19
            'timestamp' => null,
32 19
            'order_url' => null,
33 19
            'elements' => $elements,
34 19
            'address' => null,
35 19
            'summary' => $summary,
36 19
            'adjustments' => [],
37
        ];
38 19
    }
39
40
    /**
41
     * @return null|Address
42
     */
43 2
    public function getAddress()
44
    {
45 2
        return $this->payload['address'];
46
    }
47
48
    /**
49
     * @return Adjustment[]
50
     */
51 2
    public function getAdjustments()
52
    {
53 2
        return $this->payload['adjustments'];
54
    }
55
56
    /**
57
     * @return Element[]
58
     */
59 1
    public function getElements()
60
    {
61 1
        return $this->payload['elements'];
62
    }
63
64
    /**
65
     * @return string
66
     */
67 1
    public function getCurrency()
68
    {
69 1
        return $this->payload['currency'];
70
    }
71
72
    /**
73
     * @return string
74
     */
75 1
    public function getOrderNumber()
76
    {
77 1
        return $this->payload['order_number'];
78
    }
79
80
    /**
81
     * @return null|string
82
     */
83 2
    public function getOrderUrl()
84
    {
85 2
        return $this->payload['order_url'];
86
    }
87
88
    /**
89
     * @return string
90
     */
91 1
    public function getPaymentMethod()
92
    {
93 1
        return $this->payload['payment_method'];
94
    }
95
96
    /**
97
     * @return string
98
     */
99 1
    public function getRecipientName()
100
    {
101 1
        return $this->payload['recipient_name'];
102
    }
103
104
    /**
105
     * @return Summary
106
     */
107 1
    public function getSummary()
108
    {
109 1
        return $this->payload['summary'];
110
    }
111
112
    /**
113
     * @return null|string
114
     */
115 2
    public function getTimestamp()
116
    {
117 2
        return $this->payload['timestamp'];
118
    }
119
120
    /**
121
     * @param Address $address
122
     */
123 2
    public function setAddress(Address $address)
124
    {
125 2
        $this->payload['address'] = $address;
126 2
    }
127
128
    /**
129
     * @param Adjustment[] $adjustments
130
     */
131 2
    public function setAdjustments(array $adjustments)
132
    {
133 2
        $this->payload['adjustments'] = $adjustments;
134 2
    }
135
136
    /**
137
     * @param string $orderUrl
138
     */
139 2
    public function setOrderUrl($orderUrl)
140
    {
141 2
        $this->payload['order_url'] = $orderUrl;
142 2
    }
143
144
    /**
145
     * @param string $timestamp
146
     */
147 2
    public function setTimestamp($timestamp)
148
    {
149 2
        $this->payload['timestamp'] = $timestamp;
150 2
    }
151
}
152