---
title: "format/arrays/syntax"
pagination: false
---

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

<RuleId id="format/arrays/syntax" />

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

## What it does

PHP arrays should be declared using the configured syntax.

## Configuration

```toml title="pun.toml"
[format.rules]
"arrays/syntax" = 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 |
| --- | --- | --- | --- | --- |
| `syntax` | `enum` | `long`, `short` | `"short"` | `syntax` |

## Replaces

- [`array_syntax`](https://cs.symfony.com/doc/rules/array_notation/array_syntax.html) (php-cs-fixer)
- [`array-style`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#array-style) (mago-linter)

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