Skip to content
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

Merged
merged 12 commits into from
Jun 1, 2016

Conversation

mikolajpe
Copy link
Contributor

I have found some places that still try to print artifactVersion even though it is not required. So I added possibility to skip it.

- Package version: {{artifactVersion}}
- Build date: {{generatedDate}}
{{#artifactVersion}}- Package version: {{artifactVersion}}
{{/artifactVersion}}- Build date: {{generatedDate}}
Copy link
Contributor

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.

@wing328 wing328 added this to the v2.2.0 milestone May 25, 2016
@mikolajpe
Copy link
Contributor Author

mikolajpe commented May 26, 2016

@arnested Regarding your first comment, did you mean, something like this:

{{#artifactVersion}}- Package version: {{artifactVersion}}{{/artifactVersion}}
- Build date: {{generatedDate}}

I checked it and if I do it like this I end up with empty line

@arnested
Copy link
Contributor

I meant:

{{#artifactVersion}}
- Package version: {{artifactVersion}}
{{/artifactVersion}}
- Build date: {{generatedDate}}

With the recent jMustache this should not produce blank lines.

@mikolajpe
Copy link
Contributor Author

@arnested yup, you are correct, it works, thanks for good advice 👍

@@ -513,11 +513,13 @@ class Configuration
*/
public static function toDebugReport()
{
$report = "PHP SDK ({{invokerPackage}}) Debug Report:\n";
$report = 'PHP SDK ({{invokerPackage}}) Debug Report:'."\n";
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

@wing328 wing328 merged commit 8f82034 into swagger-api:master Jun 1, 2016
@mikolajpe mikolajpe deleted the version-check-mustache branch June 1, 2016 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants