---
title: "format/classes"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Class, interface, trait and enum declarations and their members. Also in [lint](/docs/rules/lint/classes) (15) and [analyse](/docs/rules/analyse/classes) (64).

**[definition](/docs/rules/format/classes/definition)**

Whitespace around the keywords of a class, trait, enum or interfaces definition should be one space.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[member-separation](/docs/rules/format/classes/member-separation)**

Class, trait and interface elements must be separated with one or none blank line.

In the `format-laravel` preset. Safe fix.

**[modifier-keywords](/docs/rules/format/classes/modifier-keywords)**

Classes, constants, properties, and methods MUST have visibility declared, and keyword modifiers MUST be in the following order: inheritance modifier (`abstract` or `final`), visibility modifier (`public`, `protected`, or `private`), set-visibility modifier (`public(set)`, `protected(set)`, or `private(set)`), scope modifier (`static`), mutation modifier (`readonly`), type declaration, name.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[multiline-promoted-properties](/docs/rules/format/classes/multiline-promoted-properties)**

Promoted properties must be on separate lines.

Not in any preset. Safe fix.

**[no-blank-line-after-opening](/docs/rules/format/classes/no-blank-line-after-opening)**

There should be no empty lines after class opening brace.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[ordered-interfaces](/docs/rules/format/classes/ordered-interfaces)**

Orders the interfaces in an `implements` or `interface extends` clause.

In the `format-laravel` preset. Safe fix.

**[single-member-per-statement](/docs/rules/format/classes/single-member-per-statement)**

There MUST NOT be more than one property or constant declared per statement.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[single-trait-per-statement](/docs/rules/format/classes/single-trait-per-statement)**

Each trait `use` must be done as single statement.

In the `format-psr12` preset. Safe fix.
