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

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

<RuleId id="format/classes/definition" />

In the [`format-laravel`](/docs/rules/presets/format-laravel) and [`format-psr12`](/docs/rules/presets/format-psr12) presets. Safe fix.

## What it does

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

## Configuration

```toml title="pun.toml"
[format.rules]
"classes/definition" = true
```

To skip it in some files, add a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `inline-constructor-arguments` | `bool` | Any | `true` | `inline_constructor_arguments` |
| `multi-line-extends-each-single-line` | `bool` | Any | `false` | `multi_line_extends_each_single_line` |
| `single-item-single-line` | `bool` | Any | `false` | `single_item_single_line` |
| `single-line` | `bool` | Any | `false` | `single_line` |
| `space-before-parenthesis` | `bool` | Any | `false` | `space_before_parenthesis` |

## Replaces

- [`class_definition`](https://cs.symfony.com/doc/rules/class_notation/class_definition.html) (php-cs-fixer)

[More format/classes rules](/docs/rules/format/classes) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
