---
title: "format/arrays/space-after-comma"
pagination: false
---

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

<RuleId id="format/arrays/space-after-comma" />

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

## What it does

In array declaration, there MUST be a whitespace after each comma.

## Configuration

```toml title="pun.toml"
[format.rules]
"arrays/space-after-comma" = 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 |
| --- | --- | --- | --- | --- |
| `ensure-single-space` | `bool` | Any | `false` | `ensure_single_space` |

## Replaces

- [`whitespace_after_comma_in_array`](https://cs.symfony.com/doc/rules/array_notation/whitespace_after_comma_in_array.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)
