---
title: "format/phpdoc/types-order"
pagination: false
---

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

<RuleId id="format/phpdoc/types-order" />

Not in any preset. Safe fix.

## What it does

Sorts PHPDoc types.

## Configuration

```toml title="pun.toml"
[format.rules]
"phpdoc/types-order" = 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-sensitive` | `bool` | Any | `false` | `case_sensitive` |
| `null-position` | `enum` | `first`, `last`, `none` | `"first"` | `null_adjustment` |
| `sort` | `enum` | `alphabetical`, `none` | `"alphabetical"` | `sort_algorithm` |

## Replaces

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

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