-
Notifications
You must be signed in to change notification settings - Fork 12
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
Upgrade php cs fixer #130
Upgrade php cs fixer #130
Conversation
@@ -30,7 +30,7 @@ public function testHooksCreateParameters() | |||
|
|||
// Test setters that are ignored by the constructor | |||
$hooksCreateParameters->setMeetingId($meetingId = $this->faker->uuid); | |||
$hooksCreateParameters->setGetRaw($getRaw = $this->faker->boolean); | |||
$hooksCreateParameters->setGetRaw($getRaw = $this->faker->boolean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this style.
@sualko @FelixJacobi Any ideas how to keep the old formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably related to https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/operator/binary_operator_spaces.rst, but I think we can not disable it inside method calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, maybe we should move to PSR-12 as a well defined and accepted code style and stop using the space intention at all. I personally really don't like it, as it is a waste of bytes and produces big diffs when adding a new parameter is added and so on, because the whole list must be reformatted:
-$fooBar = 'foo',
-$barBaz = 'bar',
+$fooBar = 'foo',
+$barBaz = 'bar',
+$veryLongParameter = null
To illustrate what I mean. This code style enforces such reformats and this is bad in my opinion on reading of diffs. I would stop using that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reformats in diffs are indeed very annoying, but at the moment I still prefer it for better readability.
However I'm open for a debate on a change in the coding style.
eg. https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/Symfony.rst or just https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/PSR12.rst
We can always customise them if there would be something we dislike.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sualko @FelixJacobi I updated this branch to the new tooling solution and changed to symfony style.
To prevent the yoda style and allowing multi line throws I added two custom rules.
What do you think about the new code style?
551ec17
to
1aaff6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replied to the question and found one point which must be changed. Otherwise, I really like the new code style. Thank you for working on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @sualko Could you take another look?
Merged as it got the required peer approvals already. I think if any changes are wished, they can be easily implemented in a follow-up PR. |
Upgrade php-cs-fixer #129