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
PSR-2 Cleanup #1173
PSR-2 Cleanup #1173
Conversation
The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented.
A file must always end with a single empty line feed.
When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis.
Spaces should be properly placed in a function declaration.
Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
The PHP constants true, false, and null MUST be in lower case.
PHP keywords MUST be in lower case.
In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma.
There MUST be one use keyword per declaration.
There MUST NOT be a space after the opening parenthesis. There MUST NOT be a space before the closing parenthesis.
Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
Remove trailing whitespace at the end of non-blank lines.
Visibility MUST be declared on all properties and methods; abstract and final MUST be declared before the visibility; static MUST be declared after the visibility.
If this is OK with you, i'll squash the commits. |
We purposely add spaces before Anyway I'm not sure if this will be merged, there were previous attempts on running a CS Fixer but none of them was successful as the best would be enforcing standard organization wide. By the way, is hyperunknown@5e3bbd6 really a PSR thing? |
@malarzm For your question, please refer to pt. 6. Closures Why where previous attempts using a cs fixer not successful ? |
I would suggest merge this PR: #1097 first, this way every contributor follow same PSR-2 rules. :) |
@peshi it's more readable :) Also I think @guilhermeblanco likes that very much and we believe it was ommited accidentally in the PSR. Heh for closures, PSR2 always surprises me... As for previous attempts we ended up not merging them mainly because we'd like to roll CS rules for all Doctrine projects but usually this issue is not on top of anybody's todo list ;) |
Alright, fair enough :) Closing. |
@peshi: thanks for investing the time on this. I did look into creating fixer rules, but never got around to customizing them enough to meet @guilhermeblanco's demands. https://github.com/doctrine/coding-standard exists and will one day address this, but it's still a work in progress. |
@jmikola No worries, I have been following the fixer commits that's why I decided to split each rule into it's own commit and only choosing a few. In any case I suspected that it might be rejected and in the process receive an explanation :) |
Small psr-2 cleanup