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

Format control structures, classes, methods and function #20422

Merged

Conversation

ChristophWurst
Copy link
Member

To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is practically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

I think this is one of the last big changes before I can tell php-cs-fixer to fully format to PSR2 🙏

To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Copy link
Member

@gary-kim gary-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just skimmed the diff, looks fine.

The files changed view is literally breaking my browser.

Umm:

tiny patch

+3,872 −5,891

One of these things aren't true but I'm not sure which

@skjnldsv
Copy link
Member

The files changed view is literally breaking my browser.

same xD

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Apr 10, 2020
@ChristophWurst
Copy link
Member Author

Umm:

tiny patch
+3,872 −5,891

I used a bit of sarkasm so people are less mad at me when they see the actual diff. Did it work? Well, I got two positive reviews 💪

@ChristophWurst ChristophWurst merged commit 1762a40 into master Apr 10, 2020
@ChristophWurst ChristophWurst deleted the techdebt/format-control-structs-classes-methods branch April 10, 2020 14:38
@rullzer rullzer mentioned this pull request Apr 13, 2020
59 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants