hechoendrupal / drupal-console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
http://drupalconsole.com
GNU General Public License v2.0
939 stars 559 forks source link

[RFC] - PSR code style? #57

Closed egulias closed 9 years ago

egulias commented 10 years ago

Hi guys! Amazing what you are doing. Reading the code I've found myself reading "Drupal way" code style. I know Gardfield is in the PHP-FIG. Why not changing to the PSR-1, PSR-2 code styles? Would be much easier for us #symfony guys to read & contribute :smile:

cordoval commented 10 years ago

it will not happen, the top leads have this idea ingrained so deep that they think we are wrong :blush:

egulias commented 10 years ago

Yes, is a funny thing that the FIG voters vote for standards they don't intend to use.

cordoval commented 10 years ago

he probably was against, but yeah the idea is to flood them with modules all PSR4 and with 4 spaces, so let's open a ticket in this module.

jmolivas commented 10 years ago

This is a gret idea the generated code is PSR-1, PSR-2 compliant so I will take time to make the code changes in order to make the console project compliant too

jmolivas commented 10 years ago

I have been talking with @dmouse about this and we are planning to complain with PSR1 & PSR2 but make the generated module code complaint with Drupal coding standards

bojanz commented 9 years ago

AFAIK, Drupal coding standards already match PSR-1. PSR-2 is the one Drupal refuses to accept.

jmolivas commented 9 years ago

Yes our goal is:

joshuataylor commented 9 years ago

Yeah the generated code creates code like: `class FoobarEntityAccessControlHandler extends EntityAccessControlHandler

{ `

This isn't a big deal, as PHPStorm can reformat directories to fit a certain code style, ie "Drupal style" one liners instead of PSR-2 (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) style.