---
title: "format/functions/argument-spacing"
pagination: false
---

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

<RuleId id="format/functions/argument-spacing" />

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

## What it does

In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.

## Configuration

```toml title="pun.toml"
[format.rules]
"functions/argument-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 |
| --- | --- | --- | --- | --- |
| `after-heredoc` | `bool` | Any | `false` | `after_heredoc` |
| `attribute-placement` | `enum` | `ignore`, `same-line`, `standalone` | `"standalone"` | `attribute_placement` |
| `keep-multiple-spaces-after-comma` | `bool` | Any | `false` | `keep_multiple_spaces_after_comma` |
| `on-multiline` | `enum` | `ignore`, `ensure-single-line`, `ensure-fully-multiline`, `ensure-single-line-for-single-argument` | `"ensure-fully-multiline"` | `on_multiline` |

## Replaces

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

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