Tbh I don't think we shouldn't specify class element order that deep.
Different class designs call for different ordering IMHO.
On Thu, Jun 8, 2017 at 3:33 PM, Woody Gilk wrote:
> I've taken to defining private properties at the end of the class,
> especially if the
I've taken to defining private properties at the end of the class,
especially if the constructor is private.
This is not something that should be standardized, IMO.
On Thu, Jun 8, 2017, 08:14 Larry Garfield wrote:
> I am also fine with leaving this unspecified. There's
I am also fine with leaving this unspecified. There's too many cases
where I want to group things "logically", in a contextually-dependent way.
At best I could see "constants, then properties, then methods", but
that's as far as I think it's reasonable to go and I'd be fine with not
even
Putting publicly visible properties before private ones is something new to
me.
On Sunday, June 4, 2017 at 4:19:38 PM UTC+3, Кирилл Фрейман wrote:
>
> Hi everyone!
>
> In PHP de-facto exists some best practice of ordering methods and
> properties.
> It seems to me that this order is most
> Should we standartize it?
How about enforcing on a per-project-basis with
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/src/Fixer/ClassNotation/OrderedClassElementsFixer.php?
Best regards,
Andreas
--
You received this message because you are subscribed to the Google Groups
I agree that a sequence of constants-properties-methods is ok and expected.
But apart of requiring the constructor as the first declared method, I'm
against a "MUST" keyword for the remaining stuff. We can maybe suggest and
ordering of this kind, but for the most part the order shouldn't be