Skip to content

Commit 3c1dd9a

Browse files
committed
refactor: simplify getApiKeyWithPrefix
1 parent 4718487 commit 3c1dd9a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

swagger-config/marketing/php/templates/Configuration.mustache

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,14 @@ class Configuration
220220

221221
public function getApiKeyWithPrefix($apiKeyIdentifier)
222222
{
223-
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
224223
$apiKey = $this->getApiKey($apiKeyIdentifier);
225224
226225
if ($apiKey === null) {
227226
return null;
228227
}
229228

230-
if ($prefix === null) {
231-
$keyWithPrefix = $apiKey;
232-
} else {
233-
$keyWithPrefix = $prefix . ' ' . $apiKey;
234-
}
229+
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
235230

236-
return $keyWithPrefix;
231+
return $prefix === null ? $apiKey : $prefix . ' ' . $apiKey;
237232
}
238233
}

0 commit comments

Comments
 (0)