-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add coding-standard rules with PHP-CS-Fixer #5989
base: master
Are you sure you want to change the base?
Conversation
Thank you for working on this. We're used to some style rules and we would like to keep them. It is:
|
05dc488
to
25a1395
Compare
Done. Pay attention that now every control structure is on a new line, so also
Done, but strongly discourage this because:
Done. |
I want:
From what I see you moved all open brackets to a new line. Also your change to Thanks again for your work, it's really appreciated. |
25a1395
to
8125169
Compare
To be consistent, the fixer handles the newline to all control structures, it's not possible to choose which one yes and which one no. Please note that even if my language is a bit strict, I do not want to impose anything. I believe it is important to:
For this list PHP-CS-Fixer emerged as a common tool in the PHP world, but also chose some conventions over the other (for good reasons most of the times), and the fact that it was born as a Symfony project it skyrocketed those specific conventions thanks to Symfony popularity. Feel free to accept only what you want; as an OOS maintainer myself, between custom rules and automation, if I must choose one of the two I choose automation. |
If we can do an exception for I also noted this:
I really don't like it. Do you know how to disable this? |
It's called Btw I've disabled it. |
Except "else/elseif/catch/etc in a new line" we're almost ok. Last two things:
Adding comma after the last array item makes sense only if every item of the array is in a separate line, not for "inline" cases. I'd also disable a rule for this:
Performance impact of intval() is negligible on recent PHP versions. I use type casting when I don't have to bother with brackets, but sometimes intval() just looks simpler. |
I've disabled Regarding the array comma, the fix is already as you expect. Single inline array are left without ending commas, multiline array must have trailing commas: $arr = array(1,2,3);
$arr = array(
1,
2,
3,
); The example you provided is a mixed type: roundcubemail/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php Lines 1276 to 1279 in c26c856
This is not an inline array: the author should have written this like the following: $select = new html_select(array(
'name' => '_set',
'id' => $attrib['id'],
'onchange' => $this->rc->task != 'mail' ? 'rcmail.managesieve_set()' : '',
)); |
Thank you for submitting a Pull Request (PR) to the Roundcube GitHub project. You are receiving this message because your PR has conflicts which need to be resolved. We are trying to catch up on our backlog of old PRs and get them merged in (where appropriate). Therefor, we request the following: Step 1. Rebase from the latest Roundcube branch master into your PR.
Step 2. Re-test to make sure your new code still works as expected Step 3. Comment back here once it has been tested and will merge cleanly. Once this has been done we will treat it like a new Pull Request and consider it for acceptance. Apologies for the inconvenience. Thank you for contributing to Roundcube! |
.php_cs
filedev