1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright © Wirecard Brasil. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* @author Bruno Elisei <[email protected]> |
6
|
|
|
* See COPYING.txt for license details. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Moip\Magento2\Gateway\Data\Order; |
10
|
|
|
|
11
|
|
|
use Magento\Payment\Gateway\Data\AddressAdapterInterface; |
|
|
|
|
12
|
|
|
use Magento\Sales\Api\Data\OrderAddressInterface; |
|
|
|
|
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class AddressAdapter - Add necessary information to the address. |
16
|
|
|
*/ |
17
|
|
|
class AddressAdapter implements AddressAdapterInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var OrderAddressInterface |
21
|
|
|
*/ |
22
|
|
|
private $address; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param OrderAddressInterface $address |
26
|
|
|
*/ |
27
|
|
|
public function __construct(OrderAddressInterface $address) |
28
|
|
|
{ |
29
|
|
|
$this->address = $address; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Get region name. |
34
|
|
|
* |
35
|
|
|
* @return string |
36
|
|
|
*/ |
37
|
|
|
public function getRegionCode() |
38
|
|
|
{ |
39
|
|
|
return $this->address->getRegionCode(); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Get country id. |
44
|
|
|
* |
45
|
|
|
* @return string |
46
|
|
|
*/ |
47
|
|
|
public function getCountryId() |
48
|
|
|
{ |
49
|
|
|
return $this->address->getCountryId(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get street line 1. |
54
|
|
|
* |
55
|
|
|
* @return string |
56
|
|
|
*/ |
57
|
|
|
public function getStreetLine1() |
58
|
|
|
{ |
59
|
|
|
$street = $this->address->getStreet(); |
60
|
|
|
|
61
|
|
|
return isset($street[0]) ? $street[0] : ''; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Get street line 2. |
66
|
|
|
* |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
|
|
public function getStreetLine2() |
70
|
|
|
{ |
71
|
|
|
$street = $this->address->getStreet(); |
72
|
|
|
|
73
|
|
|
return isset($street[1]) ? $street[1] : ''; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Get street line 3. |
78
|
|
|
* |
79
|
|
|
* @return string |
80
|
|
|
*/ |
81
|
|
|
public function getStreetLine3() |
82
|
|
|
{ |
83
|
|
|
$street = $this->address->getStreet(); |
84
|
|
|
|
85
|
|
|
return isset($street[2]) ? $street[2] : ''; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Get street line 4. |
90
|
|
|
* |
91
|
|
|
* @return string |
92
|
|
|
*/ |
93
|
|
|
public function getStreetLine4() |
94
|
|
|
{ |
95
|
|
|
$street = $this->address->getStreet(); |
96
|
|
|
|
97
|
|
|
return isset($street[3]) ? $street[3] : ''; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Get telephone number. |
102
|
|
|
* |
103
|
|
|
* @return string |
104
|
|
|
*/ |
105
|
|
|
public function getTelephone() |
106
|
|
|
{ |
107
|
|
|
return $this->address->getTelephone(); |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Get postcode. |
112
|
|
|
* |
113
|
|
|
* @return string |
114
|
|
|
*/ |
115
|
|
|
public function getPostcode() |
116
|
|
|
{ |
117
|
|
|
return $this->address->getPostcode(); |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* Get city name. |
122
|
|
|
* |
123
|
|
|
* @return string |
124
|
|
|
*/ |
125
|
|
|
public function getCity() |
126
|
|
|
{ |
127
|
|
|
return $this->address->getCity(); |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* Get first name. |
132
|
|
|
* |
133
|
|
|
* @return string |
134
|
|
|
*/ |
135
|
|
|
public function getFirstname() |
136
|
|
|
{ |
137
|
|
|
return $this->address->getFirstname(); |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* Get last name. |
142
|
|
|
* |
143
|
|
|
* @return string |
144
|
|
|
*/ |
145
|
|
|
public function getLastname() |
146
|
|
|
{ |
147
|
|
|
return $this->address->getLastname(); |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Get middle name. |
152
|
|
|
* |
153
|
|
|
* @return string|null |
154
|
|
|
*/ |
155
|
|
|
public function getMiddlename() |
156
|
|
|
{ |
157
|
|
|
return $this->address->getMiddlename(); |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Get customer id. |
162
|
|
|
* |
163
|
|
|
* @return int|null |
164
|
|
|
*/ |
165
|
|
|
public function getCustomerId() |
166
|
|
|
{ |
167
|
|
|
return $this->address->getCustomerId(); |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Get billing/shipping email. |
172
|
|
|
* |
173
|
|
|
* @return string |
174
|
|
|
*/ |
175
|
|
|
public function getEmail() |
176
|
|
|
{ |
177
|
|
|
return $this->address->getEmail(); |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* Returns name prefix. |
182
|
|
|
* |
183
|
|
|
* @return string |
184
|
|
|
*/ |
185
|
|
|
public function getPrefix() |
186
|
|
|
{ |
187
|
|
|
return $this->address->getPrefix(); |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* Returns name suffix. |
192
|
|
|
* |
193
|
|
|
* @return string |
194
|
|
|
*/ |
195
|
|
|
public function getSuffix() |
196
|
|
|
{ |
197
|
|
|
return $this->address->getSuffix(); |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Get company. |
202
|
|
|
* |
203
|
|
|
* @return string |
204
|
|
|
*/ |
205
|
|
|
public function getCompany() |
206
|
|
|
{ |
207
|
|
|
return $this->address->getCompany(); |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* Get Vat Id. |
212
|
|
|
* |
213
|
|
|
* @return string |
214
|
|
|
*/ |
215
|
|
|
public function getVatId() |
216
|
|
|
{ |
217
|
|
|
return $this->address->getVatId(); |
218
|
|
|
} |
219
|
|
|
} |
220
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths