From cce21abaec22d24d0355c0e97e2e351546570839 Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 12:17:57 +0200 Subject: [PATCH 01/10] Removed printing artifactVersion if it is not set --- .../swagger-codegen/src/main/resources/php/README.mustache | 4 ++-- .../src/main/resources/php/configuration.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 1f96e378f1b..125f4212dd4 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,8 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -- Package version: {{artifactVersion}} -- Build date: {{generatedDate}} +{{#artifactVersion}}- Package version: {{artifactVersion}} +{{/artifactVersion}}- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 1b920e48357..57652c7a2a2 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -110,7 +110,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}"; + protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/artifactVersion}}/php{{/httpUserAgent}}"; /** * Debug switch (default set to false) From c54b4faf139e6886d7c9ec23a41a5a664fcffeb4 Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:02:41 +0200 Subject: [PATCH 02/10] Removed printing artifactVersion if it is not set from debug information --- .../src/main/resources/php/configuration.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 57652c7a2a2..edc3e787c16 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,8 +516,8 @@ class Configuration $report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n"; - $report .= " SDK Package Version: {{artifactVersion}}\n"; + $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} + $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; return $report; From 18f32b416322cffc27219424239c05e289e0513e Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:03:31 +0200 Subject: [PATCH 03/10] Proper printing of invokerPackage in configuration debug report --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index edc3e787c16..a3407542ed5 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -513,7 +513,7 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; + $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} From 3484704fea1d48cf0a3346ee3e05743323a389bd Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:07:51 +0200 Subject: [PATCH 04/10] Updated condition for artifactVersion check --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index a3407542ed5..d2a2078fae9 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,7 +516,7 @@ class Configuration $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n";{{^artifactVersion}} + $report .= " OpenAPI Spec Version: {{version}}\n";{{#artifactVersion}} $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; From 030b1bc8c29ef4760c432d801645f2d3e87c8f7b Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Thu, 26 May 2016 15:12:28 +0200 Subject: [PATCH 05/10] added default version 1.0.0 to userAgent --- .../src/main/resources/php/configuration.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index d2a2078fae9..b5fc7f739fe 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -110,7 +110,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/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) From 8369bae08a6c818a2a91ae538be7078be23eb9ac Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Mon, 30 May 2016 15:01:53 +0200 Subject: [PATCH 06/10] Improved formatting --- .../swagger-codegen/src/main/resources/php/README.mustache | 6 ++++-- .../src/main/resources/php/composer.mustache | 6 ++++-- .../src/main/resources/php/configuration.mustache | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 125f4212dd4..aa1ace03973 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,10 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -{{#artifactVersion}}- Package version: {{artifactVersion}} -{{/artifactVersion}}- Build date: {{generatedDate}} +{{#artifactVersion}} +- Package version: {{artifactVersion}} +{{/artifactVersion}} +- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index c52052346e8..477e0819324 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -1,6 +1,8 @@ { - "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",{{#artifactVersion}} - "version": "{{artifactVersion}}",{{/artifactVersion}} + "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}", + {{#artifactVersion}} + "version": "{{artifactVersion}}", + {{/artifactVersion}} "description": "{{description}}", "keywords": [ "swagger", diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index b5fc7f739fe..b6e49fb50f9 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -516,8 +516,10 @@ class Configuration $report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; $report .= " OS: ".php_uname()."\n"; $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: {{version}}\n";{{#artifactVersion}} - $report .= " SDK Package Version: {{artifactVersion}}\n";{{/artifactVersion}} + $report .= " OpenAPI Spec Version: {{version}}\n"; + {{#artifactVersion}} + $report .= " SDK Package Version: {{artifactVersion}}\n"; + {{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; return $report; From ce2e994306680ac40fdd9ee51d33c7f9c7f6d242 Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 12:17:57 +0200 Subject: [PATCH 07/10] Removed printing artifactVersion if it is not set --- .../swagger-codegen/src/main/resources/php/README.mustache | 4 ++-- .../src/main/resources/php/configuration.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 16694d0dad7..cc2cd21bbfd 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,8 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -- Package version: {{artifactVersion}} -- Build date: {{generatedDate}} +{{#artifactVersion}}- Package version: {{artifactVersion}} +{{/artifactVersion}}- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index da21523cfa5..b84b3ee9a03 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -95,7 +95,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}"; + protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/artifactVersion}}/php{{/httpUserAgent}}"; /** * Debug switch (default set to false) From 37264b0bcf0ccfda34db9bfe459f17d2f5ce192d Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Tue, 24 May 2016 14:02:41 +0200 Subject: [PATCH 08/10] Removed printing artifactVersion if it is not set from debug information --- .../src/main/resources/php/configuration.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index b84b3ee9a03..a97358665e3 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -95,7 +95,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen{{#artifactVersion}}/{{{.}}}{{/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) @@ -502,7 +502,9 @@ class Configuration $report .= " OS: ".php_uname().PHP_EOL; $report .= " PHP Version: ".phpversion().PHP_EOL; $report .= " OpenAPI Spec Version: {{version}}".PHP_EOL; + {{#artifactVersion}} $report .= " SDK Package Version: {{artifactVersion}}".PHP_EOL; + {{/artifactVersion}} $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; return $report; From 4f54e5cdc77ecad80bd337653421449f739c862d Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Mon, 30 May 2016 15:01:53 +0200 Subject: [PATCH 09/10] Improved formatting --- .../swagger-codegen/src/main/resources/php/README.mustache | 6 ++++-- .../src/main/resources/php/composer.mustache | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index cc2cd21bbfd..4186ed0ea99 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -6,8 +6,10 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} -{{#artifactVersion}}- Package version: {{artifactVersion}} -{{/artifactVersion}}- Build date: {{generatedDate}} +{{#artifactVersion}} +- Package version: {{artifactVersion}} +{{/artifactVersion}} +- Build date: {{generatedDate}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index c52052346e8..477e0819324 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -1,6 +1,8 @@ { - "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",{{#artifactVersion}} - "version": "{{artifactVersion}}",{{/artifactVersion}} + "name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}", + {{#artifactVersion}} + "version": "{{artifactVersion}}", + {{/artifactVersion}} "description": "{{description}}", "keywords": [ "swagger", From 47576471e288a02cd44ded8f973fe3685ac3bb6a Mon Sep 17 00:00:00 2001 From: Mikolaj Przybysz Date: Wed, 1 Jun 2016 10:57:20 +0200 Subject: [PATCH 10/10] Replaced double quotes with singles --- .../main/resources/php/configuration.mustache | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index a97358665e3..7e3883cf9c4 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -498,14 +498,14 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK ({{invokerPackage}}) Debug Report:".PHP_EOL; - $report .= " OS: ".php_uname().PHP_EOL; - $report .= " PHP Version: ".phpversion().PHP_EOL; - $report .= " OpenAPI Spec Version: {{version}}".PHP_EOL; - {{#artifactVersion}} - $report .= " SDK Package Version: {{artifactVersion}}".PHP_EOL; - {{/artifactVersion}} - $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; + $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . phpversion() . PHP_EOL; + $report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL; + {{#artifactVersion}} + $report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL; + {{/artifactVersion}} + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; }