---
title: "format/casing/constants"
pagination: false
---

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

<RuleId id="format/casing/constants" />

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

## What it does

The PHP constants `true`, `false`, and `null` MUST be written using the correct casing.

## Configuration

```toml title="pun.toml"
[format.rules]
"casing/constants" = 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 |
| --- | --- | --- | --- | --- |
| `case` | `enum` | `upper`, `lower` | `"lower"` | `case` |

## Replaces

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

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