---
title: "format/operators/no-space-around-arrow"
pagination: false
---

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

<RuleId id="format/operators/no-space-around-arrow" />

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

## What it does

There should not be space before or after object operators `->` and `?->`.

## Configuration

```toml title="pun.toml"
[format.rules]
"operators/no-space-around-arrow" = true
```

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

## Replaces

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

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