---
title: "format/control-flow/no-alternative-syntax"
pagination: false
---

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

<RuleId id="format/control-flow/no-alternative-syntax" />

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

## What it does

Replace control structure alternative syntax to use braces.

## Configuration

```toml title="pun.toml"
[format.rules]
"control-flow/no-alternative-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 |
| --- | --- | --- | --- | --- |
| `fix-non-monolithic-code` | `bool` | Any | `true` | `fix_non_monolithic_code` |

## Replaces

- [`no_alternative_syntax`](https://cs.symfony.com/doc/rules/control_structure/no_alternative_syntax.html) (php-cs-fixer)
- [`AlternativeIfToBracket`](https://getrector.com/rule-detail/alternative-if-to-bracket-rector) (rector)
- [`no-alternative-syntax`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-alternative-syntax) (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)
