DEV Community

loading...

Discussion on: A simple tip for cleaner code

Collapse
inozex profile image
Tiago Marques
        function foo($bar)
        { //why?

            if (...) {
                ...
            }

        } //why?

When I started reading, I thought the problem was that the inconsistency of the placement of braces...

Collapse
blackcat_dev profile image
Sasa Blagojevic Author

Well this is actually according to PSR - php’s community style guide :D Control flow has same line braces, functions have next line braces.

Collapse
inozex profile image
Tiago Marques

One more thing for me to dislike PSR... I really don't like they new line rules.
But thank you for explain me!