Skip to content

Commit

Permalink
minor improvements to Configuration php template (#4989)
Browse files Browse the repository at this point in the history
  • Loading branch information
baartosz authored and wing328 committed Mar 9, 2017
1 parent 4fe79f0 commit cffaaa0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace {{invokerPackage}};
*/
class Configuration
{
private static $defaultConfiguration = null;
private static $defaultConfiguration;
/**
* Associate array to store API key(s)
Expand Down Expand Up @@ -99,7 +99,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}";
protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}';
/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -181,7 +181,7 @@ class Configuration
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $key API key or token
*
* @return Configuration
* @return $this
*/
public function setApiKey($apiKeyIdentifier, $key)
{
Expand All @@ -207,7 +207,7 @@ class Configuration
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
* @param string $prefix API key prefix, e.g. Bearer
*
* @return Configuration
* @return $this
*/
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
{
Expand All @@ -232,7 +232,7 @@ class Configuration
*
* @param string $accessToken Token for OAuth
*
* @return Configuration
* @return $this
*/
public function setAccessToken($accessToken)
{
Expand All @@ -255,7 +255,7 @@ class Configuration
*
* @param string $username Username for HTTP basic authentication
*
* @return Configuration
* @return $this
*/
public function setUsername($username)
{
Expand All @@ -278,7 +278,7 @@ class Configuration
*
* @param string $password Password for HTTP basic authentication
*
* @return Configuration
* @return $this
*/
public function setPassword($password)
{
Expand All @@ -302,7 +302,8 @@ class Configuration
* @param string $headerName header name (e.g. Token)
* @param string $headerValue header value (e.g. 1z8wp3)
*
* @return Configuration
* @throws \InvalidArgumentException
* @return $this
*/
public function addDefaultHeader($headerName, $headerValue)
{
Expand All @@ -329,19 +330,20 @@ class Configuration
*
* @param string $headerName the header to delete
*
* @return Configuration
* @return $this
*/
public function deleteDefaultHeader($headerName)
{
unset($this->defaultHeaders[$headerName]);
return $this;
}

/**
* Sets the host
*
* @param string $host Host
*
* @return Configuration
* @return $this
*/
public function setHost($host)
{
Expand All @@ -364,7 +366,8 @@ class Configuration
*
* @param string $userAgent the user agent of the api client
*
* @return Configuration
* @throws \InvalidArgumentException
* @return $this
*/
public function setUserAgent($userAgent)
{
Expand All @@ -391,7 +394,8 @@ class Configuration
*
* @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
*
* @return Configuration
* @throws \InvalidArgumentException
* @return $this
*/
public function setCurlTimeout($seconds)
{
Expand All @@ -418,7 +422,8 @@ class Configuration
*
* @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout]
*
* @return Configuration
* @throws \InvalidArgumentException
* @return $this
*/
public function setCurlConnectTimeout($seconds)
{
Expand Down Expand Up @@ -446,7 +451,7 @@ class Configuration
*
* @param string $proxyHost HTTP Proxy URL
*
* @return ApiClient
* @return $this
*/
public function setCurlProxyHost($proxyHost)
{
Expand All @@ -469,7 +474,7 @@ class Configuration
*
* @param integer $proxyPort HTTP Proxy Port
*
* @return ApiClient
* @return $this
*/
public function setCurlProxyPort($proxyPort)
{
Expand All @@ -492,7 +497,7 @@ class Configuration
*
* @param integer $proxyType HTTP Proxy Type
*
* @return ApiClient
* @return $this
*/
public function setCurlProxyType($proxyType)
{
Expand All @@ -515,7 +520,7 @@ class Configuration
*
* @param string $proxyUser HTTP Proxy User
*
* @return ApiClient
* @return $this
*/
public function setCurlProxyUser($proxyUser)
{
Expand All @@ -538,7 +543,7 @@ class Configuration
*
* @param string $proxyPassword HTTP Proxy Password
*
* @return ApiClient
* @return $this
*/
public function setCurlProxyPassword($proxyPassword)
{
Expand All @@ -561,7 +566,7 @@ class Configuration
*
* @param bool $debug Debug flag
*
* @return Configuration
* @return $this
*/
public function setDebug($debug)
{
Expand All @@ -584,7 +589,7 @@ class Configuration
*
* @param string $debugFile Debug file
*
* @return Configuration
* @return $this
*/
public function setDebugFile($debugFile)
{
Expand All @@ -607,7 +612,7 @@ class Configuration
*
* @param string $tempFolderPath Temp folder path
*
* @return Configuration
* @return $this
*/
public function setTempFolderPath($tempFolderPath)
{
Expand All @@ -630,7 +635,7 @@ class Configuration
*
* @param boolean $sslVerification True if the certificate should be validated, false otherwise
*
* @return Configuration
* @return $this
*/
public function setSSLVerification($sslVerification)
{
Expand Down Expand Up @@ -683,7 +688,7 @@ class Configuration
{
$report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . phpversion() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL;
{{#artifactVersion}}
$report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL;
Expand Down
Loading

0 comments on commit cffaaa0

Please sign in to comment.