

Sort union types and intersection types using configured order.Ĭonverts protected variables and methods to private where possible. Trait use statements must be sorted alphabetically. Orders the interfaces in an implements or interface extends clause. Orders the elements of classes/interfaces/traits/enums. Removes final from methods where possible. Properties MUST not be explicitly initialized with null except when they have a type declaration (PHP 7.4).Ĭonvert PHP4-style constructors to _construct. There should be no empty lines after class opening brace. Whitespace around the keywords of a class, trait, enum or interfaces definition should be one space.Īll classes must be final, except abstract ones and Doctrine entities.įinal_public_method_for_abstract_class (risky)Īll public methods of abstract classes should be final. Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.Ĭlasses must be in a path that matches their namespace, be at least one namespace deep and the class name should match the file name.Įmpty body of class, interface, trait, enum or function must be abbreviated as and placed on the same line as the previous symbol, separated by a single space.Ĭlass, trait and interface elements must be separated with one or none blank line.

If a list of values separated by a comma is contained on a single line, then the last item MUST NOT have a trailing comma. There must not be more than one statement per line.
#If loop isset php code
PHP code MUST use only UTF-8 without BOM (remove BOM). Body of braces should be properly indented.Ĭurly braces must be placed as configured. The body of each structure MUST be enclosed by braces.
