Php-cs-fixer: Special getter / setter / hasser cases for ordered_class_elements

Created on 4 May 2017  路  9Comments  路  Source: FriendsOfPHP/PHP-CS-Fixer

I like the ordered_class_elements class fixer, but I would like to keep "pure" getters, setters and hassers at the end of my class, whatever the public / protected / private order definition.

Maybe could we add hierarchy options for that?

kinfeature request

Most helpful comment

Nono, I don't want a fixer for that :+1: I'm fine with my hands and AI :smile:

All 9 comments

for me, it's too specific, :-1: unless you provide nice, generic solution

Having getters, setters and hassers option for function directly "linked" to the property is the more generic way IMHO.

Or I didn't understand your question. :wink:

@Soullivaneuh I think question was: how would you solve that?

@TomasVotruba Not sure to understand your question.

I talked about the option. After that I can work on some POC to see what is possible.

@Soullivaneuh It's been a while for me. I guess I was curious about specific approach that would make sense.

I'm personally fine with public/protected/private, ordered by use order.

E.g. while 1st public method uses 2 private methods, they should be in top of private methods.

big :-1: for that.
then, other public method would use that private, and code would be rearrange because of that :/

Nono, I don't want a fixer for that :+1: I'm fine with my hands and AI :smile:

What about keeping the default behavior and propose this as option? If you don't want to add exception, just don't activate them?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carusogabriel picture carusogabriel  路  3Comments

EvgenyOrekhov picture EvgenyOrekhov  路  3Comments

amitbisht511 picture amitbisht511  路  3Comments

ndench picture ndench  路  3Comments

BackEndTea picture BackEndTea  路  3Comments