---
title: "format/types/nullable-syntax"
pagination: false
---

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

<RuleId id="format/types/nullable-syntax" />

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

## What it does

Nullable single type declaration should be standardised using configured syntax.

## Configuration

```toml title="pun.toml"
[format.rules]
"types/nullable-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 |
| --- | --- | --- | --- | --- |
| `syntax` | `enum` | `union`, `question-mark` | `"question-mark"` | `syntax` |

## Replaces

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

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