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

Refactor or reformat code to adjust to PSR-2 #11

Closed
carlosbello opened this issue Feb 5, 2017 · 1 comment
Closed

Refactor or reformat code to adjust to PSR-2 #11

carlosbello opened this issue Feb 5, 2017 · 1 comment
Assignees

Comments

@carlosbello
Copy link
Member

As far as possible, try to reformat all the project specific code to upgrade the relaxed PSR-2 rules.

Now if we execute the phpsc linter we get near to 700 warnings in 60 files. And that could be errors, instead of warnings because now we have 26 PSR-2 rules relaxed to a warning level, instead of it original error level.

So, we should start fixing this errors on this order:

  1. FIXES REQUIRED RULES
  2. REFACTOR REQUIRED RULES
  3. NAMING CONVENTION RULES
  4. FORMATING IMPROVEMENTS RULES

To work rule buy rule, look in the phpcs.xml file for the rule names and run:

$ vendor/bin/phpcs --sniffs="Rule name"

Replacing "Rule name" with the rule, for example "Generic.ControlStructures.InlineControlStructure"

$ vendor/bin/phpcs --sniffs=Generic.ControlStructures.InlineControlStructure

@carlosbello
Copy link
Member Author

Done. See Pull request 12.

Note: Some rules has been ignored or maintained in a warning level for gradual migration like placing the open brace "{" in a new line. The line ending rule (requesting \n instead of \r\n) or the use of tabs, instead of spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant