40 lines
676 B
Plaintext
40 lines
676 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
|
|
|
|
[source,php]
|
|
----
|
|
static protected $foo;
|
|
...
|
|
public static final function bar(){...}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,php]
|
|
----
|
|
protected static $foo;
|
|
...
|
|
final public static function bar(){...}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|