Skip to content
gossi edited this page Oct 18, 2014 · 1 revision

These are the naming conventions for objects used by the php code formatter.

Block

A block is everything between curly braces.

Entity: gossi\formatter\entities\Block

Struct

Abstract word that defines class, trait and interface.

Routine

Which is either a function or method.

Block

Everything between curly braces which is neither a Struct or Routine, something like loops, conditions, etc. (but also use blocks).

Group

A group is everything between parens.

Entity: gossi\formatter\entities\Group

Block

When a group belongs to a block, such as the conditions for an if-clause or a while statement.

Call

Whenever a function or method is invocated, this will be the respective context

Example:

$foo->bar($baz);

Group

Everything else, that is grouped within parens.

Example:

$a = $b * ($c + 5);

Unit

Units are collective statements of a specific type.

Entity: gossi\formatter\entities\Unit
Types: namespace, use, traits, fields, constants, methods, imports

Example:

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
Clone this wiki locally