Skip to content

Commit 4f54049

Browse files
committed
Merge branch 'feature/typing'
2 parents 18b3def + d3b3fa9 commit 4f54049

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

Diff for: swagger-config/marketing/php/templates/Configuration.mustache

+7-12
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class Configuration
3939

4040
public function setConfig($config = array())
4141
{
42-
$apiKey = isset($config['apiKey']) ? $config['apiKey'] : '';
43-
$accessToken = isset($config['accessToken']) ? $config['accessToken'] : '';
44-
$server = isset($config['server']) ? $config['server'] : 'invalid-server';
42+
$apiKey = $config['apiKey'] ?? '';
43+
$accessToken = $config['accessToken'] ?? '';
44+
$server = $config['server'] ?? 'invalid-server';
4545
$host = str_replace('server', $server, $this->getHost());
4646
4747
// Basic Authentication
@@ -72,7 +72,7 @@ class Configuration
7272

7373
public function getApiKey($apiKeyIdentifier)
7474
{
75-
return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
75+
return $this->apiKeys[$apiKeyIdentifier] ?? null;
7676
}
7777

7878
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
@@ -83,7 +83,7 @@ class Configuration
8383

8484
public function getApiKeyPrefix($apiKeyIdentifier)
8585
{
86-
return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
86+
return $this->apiKeyPrefixes[$apiKeyIdentifier] ?? null;
8787
}
8888

8989
public function setAccessToken($accessToken)
@@ -218,19 +218,14 @@ class Configuration
218218

219219
public function getApiKeyWithPrefix($apiKeyIdentifier)
220220
{
221-
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
222221
$apiKey = $this->getApiKey($apiKeyIdentifier);
223222
224223
if ($apiKey === null) {
225224
return null;
226225
}
227226

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

234-
return $keyWithPrefix;
229+
return $prefix === null ? $apiKey : $prefix . ' ' . $apiKey;
235230
}
236231
}

Diff for: swagger-config/marketing/php/templates/api.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use {{invokerPackage}}\ObjectSerializer;
3737
protected $config;
3838
protected $headerSelector;
3939
40-
public function __construct(Configuration $config = null)
40+
public function __construct(?Configuration $config = null)
4141
{
4242
$this->client = new Client([
4343
'defaults' => [

Diff for: swagger-config/transactional/php/templates/api.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use {{invokerPackage}}\ObjectSerializer;
3636
{
3737
protected $config;
3838
39-
public function __construct(Configuration $config = null)
39+
public function __construct(?Configuration $config = null)
4040
{
4141
$this->config = $config ?: new Configuration();
4242
}

0 commit comments

Comments
 (0)