Skip to content

Commit 8f82034

Browse files
committed
Merge pull request #2947 from mikolajprzybysz/version-check-mustache
[PHP] Check skipping artifiactVersion in other mustache templates, since it is not required anymore
2 parents 7b6747e + 4757647 commit 8f82034

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

modules/swagger-codegen/src/main/resources/php/README.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
77

88
- API version: {{appVersion}}
9+
{{#artifactVersion}}
910
- Package version: {{artifactVersion}}
11+
{{/artifactVersion}}
1012
- Build date: {{generatedDate}}
1113
- Build package: {{generatorClass}}
1214
{{#infoUrl}}

modules/swagger-codegen/src/main/resources/php/composer.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",{{#artifactVersion}}
3-
"version": "{{artifactVersion}}",{{/artifactVersion}}
2+
"name": "{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}",
3+
{{#artifactVersion}}
4+
"version": "{{artifactVersion}}",
5+
{{/artifactVersion}}
46
"description": "{{description}}",
57
"keywords": [
68
"swagger",

modules/swagger-codegen/src/main/resources/php/configuration.mustache

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Configuration
9595
*
9696
* @var string
9797
*/
98-
protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}";
98+
protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}";
9999

100100
/**
101101
* Debug switch (default set to false)
@@ -498,12 +498,14 @@ class Configuration
498498
*/
499499
public static function toDebugReport()
500500
{
501-
$report = "PHP SDK ({{invokerPackage}}) Debug Report:".PHP_EOL;
502-
$report .= " OS: ".php_uname().PHP_EOL;
503-
$report .= " PHP Version: ".phpversion().PHP_EOL;
504-
$report .= " OpenAPI Spec Version: {{version}}".PHP_EOL;
505-
$report .= " SDK Package Version: {{artifactVersion}}".PHP_EOL;
506-
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL;
501+
$report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL;
502+
$report .= ' OS: ' . php_uname() . PHP_EOL;
503+
$report .= ' PHP Version: ' . phpversion() . PHP_EOL;
504+
$report .= ' OpenAPI Spec Version: {{version}}' . PHP_EOL;
505+
{{#artifactVersion}}
506+
$report .= ' SDK Package Version: {{artifactVersion}}' . PHP_EOL;
507+
{{/artifactVersion}}
508+
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
507509

508510
return $report;
509511
}

0 commit comments

Comments
 (0)