[PHP] Better PSR2 compatibility#3863
Conversation
|
Please not, I did run |
|
Yes, you should commit it so that your PR is tested by CI |
|
@cbornet thanks, done. |
|
@dkarlovi thanks for the PR. For Ref: http://php.net/manual/en/language.types.array.php
cc @arnested |
|
@wing328 I'm fine either way, but, the way I see it, if the declared requirement in composer.json is 5.4, you can expect it will not work out of the box with 5.3. What we could do is add a blurb on how to convert it to classic array syntax by using PHP-CS-Fixer's |
|
This looks really fine to me. Nice job, @dkarlovi. I'm still in the habit of using But I think we should just move on and go all in on our 5.4 dependency and embrace |
|
OK. Let's move forward with this :) |
|
@dkarlovi btw, I was not able to run the following:
|
|
Thanks, @arnested. @wing328 after you run Thanks for the merge. |
|
@dkarlovi I did but no luck: |
|
@wing328 have you re-generated the
|
|
@dkarlovi ok, will give it another try with a new PHP SDK. If you don't hear from him, you can assume I don't encounter any issue :) |
|
@wing328 if you still have an issue, I'll verify that it's not in my code and file a new PR to fix it if it is. :) |
|
|
* upstream/master: (79 commits) add undertow Add a new cli command to output version information (2nd attempt) swagger-api#3892 (swagger-api#3899) fix python flask controller without tag (default_controller) [aspnet5] Fix basePath application to operations (swagger-api#3911) Bugfix/issue 3723 (swagger-api#3726) Cgardens nested object regex (swagger-api#3879) [Cpprest] Fixing issue swagger-api#3773 (swagger-api#3876) escape callback parameter for java(okhttp) and python fix warning in html generator [PHP] fix PHPUnit invocation, add basic phpunit.xml.dist (swagger-api#3864) [Java] Remove duplicated model description in Spring, JAX-RS models (swagger-api#3887) [PHP] Better PSR2 compatibility (swagger-api#3863) Mention security script in pull request template [Swift] Use thread safe manager dictionary Replace ^M with new line (\r) in mustache template (swagger-api#3865) [swfit] fix url param with base name [JaxRS]Show correct default value on CLI option description (swagger-api#3862) add title, description to HTML output (swagger-api#3860) fix trailing comma in go api client fix typescript-fetch base path by removing ending slash ...
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
These changes fix the emitted PHP compatibility with the declared PHP-FIG's PSR2 coding style. This can be verified by using the standard tool for the task in the PHP ecosystem, PHP-CS-Fixer, for which the configuration has also been included with the
.php_csfile.To verify compatibility, run as follows:
Notes
composer.json, array notation has been switched to new short array syntax introduced in PHP 5.4 to better match new best practices, this has also been enforced in.php_cs