Skip to content

Commit 9322972

Browse files
committed
Fix some codesniffer warnings using phpcbf
1 parent 96af9fb commit 9322972

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

Block/Onepage/LayoutProcessor.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public function process($jsLayout): array
7676
'payment', 'children',
7777
'payments-list', 'children',
7878
]);
79+
} catch (LocalizedException $e) {
80+
7981
}
80-
catch (LocalizedException $e) { }
8182

8283
if (isset($billingConfiguration)) {
8384
foreach ($billingConfiguration as $key => &$billingForm) {
@@ -109,8 +110,9 @@ public function process($jsLayout): array
109110
'billing-address-form', 'children',
110111
'form-fields', 'children',
111112
]);
113+
} catch (LocalizedException $e) {
114+
112115
}
113-
catch (LocalizedException $e) { }
114116

115117
if (isset($billingFields)) {
116118
$billingFields += $this->_updateCustomScope($autofillFields, 'billingAddressshared');
@@ -128,8 +130,9 @@ public function process($jsLayout): array
128130
'billingAddress', 'children',
129131
'billing-address-fieldset', 'children',
130132
]);
133+
} catch (LocalizedException $e) {
134+
131135
}
132-
catch (LocalizedException $e) { }
133136

134137
if (isset($magePlazaBillingFields)) {
135138
$magePlazaBillingFields += $this->_updateCustomScope($autofillFields, 'billingAddress');

Helper/ApiClientHelper.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,31 +147,30 @@ public function getAddressDetails(string $context): array
147147
protected function _getRegionFromDetails(array $addressDetails): array
148148
{
149149
$countryIso2 = $addressDetails['country']['iso2Code'];
150-
switch ($countryIso2)
151-
{
150+
switch ($countryIso2) {
152151
case 'NL':
153152
$region = $addressDetails['details']['nldProvince']['name'];
154-
break;
153+
break;
155154
case 'BE':
156155
if (isset($addressDetails['details']['belProvince'])) {
157156
$region = $addressDetails['details']['belProvince']['primaryName'];
158157
} else {
159158
$region = $addressDetails['details']['belRegion']['primaryName'];
160159
}
161-
break;
160+
break;
162161
case 'DE':
163162
$region = $addressDetails['details']['deuFederalState']['name'];
164-
break;
163+
break;
165164
case 'LU':
166165
$region = $addressDetails['details']['luxCanton']['name'];
167-
break;
166+
break;
168167
case 'ES':
169168
$region = $addressDetails['details']['espProvince']['name'];
170169
$regions = explode('/', $region);
171-
break;
170+
break;
172171
case 'CH':
173172
$region = $addressDetails['details']['cheCanton']['name'];
174-
break;
173+
break;
175174
}
176175

177176
if (isset($region)) {
@@ -251,8 +250,7 @@ public function getNlAddress(string $zipCode, string $houseNumber): array
251250
$address = $this->_prepareResponse($address, $client);
252251
$status = 'valid';
253252

254-
if (
255-
(strcasecmp($address['houseNumberAddition'] ?? '', $houseNumberAddition ?? '') != 0)
253+
if ((strcasecmp($address['houseNumberAddition'] ?? '', $houseNumberAddition ?? '') != 0)
256254
|| (!empty($address['houseNumberAdditions']) && null === $address['houseNumberAddition'])
257255
) {
258256
$status = 'houseNumberAdditionIncorrect';
@@ -303,8 +301,7 @@ private function _handleClientException(\Exception $exception): array
303301
$result['exception'] = __('Exception %1 occurred.', get_class($exception)) . $exception->getTraceAsString();
304302
$result['message'] = __($exception->getMessage());
305303
$result['magento_debug_info'] = $this->_getDebugInfo();
306-
}
307-
else if ($exception instanceof NotFoundException) {
304+
} elseif ($exception instanceof NotFoundException) {
308305
// Only in this case we actually pass error to the front-end without debug option needed.
309306
$result['message'] = __($exception->getMessage());
310307
}
@@ -386,8 +383,7 @@ public function getAccountInfo(): array
386383
{
387384
try {
388385
return $this->getApiClient()->accountInfo();
389-
}
390-
catch (\Exception $e) {
386+
} catch (\Exception $e) {
391387
return [];
392388
}
393389
}

Model/Resolver/AddressApiSettings.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public function resolve(
3333
ResolveInfo $info,
3434
array $value = null,
3535
array $args = null
36-
): array
37-
{
36+
): array {
3837
return $this->_storeConfigHelper->getJsinit();
3938
}
4039
}

Model/Resolver/DutchAddress.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ public function resolve(
3434
ResolveInfo $info,
3535
array $value = null,
3636
array $args = null
37-
): array
38-
{
37+
): array {
3938
$result = $this->_apiClientHelper->getNlAddress($args['postcode'], $args['houseNumber']);
4039
if (!empty($result['error'])) {
4140
throw new GraphQlInputException(__($result['message'] ?? 'Unknown error'));

Model/Resolver/IntlAddress/Details.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function resolve(
2020
ResolveInfo $info,
2121
array $value = null,
2222
array $args = null
23-
): array
24-
{
23+
): array {
2524
$this->requireSessionHeader();
2625

2726
$result = $this->_apiClientHelper->getAddressDetails($args['context']);

Model/Resolver/IntlAddress/Matches.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function resolve(
2020
ResolveInfo $info,
2121
array $value = null,
2222
array $args = null
23-
): array
24-
{
23+
): array {
2524
$this->requireSessionHeader();
2625

2726
$result = $this->_apiClientHelper->getAddressAutocomplete($args['context'], $args['term']);

0 commit comments

Comments
 (0)