---
title: "format/control-flow/no-unneeded-parentheses"
pagination: false
---

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

<RuleId id="format/control-flow/no-unneeded-parentheses" />

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

## What it does

Removes unneeded parentheses around control statements.

## Configuration

```toml title="pun.toml"
[format.rules]
"control-flow/no-unneeded-parentheses" = 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 |
| --- | --- | --- | --- | --- |
| `statements` | `list` | `break`, `clone`, `continue`, `echo-print`, `negative-instanceof`, `others`, `return`, `switch-case`, `yield`, `yield-from` | `["break", "clone", "continue", "echo-print", "return", "switch-case", "yield"]` | `statements` |

## Replaces

- [`no_unneeded_control_parentheses`](https://cs.symfony.com/doc/rules/control_structure/no_unneeded_control_parentheses.html) (php-cs-fixer)
- [`no-redundant-parentheses`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-redundant-parentheses) (mago-linter)

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