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 this 
important, and I think also that the flow of execution between methods has 
some importance in the order between them; I think that also "Clean Code" 
suggests something like "keeping near a called method".

Il giorno domenica 4 giugno 2017 15:19:38 UTC+2, Кирилл Фрейман ha scritto:
>
> Hi everyone!
>
> In PHP de-facto exists some best practice of ordering methods and 
> properties. 
> It seems to me that this order is most common:
>
> Constants
>     public const
>     protected const
>     private const
> Properties
>     public static properties
>     public properties
>     protected static properties
>     protected properties
>     private static properties
>     private properties
> Methods
>     magic methods
>     public static methods
>     public methods
>     protected static methods
>     protected methods
>     private static methods
>     private methods
>
> Should we standartize it? 
>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/30e2630a-801a-4399-a3d0-598174427b67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to