---
title: "rector/code-quality set"
pagination: false
---

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

Rector's `code-quality` set: the Pun lint rules its Rector rules map to, and nothing else.

```toml
[lint]
sets = ["rector/code-quality"]
```

A rule merged from several Rector rules runs only the rewrites of this set's Rector rules, unless a [preset](/docs/configuration/presets#lint-presets) also turns it on. Rector rules that are format rules in Pun run under `[format]` instead. Laravel, Pest, and PHPUnit rules also need their [extension](/docs/configuration/pun-toml#extensions).

## Rules (56)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/classes/prefer-new-self`](/docs/rules/lint/classes/prefer-new-self) | `NewStaticToNewSelfRector` | Ported |
| [`lint/classes/prefer-self-in-final`](/docs/rules/lint/classes/prefer-self-in-final) | `ConvertStaticToSelfRector` | Ported |
| [`lint/complexity/no-and-assignment`](/docs/rules/lint/complexity/no-and-assignment) | `AndAssignsToSeparateLinesRector` | Ported |
| [`lint/complexity/no-compact`](/docs/rules/lint/complexity/no-compact) | `CompactToVariablesRector` | Ported |
| [`lint/complexity/no-concat-assign-new-item`](/docs/rules/lint/complexity/no-concat-assign-new-item) | `NewArrayItemConcatAssignToAssignRector` | Ported |
| [`lint/complexity/no-constant-via-variable`](/docs/rules/lint/complexity/no-constant-via-variable) | `VariableConstFetchToClassConstFetchRector` | Ported |
| [`lint/complexity/no-dirname-dir-concat`](/docs/rules/lint/complexity/no-dirname-dir-concat) | `DirnameDirConcatStringToDirectStringPathRector` | Ported |
| [`lint/complexity/no-negated-boolean-literal`](/docs/rules/lint/complexity/no-negated-boolean-literal) | `ReplaceConstantBooleanNotRector` | Ported |
| [`lint/complexity/no-negated-group`](/docs/rules/lint/complexity/no-negated-group) | `NegatedAndsToPositiveOrsRector`, `SimplifyDeMorganBinaryRector` | Ported |
| [`lint/complexity/no-negated-instanceof-ternary`](/docs/rules/lint/complexity/no-negated-instanceof-ternary) | `FlipNegatedTernaryInstanceofRector` | Ported |
| [`lint/complexity/no-phpdoc-class-case-mismatch`](/docs/rules/lint/complexity/no-phpdoc-class-case-mismatch) | `FixClassCaseSensitivityVarDocblockRector` | Ported |
| [`lint/complexity/no-redundant-null-check`](/docs/rules/lint/complexity/no-redundant-null-check) | `SimplifyIfNotNullReturnRector`, `SimplifyIfNullableReturnRector` | Ported |
| [`lint/complexity/no-single-case-switch`](/docs/rules/lint/complexity/no-single-case-switch) | `SingularSwitchToIfRector` | Ported |
| [`lint/complexity/no-single-item-in-array`](/docs/rules/lint/complexity/no-single-item-in-array) | `SingleInArrayToCompareRector` | Ported |
| [`lint/complexity/no-sole-value-sprintf`](/docs/rules/lint/complexity/no-sole-value-sprintf) | `RemoveSoleValueSprintfRector` | Ported |
| [`lint/complexity/no-useless-array-values`](/docs/rules/lint/complexity/no-useless-array-values) | `SimplifyInArrayValuesRector` | Ported |
| [`lint/complexity/prefer-absolute-include`](/docs/rules/lint/complexity/prefer-absolute-include) | `AbsolutizeRequireAndIncludePathRector` | Ported |
| [`lint/complexity/prefer-array-literal`](/docs/rules/lint/complexity/prefer-array-literal) | `ArrayMergeOfNonArraysToSimpleArrayRector` | Ported |
| [`lint/complexity/prefer-coalesce-over-empty-ternary`](/docs/rules/lint/complexity/prefer-coalesce-over-empty-ternary) | `TernaryEmptyArrayArrayDimFetchToCoalesceRector` | Ported |
| [`lint/complexity/prefer-empty-array-compare`](/docs/rules/lint/complexity/prefer-empty-array-compare) | `SimplifyEmptyArrayCheckRector`, `SimplifyEmptyCheckOnEmptyArrayRector` | Ported |
| [`lint/complexity/prefer-explicit-array-comparison`](/docs/rules/lint/complexity/prefer-explicit-array-comparison) | `ArrayExplicitBoolCompareRector` | Ported |
| [`lint/complexity/prefer-func-num-args`](/docs/rules/lint/complexity/prefer-func-num-args) | `SimplifyFuncGetArgsCountRector` | Ported |
| [`lint/complexity/prefer-if-statement`](/docs/rules/lint/complexity/prefer-if-statement) | `InlineIfToExplicitIfRector` | Ported |
| [`lint/complexity/prefer-in-array`](/docs/rules/lint/complexity/prefer-in-array) | `ForeachToInArrayRector`, `RepeatedOrEqualToInArrayRector`, `SimplifyArraySearchRector` | Ported |
| [`lint/complexity/prefer-inline-array-return`](/docs/rules/lint/complexity/prefer-inline-array-return) | `InlineArrayReturnAssignRector` | Ported |
| [`lint/complexity/prefer-instance-method`](/docs/rules/lint/complexity/prefer-instance-method) | `LocallyCalledStaticMethodToNonStaticRector` | Ported |
| [`lint/complexity/prefer-min-max`](/docs/rules/lint/complexity/prefer-min-max) | `NumberCompareToMaxFuncCallRector` | Ported |
| [`lint/complexity/prefer-not-in-array`](/docs/rules/lint/complexity/prefer-not-in-array) | `RepeatedAndNotEqualToNotInArrayRector` | Ported |
| [`lint/complexity/prefer-null-coalesce`](/docs/rules/lint/complexity/prefer-null-coalesce) | `ArrayKeyExistsTernaryThenValueToCoalescingRector`, `ConsecutiveNullCompareReturnsToNullCoalesceQueueRector`, `SimplifyForeachToCoalescingRector` | Ported |
| [`lint/complexity/prefer-property-default`](/docs/rules/lint/complexity/prefer-property-default) | `InlineConstructorDefaultToPropertyRector` | Ported |
| [`lint/complexity/prefer-property-exists`](/docs/rules/lint/complexity/prefer-property-exists) | `IssetOnPropertyObjectToPropertyExistsRector` | Ported |
| [`lint/complexity/prefer-simple-condition`](/docs/rules/lint/complexity/prefer-simple-condition) | `BooleanNotIdenticalToNotIdenticalRector`, `SimplifyConditionsRector` | Ported |
| [`lint/complexity/require-attribute-argument-order`](/docs/rules/lint/complexity/require-attribute-argument-order) | `SortAttributeNamedArgsRector` | Ported |
| [`lint/complexity/require-consistent-return`](/docs/rules/lint/complexity/require-consistent-return) | `ExplicitReturnNullRector` | Ported |
| [`lint/complexity/require-is-a-allow-string`](/docs/rules/lint/complexity/require-is-a-allow-string) | `IsAWithStringWithThirdArgumentRector` | Ported |
| [`lint/complexity/require-named-argument-order`](/docs/rules/lint/complexity/require-named-argument-order) | `SortCallLikeNamedArgsRector` | Ported |
| [`lint/complexity/require-previous-exception`](/docs/rules/lint/complexity/require-previous-exception) | `ThrowWithPreviousExceptionRector` | Ported |
| [`lint/control-flow/no-else-after-return`](/docs/rules/lint/control-flow/no-else-after-return) | `RemoveAlwaysElseRector` | Ported |
| [`lint/control-flow/prefer-bool-return`](/docs/rules/lint/control-flow/prefer-bool-return) | `SimplifyIfReturnBoolRector` | Ported |
| [`lint/dead-code/no-implode-ternary`](/docs/rules/lint/dead-code/no-implode-ternary) | `TernaryImplodeToImplodeRector` | Ported |
| [`lint/dead-code/no-useless-ternary`](/docs/rules/lint/dead-code/no-useless-ternary) | `SimplifyTautologyTernaryRector`, `UnnecessaryTernaryExpressionRector` | Ported |
| [`lint/functions/no-extra-arguments`](/docs/rules/lint/functions/no-extra-arguments) | `RemoveExtraParametersRector` | Ported |
| [`lint/functions/no-required-after-optional`](/docs/rules/lint/functions/no-required-after-optional) | `OptionalParametersAfterRequiredRector` | Ported |
| [`lint/operators/no-and-or-keywords`](/docs/rules/lint/operators/no-and-or-keywords) | `LogicalToBooleanRector` | Ported |
| [`lint/refactor/rename-function`](/docs/rules/lint/refactor/rename-function) | `RenameFunctionRector` | Ported |
| [`lint/statements/add-safe-strict-types`](/docs/rules/lint/statements/add-safe-strict-types) | `SafeDeclareStrictTypesRector` | Ported |
| [`lint/style/no-array-push`](/docs/rules/lint/style/no-array-push) | `ChangeArrayPushToArrayAssignRector` | Ported |
| [`lint/style/no-assign-in-ternary-branch`](/docs/rules/lint/style/no-assign-in-ternary-branch) | `TernaryConditionVariableAssignmentRector` | Ported |
| [`lint/style/prefer-compound-assignment`](/docs/rules/lint/style/prefer-compound-assignment) | `CombinedAssignRector` | Ported |
| [`lint/style/prefer-early-return`](/docs/rules/lint/style/prefer-early-return) | `ChangeIfElseValueAssignToEarlyReturnRector` | Ported |
| [`lint/style/prefer-early-return-over-prepared-value`](/docs/rules/lint/style/prefer-early-return-over-prepared-value) | `PreparedValueToEarlyReturnRector` | Ported |
| [`lint/style/prefer-empty-string-compare`](/docs/rules/lint/style/prefer-empty-string-compare) | `StrlenZeroToIdenticalEmptyStringRector` | Ported |
| [`lint/types/no-nullsafe-on-non-null`](/docs/rules/lint/types/no-nullsafe-on-non-null) | `CleanupUnneededNullsafeOperatorRector` | Ported |
| [`lint/types/prefer-explicit-null-instanceof`](/docs/rules/lint/types/prefer-explicit-null-instanceof) | `ExplicitNullableObjectInstanceRector` | Ported |
| [`lint/types/prefer-identical-same-type`](/docs/rules/lint/types/prefer-identical-same-type) | `UseIdenticalOverEqualWithSameTypeRector` | Ported |
| [`lint/types/prefer-instanceof`](/docs/rules/lint/types/prefer-instanceof) | `InlineIsAInstanceOfRector` | Ported |
