---
title: "format/casts/spacing"
pagination: false
---

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

<RuleId id="format/casts/spacing" />

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

## What it does

A single space or none should be between cast and variable.

## Configuration

```toml title="pun.toml"
[format.rules]
"casts/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 |
| --- | --- | --- | --- | --- |
| `space` | `enum` | `none`, `single` | `"single"` | `space` |

## Replaces

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

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