Skip to content

Commit 8bdfbdc

Browse files
author
jchen293
committed
address nitpick
1 parent bb1c123 commit 8bdfbdc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/EasyPost/Constant/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class Constants
2020
'FedexSmartpostAccount'
2121
];
2222

23-
const UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS = [
23+
const UPS_OAUTH_ACCOUNT_TYPES = [
2424
'UpsAccount',
2525
'UpsMailInnovationsAccount',
2626
'UpsSurepostAccount'

lib/EasyPost/Service/CarrierAccountService.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public function update(string $id, mixed $params): mixed
4545
{
4646
$carrierAccount = self::retrieve($id);
4747
$carrierAccountType = $carrierAccount['type'];
48-
if (in_array($carrierAccountType, Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS, true)) {
49-
$updateUrl = 'upsOauthRegistration';
48+
if (in_array($carrierAccountType, Constants::UPS_OAUTH_ACCOUNT_TYPES, true)) {
49+
$className = 'UpsOauthRegistration';
5050
$params = [self::selectTopLayerKey($carrierAccountType) => $params];
5151
} else {
52-
$updateUrl = 'carrierAccount';
52+
$className = 'CarrierAccount';
5353
$params = [self::selectTopLayerKey($carrierAccountType) => $params];
5454
}
55-
return self::updateResource($updateUrl, $id, $params);
55+
return self::updateResource($className, $id, $params);
5656
}
5757

5858
/**
@@ -111,7 +111,7 @@ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType
111111
{
112112
if (in_array($carrierAccountType, Constants::CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS, true)) {
113113
return '/carrier_accounts/register';
114-
} else if (in_array($carrierAccountType, Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS, true)) {
114+
} else if (in_array($carrierAccountType, Constants::UPS_OAUTH_ACCOUNT_TYPES, true)) {
115115
return '/ups_oauth_registrations';
116116
}
117117

@@ -126,7 +126,7 @@ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType
126126
*/
127127
private function selectTopLayerKey(string $carrierAccountType): string
128128
{
129-
return in_array($carrierAccountType, Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS, true)
129+
return in_array($carrierAccountType, Constants::UPS_OAUTH_ACCOUNT_TYPES, true)
130130
? 'ups_oauth_registrations'
131131
: 'carrier_account';
132132
}

0 commit comments

Comments
 (0)