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

Added php_cs.dist / Updated .styleci.yml / Fixed and updated .travis.yml #792

Merged
merged 1 commit into from
Sep 19, 2016

Conversation

robfrawley
Copy link
Collaborator

@robfrawley robfrawley commented Sep 9, 2016

Description

Adds php-cs-fixer and php-cs-fixer-styleci-bridge as development dependencies, enabling automatic configuration of bin/php-cs-fixer using the .styleci.yml file.

Now, running php-cs-fixer is easy, which will hopefully provide incentive for regular use of PHP-CS-Fixer:

bin/php-cs-fixer fix ./

Additional Details

The .styleci.yml file was updated to enable a few additional, sensible options on top of the symfony preset. For example, as PHP 5.3 is supported, the long_array_syntax rule was added. This caught a bug in the current production code base, seen here.

The other, additional rules add consistency I believe worthwhile, such as:

  • ordering file imports
  • ordering phpdocs

Reference their fixer docs for details about what all the new rules do and provide feedback if you disagree with any of the newly introduced rules.

Original Commit Message

  • Added "friendsofphp/php-cs-fixer:~2.0" development dep.
  • Added "sllh/php-cs-fixer-styleci-bridge:~2.1" development dep to enable php-cs-fixer configuration directly from .styleci.yml config file.
  • Updated "styleci.yml" file rule additions (on top of symfony preset):
    • combine_consecutive_unsets
    • linebreak_after_opening_tag
    • no_short_echo_tag
    • ordered_imports
    • phpdoc_order
    • php_unit_construct
    • php_unit_dedicate_assert
    • long_array_syntax
  • Added "sort-packages" to "config" key in "composer.json"
  • Updated "suggest" key descriptions in "composer.json" for clarity.

@robfrawley robfrawley force-pushed the feature-phpcsfixer branch 2 times, most recently from 49650fe to a85a35f Compare September 9, 2016 11:50
@robfrawley robfrawley changed the title Created php_cs.dist, Updated .styleci.yml , and Ran Fixer Created php_cs.dista and Updated .styleci.yml Sep 9, 2016
@robfrawley robfrawley force-pushed the feature-phpcsfixer branch 2 times, most recently from ef0c92f to d598d43 Compare September 9, 2016 12:02
@robfrawley
Copy link
Collaborator Author

robfrawley commented Sep 9, 2016

Broken tests are caused by fixing .travis.yml file in this PR. Previously, all flyststem tests were being skipped.

Fix for broken tests in #793. Tests for branch with both this PR and #793 here.

@robfrawley robfrawley changed the title Created php_cs.dista and Updated .styleci.yml Created php_cs.dista, updates to .styleci.yml, updates to .travis.yml Sep 9, 2016
@alexwilson
Copy link
Collaborator

Looking good!

@lsmith77 lsmith77 added the State: Reviewing This item is being reviewed to determine if it should be accepted. label Sep 13, 2016
@robfrawley
Copy link
Collaborator Author

@lsmith77 This can easily be rebased to make the tests green, but #793 needs to be merged first or this will never pass.

@lsmith77
Copy link
Contributor

#793 has been merged

@robfrawley robfrawley force-pushed the feature-phpcsfixer branch 2 times, most recently from 3fccb39 to f6cbd74 Compare September 15, 2016 21:28
@robfrawley
Copy link
Collaborator Author

robfrawley commented Sep 15, 2016

@lsmith77 Tests are green now that this PR has been re-based on top of master (now that #793 has been merged).

- Added "friendsofphp/php-cs-fixer:~2.0" development dep.
- Added "sllh/php-cs-fixer-styleci-bridge:~2.1" development dep to enable php-cs-fixer configuration directly from .styleci.yml config file.
- Updated "styleci.yml" file rule additions (on top of symfony preset):
  - combine_consecutive_unsets
  - linebreak_after_opening_tag
  - no_short_echo_tag
  - ordered_imports
  - phpdoc_order
  - php_unit_construct
  - php_unit_dedicate_assert
  - long_array_syntax
- Added "sort-packages" to "config" key in "composer.json"
- Updated "suggest" key descriptions in "composer.json" for clarity.
- Added travis fix for Symfony 2.3
- Fixed bad shell code in travis file.
- Added travis fix for Symfony 2.3 in dev require mode.

travis fix

fixed travis

typo fix

travis fix

bugfix

travis cleanup
@robfrawley robfrawley changed the title Created php_cs.dista, updates to .styleci.yml, updates to .travis.yml Added php_cs.dist / Updated .styleci.yml / Fixed and updated .travis.yml Sep 15, 2016
@lsmith77 lsmith77 merged commit a230810 into liip:master Sep 19, 2016
@lsmith77 lsmith77 deleted the feature-phpcsfixer branch September 19, 2016 07:35
@lsmith77 lsmith77 removed the State: Reviewing This item is being reviewed to determine if it should be accepted. label Sep 19, 2016
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.

4 participants