QafooLabs / php-refactoring-browser

A command line refactoring tool for PHP
http://qafoolabs.github.com/php-refactoring-browser
MIT License
556 stars 39 forks source link

Coding style #57

Open tomphp opened 10 years ago

tomphp commented 10 years ago

I think some thought needs to be had about coding style.

Currently local variable to instance variable adds a variable directly under the last instance variable with a single blank line below.

This often leads to multiple blank lines added below if one already exists, this is a simple bug to fix (I'll do that one shortly).

My issue however is I like a blank line above as my instance variables generate have a docblock so I like my definitions like so:

/**
 * @var string
 */
private $name;

/**
 * @var int
 */
private $age

However I'm guess it currently goes directly underneath as whoever implemented that feature styles there code that way? I'm guessing like so:

private $name;
private $age;

Neither of these are right or wrong but it's got me thinking that maybe we need an approach to generate the refactors in different coding styles? Anyone have any thoughts on this? Maybe having a config file which defines your preferred style rules?

bnppl commented 10 years ago

I think this would be a great addition. Perhaps it could use something like this http://editorconfig.org/

beberlei commented 9 years ago

Sounds like a good idea.