---
title: "lint/classes/require-member-order"
pagination: false
---

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

<RuleId id="lint/classes/require-member-order" />

In the [`coding-style`](/docs/rules/sets/coding-style) set. Safe fix.

## What it does

Orders the elements of classes/interfaces/traits/enums.

## Configuration

```toml title="pun.toml"
[lint.rules]
"classes/require-member-order" = "error"
```

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

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `case-sensitive` | `bool` | Any | `false` | `case_sensitive` |
| `order` | `list` | Any | `["use_trait", "case", "constant_public", "constant_protected", "constant_private", "property_public", "property_protected", "property_private", "construct", "destruct", "magic", "phpunit", "method_public", "method_protected", "method_private"]` | `order` |
| `sort-algorithm` | `enum` | `none`, `alpha` | `"none"` | `sort_algorithm` |

## Replaces

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

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