22 lines
391 B
Plaintext
22 lines
391 B
Plaintext
![]() |
The PSR2 standard recommends listing modifiers in the following order to improve the readability of PHP source code:
|
||
|
|
||
|
# final or abstract
|
||
|
# public or protected or private
|
||
|
# static
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
static protected $foo;
|
||
|
...
|
||
|
public static final function bar(){...}
|
||
|
----
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
protected static $foo;
|
||
|
...
|
||
|
final public static function bar(){...}
|
||
|
----
|