---
title: "format/types/declaration-spacing"
pagination: false
---

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

<RuleId id="format/types/declaration-spacing" />

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

## What it does

Ensure single space between a variable and its type declaration in function arguments and properties.

## Configuration

```toml title="pun.toml"
[format.rules]
"types/declaration-spacing" = 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 |
| --- | --- | --- | --- | --- |
| `elements` | `list` | `constant`, `function`, `property` | `["function", "property"]` | `elements` |

## Replaces

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

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