---
title: "lint/refactor"
pagination: false
---

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

Configurable codemods: they do nothing until configured.

**[add-override-attribute](/docs/rules/lint/refactor/add-override-attribute)**

Add #[Override] to properties that override a parent class's property (PHP 8.5).

Not in any set. Unsafe fix: it can change behaviour.

**[no-negated-condition](/docs/rules/lint/refactor/no-negated-condition)**

Flip a ternary whose condition is negated: drop the `!` (or use `===` / `==`) and swap the branches.

In the `code-quality` set. Unsafe fix: it can change behaviour.

**[prefer-attribute-over-annotation](/docs/rules/lint/refactor/prefer-attribute-over-annotation)**

Replace configured PHPDoc annotations (including nested ones) with attributes.

Not in any set. Unsafe fix: it can change behaviour.

**[prefer-constant](/docs/rules/lint/refactor/prefer-constant)**

Replace function calls that return a constant (php_sapi_name(), pi(), ...) with the constant.

In the `coding-style` set. Unsafe fix: it can change behaviour.

**[remove-attribute](/docs/rules/lint/refactor/remove-attribute)**

Removes configured attributes by their respective FQN.

Not in any set. Safe fix.

**[remove-function-argument](/docs/rules/lint/refactor/remove-function-argument)**

Remove argument by position by function name

Not in any set. Unsafe fix: it can change behaviour.

**[remove-function-call](/docs/rules/lint/refactor/remove-function-call)**

Remove defined function calls

Not in any set. Unsafe fix: it can change behaviour.

**[remove-phpdoc-annotation](/docs/rules/lint/refactor/remove-phpdoc-annotation)**

Removes configured annotations from PHPDoc.

Not in any set. Safe fix.

**[rename-cast](/docs/rules/lint/refactor/rename-cast)**

Renames casts

Not in any set. Unsafe fix: it can change behaviour.

**[rename-class](/docs/rules/lint/refactor/rename-class)**

Replace defined classes by new ones

Not in any set. Unsafe fix: it can change behaviour. Gated by laravel-version.

**[rename-class-constant](/docs/rules/lint/refactor/rename-class-constant)**

Replace defined class constants in their calls

Not in any set. Unsafe fix: it can change behaviour.

**[rename-constant](/docs/rules/lint/refactor/rename-constant)**

Replace constant by new ones

Not in any set. Unsafe fix: it can change behaviour.

**[rename-function](/docs/rules/lint/refactor/rename-function)**

Turn defined function call new one

Not in any set. Unsafe fix: it can change behaviour. Gated by laravel-version.

**[rename-method](/docs/rules/lint/refactor/rename-method)**

Turn method names to new ones

Not in any set. Unsafe fix: it can change behaviour. Gated by laravel-version.

**[rename-phpdoc-tag](/docs/rules/lint/refactor/rename-phpdoc-tag)**

Renames PHPDoc tags.

Not in any set. Safe fix.

**[replace-function-with-constant](/docs/rules/lint/refactor/replace-function-with-constant)**

Changes use of function calls to use constants

Not in any set. Unsafe fix: it can change behaviour.

**[replace-function-with-new](/docs/rules/lint/refactor/replace-function-with-new)**

Change configured function calls to new Instance

Not in any set. Unsafe fix: it can change behaviour.

**[replace-function-with-static](/docs/rules/lint/refactor/replace-function-with-static)**

Turn defined function call to static method call

Not in any set. Unsafe fix: it can change behaviour.

**[replace-static-with-method](/docs/rules/lint/refactor/replace-static-with-method)**

Change static call to service method via constructor injection

Not in any set. Unsafe fix: it can change behaviour.
