Method Declarations

Method names should not be prefixed with an underscore to indicate visibility. The static keyword, when present, should come after the visibility declaration, and the final and abstract keywords should come before.

Valid: Correct method naming.

class Foo { private function <em>bar</em>() { } }

Invalid: An underscore prefix used to indicate visibility.

class Foo { private function <em>_bar</em>() { } }

Valid: Correct ordering of method prefixes.

class Foo { <em>final public static</em> function <em>bar</em>() { } }

Invalid: static keyword used before visibility and final used after.

class Foo { <em>static public final</em> function <em>bar</em>() { } }