@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * @return float |
44 | 44 | */ |
45 | - function getAmount():? float; |
|
45 | + function getAmount(): ? float; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @return float|null |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * @return string |
148 | 148 | */ |
149 | - function getValidUntil():? string; |
|
149 | + function getValidUntil(): ? string; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * @param string $timestamp |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | /** |
213 | 213 | * @return null|string |
214 | 214 | */ |
215 | - function getType():? string; |
|
215 | + function getType(): ? string; |
|
216 | 216 | |
217 | - function setInstallments(?string $installments):? self; |
|
218 | - function getInstallments():? string; |
|
217 | + function setInstallments(?string $installments): ? self; |
|
218 | + function getInstallments(): ? string; |
|
219 | 219 | |
220 | 220 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | class InvalidCheckoutException extends \RuntimeException |
8 | 8 | { |
9 | - public function __construct($message = "",CheckoutInterface $checkout, $code = 0, Throwable $previous = null) |
|
9 | + public function __construct($message = "", CheckoutInterface $checkout, $code = 0, Throwable $previous = null) |
|
10 | 10 | { |
11 | 11 | $message = sprintf(<<<MSG |
12 | 12 | %s |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct($object, $property, Throwable $previous = null) |
17 | 17 | { |
18 | - $message = sprintf('Not allowed property %s into %s class!', $property,get_class($object)); |
|
18 | + $message = sprintf('Not allowed property %s into %s class!', $property, get_class($object)); |
|
19 | 19 | parent::__construct($message, 100, $previous); |
20 | 20 | } |
21 | 21 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | 'headers' => $headers |
72 | 72 | ], $body); |
73 | 73 | $successul = $response->getStatusCode() === 201; |
74 | - } catch(\GuzzleHttp\Exception\RequestException $e){ |
|
74 | + } catch (\GuzzleHttp\Exception\RequestException $e) { |
|
75 | 75 | throw new BadRequestException( |
76 | 76 | $e->getMessage(), |
77 | 77 | $e->getRequest(), |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | |
91 | - private function request(string $action, CustomerInterface $customer, AccessToken $accessToken, array $scopes):? CustomerInterface |
|
91 | + private function request(string $action, CustomerInterface $customer, AccessToken $accessToken, array $scopes): ? CustomerInterface |
|
92 | 92 | { |
93 | 93 | $accessToken = AuthenticationHelper::getValidToken( |
94 | 94 | $this->context, |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | $options = AuthenticationHelper::getOAuthHeader($accessToken); |
101 | 101 | $options['form_params'] = self::getCustomerBody($customer); |
102 | 102 | |
103 | - $successCode=200; |
|
103 | + $successCode = 200; |
|
104 | 104 | $uri = self::ENDPOINT . '/' . $customer->getCustomerId(); |
105 | - switch (true){ |
|
106 | - case $action==='create': { |
|
107 | - $action='post'; |
|
108 | - $successCode=201; |
|
105 | + switch (true) { |
|
106 | + case $action === 'create': { |
|
107 | + $action = 'post'; |
|
108 | + $successCode = 201; |
|
109 | 109 | $uri = self::ENDPOINT; |
110 | 110 | break; |
111 | 111 | } |
112 | - case $action==='complete': { |
|
113 | - $action='put'; |
|
112 | + case $action === 'complete': { |
|
113 | + $action = 'put'; |
|
114 | 114 | break; |
115 | 115 | } |
116 | 116 | default:{ |
117 | - $action='get'; |
|
117 | + $action = 'get'; |
|
118 | 118 | break; |
119 | 119 | } |
120 | 120 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | /** @var ResponseInterface $response */ |
123 | 123 | $response = $client->{$action}($uri, $options); |
124 | 124 | $this->lastResponse = $response; |
125 | - if($successCode===$response->getStatusCode()){ |
|
125 | + if ($successCode === $response->getStatusCode()) { |
|
126 | 126 | $wrapper = new Hydrator($response); |
127 | 127 | return $wrapper->hydrate($customer); |
128 | 128 | } |
@@ -139,7 +139,7 @@ |
||
139 | 139 | */ |
140 | 140 | function isValid():bool |
141 | 141 | { |
142 | - return $this->getCustomerId()!==null; |
|
142 | + return $this->getCustomerId() !== null; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | /** |
223 | 223 | * @return mixed |
224 | 224 | */ |
225 | - public function getCountryEnName():? string |
|
225 | + public function getCountryEnName(): ? string |
|
226 | 226 | { |
227 | 227 | return $this->countryEnName; |
228 | 228 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | /** |
242 | 242 | * @return mixed |
243 | 243 | */ |
244 | - public function getCountryNativeName():? string |
|
244 | + public function getCountryNativeName(): ? string |
|
245 | 245 | { |
246 | 246 | return $this->countryNativeName; |
247 | 247 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | /** |
261 | 261 | * @return number|null |
262 | 262 | */ |
263 | - public function getRegionId():? number |
|
263 | + public function getRegionId(): ? number |
|
264 | 264 | { |
265 | 265 | return $this->regionId; |
266 | 266 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | /** |
280 | 280 | * @return string|null |
281 | 281 | */ |
282 | - public function getRegionName():? string |
|
282 | + public function getRegionName(): ? string |
|
283 | 283 | { |
284 | 284 | return $this->regionName; |
285 | 285 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | /** |
299 | 299 | * @return string|null |
300 | 300 | */ |
301 | - public function getPostCode():? string |
|
301 | + public function getPostCode(): ? string |
|
302 | 302 | { |
303 | 303 | return $this->postCode; |
304 | 304 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | /** |
318 | 318 | * @return string|null |
319 | 319 | */ |
320 | - public function getLandline():? string |
|
320 | + public function getLandline(): ? string |
|
321 | 321 | { |
322 | 322 | return $this->landline; |
323 | 323 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | /** |
337 | 337 | * @return string|null |
338 | 338 | */ |
339 | - public function getAddressLine1():? string |
|
339 | + public function getAddressLine1(): ? string |
|
340 | 340 | { |
341 | 341 | return $this->addressLine1; |
342 | 342 | } |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | /** |
356 | 356 | * @return string|null |
357 | 357 | */ |
358 | - public function getAddressLine2():? string |
|
358 | + public function getAddressLine2(): ? string |
|
359 | 359 | { |
360 | 360 | return $this->addressLine2; |
361 | 361 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @param AccessToken $accessToken |
15 | 15 | * @return CustomerInterface |
16 | 16 | */ |
17 | - function create(CustomerInterface $customer, AccessToken $accessToken):? CustomerInterface; |
|
17 | + function create(CustomerInterface $customer, AccessToken $accessToken): ? CustomerInterface; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Create a customer card and fill the $card Object with response. |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param AccessToken $accessToken |
25 | 25 | * @return CardInterface |
26 | 26 | */ |
27 | - function createCard(CustomerInterface $customer, CardInterface $card, AccessToken $accessToken):? CardInterface; |
|
27 | + function createCard(CustomerInterface $customer, CardInterface $card, AccessToken $accessToken): ? CardInterface; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Delete a customer card. |