-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP] Check skipping artifiactVersion in other mustache templates, since it is not required anymore #2947
[PHP] Check skipping artifiactVersion in other mustache templates, since it is not required anymore #2947
Changes from 4 commits
cce21ab
c54b4fa
18f32b4
3484704
030b1bc
8369bae
794e7e4
ce2e994
37264b0
4f54e5c
9f94220
4757647
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}}"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should put in something instead of the I think I read something about the default user agent is intended to follow a format of So maybe we should just put in the string "unknown-version" when we don't have a better guess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should keep the default version (1.0.0) to make it consistent with other langauges and have the users set the version properly via |
||
|
||
/** | ||
* Debug switch (default set to false) | ||
|
@@ -513,11 +513,11 @@ class Configuration | |
*/ | ||
public static function toDebugReport() | ||
{ | ||
$report = "PHP SDK ({{invokerPackage}}) Debug Report:\n"; | ||
$report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about replacing "\n" with PHP_EOL? (I thought you've done it via another PR already, maybe you need to rebase on the latest master) What about remaining lines with double quote? shall we replace it with single quote as well? |
||
$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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just put
{{#artifactVersion}}
and{{/artifactVersion}}
on lines of their own.As of recently whitespace will be stripped around them if they are the only thing on a line.
This looks nicer and more readable in the mustache template.