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 7.2 #8534

Merged
merged 3 commits into from
Oct 2, 2018
Merged

PHP 7.2 #8534

merged 3 commits into from
Oct 2, 2018

Conversation

mattmelling
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fixes #8533. The PHP client uses friendsofphp/php-cs-fixer v1.12 for PSR2 analysis. 1,12 doesn't supports PHP up to < 7.2.

PHP >= 7.2 support was added in php-cs-fixer v2 which made some changes to the API and default fixers/rules.

This PR upgrades php-cs-fixer to v2.12. The fixers/rules have been aligned for PSR2 as desired in the original PR (#3863). I've changed defaults for some of the rules to prevent lots of whitespace warnings from php-cs-fixer, these typically seem to be down to blank template values and are not raised when using the configuration in master.

Notes

  • php-cs-fixer added the idea of "risky" fixers in v2. Since the strict_param and strict_comparison fixers are considered risky, we must alter the command line to vendor/bin/php-cs-fixer fix --dry-run --diff -vvv --allow-risky yes even when using --dry-run.

/cc @dkarlovi, @mandrean

some rules around whitespace have been disabled, since we don't have a
great deal of control over whitespace that is emitted when template
values are empty.
@jangaehler
Copy link

Can someone please merge this pull request, it is still an issue!

@mattmelling
Copy link
Contributor Author

Just wanted to pass on that we were able to get this pull request merged with the OpenAPI project over at OpenAPITools/openapi-generator#769. I'm a user of both OpenAPI and this project, and would love to see PHP7.2 support for my v2 spec clients!

Please don't hesitate to reach out if I can be of any assistance.

@HugoMario HugoMario merged commit aa87e4f into swagger-api:master Oct 2, 2018
@HugoMario
Copy link
Contributor

thanks a lot @mattmelling!!!

@itg-dave
Copy link

itg-dave commented May 7, 2019

Why wasn't this bundled in any of the 3.0.* releases?

@softwareok1
Copy link

@HugoMario we use cli v3.20, still the same problem any answer how, which executable to use without having this issue?

This was referenced Mar 11, 2021
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PHP] Can't run composer install when running PHP >= 7.2
5 participants