mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge pull request #1702 from wing328/php_profile
[PHP] add Php profiler for petstore sample
This commit is contained in:
commit
207b14283c
@ -184,14 +184,14 @@ use \{{invokerPackage}}\ObjectSerializer;
|
||||
{{#authMethods}}{{#isApiKey}}
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('{{keyParamName}}');
|
||||
if ($apiKey !== null) {
|
||||
if (strlen($apiKey) !== 0) {
|
||||
{{#isKeyInHeader}}$headerParams['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}}
|
||||
}{{/isApiKey}}
|
||||
{{#isBasic}}// this endpoint requires HTTP basic authentication
|
||||
if ($this->apiClient->getConfig()->getUsername() !== null or $this->apiClient->getConfig()->getPassword() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
|
||||
}{{/isBasic}}{{#isOAuth}}// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}{{/isOAuth}}
|
||||
{{/authMethods}}
|
||||
|
@ -152,7 +152,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ class PetApi
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if ($apiKey !== null) {
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
@ -621,7 +621,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -716,7 +716,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
@ -828,7 +828,7 @@ class PetApi
|
||||
}
|
||||
|
||||
// this endpoint requires OAuth (access token)
|
||||
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
|
||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ class StoreApi
|
||||
|
||||
// this endpoint requires API key authentication
|
||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||
if ($apiKey !== null) {
|
||||
if (strlen($apiKey) !== 0) {
|
||||
$headerParams['api_key'] = $apiKey;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user