---
title: "format/control-flow/switch-case-colon"
pagination: false
---

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

<RuleId id="format/control-flow/switch-case-colon" />

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

## What it does

A case should be followed by a colon and not a semicolon.

## Configuration

```toml title="pun.toml"
[format.rules]
"control-flow/switch-case-colon" = true
```

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

## Replaces

- [`switch_case_semicolon_to_colon`](https://cs.symfony.com/doc/rules/control_structure/switch_case_semicolon_to_colon.html) (php-cs-fixer)
- [`ColonAfterSwitchCase`](https://getrector.com/rule-detail/colon-after-switch-case-rector) (rector)
- [`deprecated-switch-semicolon`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#deprecated-switch-semicolon) (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)
