---
title: "format/arrays/trim-spaces"
pagination: false
---

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

<RuleId id="format/arrays/trim-spaces" />

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

## What it does

Arrays should be formatted like function/method arguments, without leading or trailing single line space.

## Configuration

```toml title="pun.toml"
[format.rules]
"arrays/trim-spaces" = true
```

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

## Replaces

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

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