---
title: "rector/php-sets set"
pagination: false
---

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

Rector's `withPhpSets()`: every PHP set, from `rector/php52` up to `[php] version`. This page lists the rules of all of them.

```toml
[lint]
sets = ["rector/php-sets"]
```

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 (117)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/classes/add-stringable`](/docs/rules/lint/classes/add-stringable) | `StringableForToStringRector` | Ported |
| [`lint/classes/prefer-self-in-final`](/docs/rules/lint/classes/prefer-self-in-final) | `StaticToSelfOnFinalClassRector` | Ported |
| [`lint/control-flow/no-switch-continue`](/docs/rules/lint/control-flow/no-switch-continue) | `ContinueToBreakInSwitchRector` | Ported |
| [`lint/dead-code/no-parent-call-without-parent`](/docs/rules/lint/dead-code/no-parent-call-without-parent) | `RemoveParentCallWithoutParentRector` | 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/prefer-coalesce`](/docs/rules/lint/operators/prefer-coalesce) | `TernaryToNullCoalescingRector` | Ported |
| [`lint/operators/prefer-coalesce-assign`](/docs/rules/lint/operators/prefer-coalesce-assign) | `NullCoalescingOperatorRector` | Ported |
| [`lint/php-5.3/no-http-vars`](/docs/rules/lint/php-5-3/no-http-vars) | `ReplaceHttpServerVarsByServerRector` | Ported |
| [`lint/php-5.5/no-class-magic-constant`](/docs/rules/lint/php-5-5/no-class-magic-constant) | `ClassConstantToSelfClassRector` | Ported |
| [`lint/php-5.5/prefer-self-over-get-called-class`](/docs/rules/lint/php-5-5/prefer-self-over-get-called-class) | `GetCalledClassToSelfClassRector` | Ported |
| [`lint/php-5.5/prefer-static-over-get-called-class`](/docs/rules/lint/php-5-5/prefer-static-over-get-called-class) | `GetCalledClassToStaticClassRector` | Ported |
| [`lint/php-7.0/no-call-user-method`](/docs/rules/lint/php-7-0/no-call-user-method) | `CallUserMethodRector` | Ported |
| [`lint/php-7.0/no-list-from-string`](/docs/rules/lint/php-7-0/no-list-from-string) | `ListSplitStringRector` | Ported |
| [`lint/php-7.0/prefer-braced-variable-variable`](/docs/rules/lint/php-7-0/prefer-braced-variable-variable) | `WrapVariableVariableNameInCurlyBracesRector` | Ported |
| [`lint/php-7.0/prefer-coalesce-return`](/docs/rules/lint/php-7-0/prefer-coalesce-return) | `IfIssetToCoalescingRector` | Ported |
| [`lint/php-7.0/prefer-random-int`](/docs/rules/lint/php-7-0/prefer-random-int) | `RandomFunctionRector` | Ported |
| [`lint/php-7.0/prefer-spaceship`](/docs/rules/lint/php-7-0/prefer-spaceship) | `TernaryToSpaceshipRector` | Ported |
| [`lint/php-7.0/prefer-spaceship-return`](/docs/rules/lint/php-7-0/prefer-spaceship-return) | `IfToSpaceshipRector` | Ported |
| [`lint/php-7.0/prefer-static-method-call`](/docs/rules/lint/php-7-0/prefer-static-method-call) | `ThisCallOnStaticMethodToStaticCallRector` | Ported |
| [`lint/php-7.0/prefer-throwable-handler`](/docs/rules/lint/php-7-0/prefer-throwable-handler) | `ExceptionHandlerTypehintRector` | Ported |
| [`lint/php-7.0/prefer-time`](/docs/rules/lint/php-7-0/prefer-time) | `RenameMktimeWithoutArgsToTimeRector` | Ported |
| [`lint/php-7.1/no-append-to-string`](/docs/rules/lint/php-7-1/no-append-to-string) | `AssignArrayToStringRector` | Ported |
| [`lint/php-7.1/no-non-numeric-string-operand`](/docs/rules/lint/php-7-1/no-non-numeric-string-operand) | `BinaryOpBetweenNumberAndStringRector` | Ported |
| [`lint/php-7.1/prefer-is-iterable`](/docs/rules/lint/php-7-1/prefer-is-iterable) | `IsIterableRector` | Ported |
| [`lint/php-7.1/prefer-multi-catch`](/docs/rules/lint/php-7-1/prefer-multi-catch) | `MultiExceptionCatchRector` | Ported |
| [`lint/php-7.2/no-constant-define-name`](/docs/rules/lint/php-7-2/no-constant-define-name) | `StringifyDefineRector` | Ported |
| [`lint/php-7.2/no-each`](/docs/rules/lint/php-7-2/no-each) | `ReplaceEachAssignmentWithKeyCurrentRector` | Ported |
| [`lint/php-7.2/no-get-class-null`](/docs/rules/lint/php-7-2/no-get-class-null) | `GetClassOnNullRector` | Ported |
| [`lint/php-7.2/no-list-each`](/docs/rules/lint/php-7-2/no-list-each) | `ListEachRector` | Ported |
| [`lint/php-7.2/no-string-assert`](/docs/rules/lint/php-7-2/no-string-assert) | `StringsAssertNakedRector` | Ported |
| [`lint/php-7.2/prefer-foreach-over-each`](/docs/rules/lint/php-7-2/prefer-foreach-over-each) | `WhileEachToForeachRector` | Ported |
| [`lint/php-7.2/require-parse-str-result`](/docs/rules/lint/php-7-2/require-parse-str-result) | `ParseStrWithResultArgumentRector` | Ported |
| [`lint/php-7.3/no-case-insensitive-constant`](/docs/rules/lint/php-7-3/no-case-insensitive-constant) | `SensitiveConstantNameRector` | Ported |
| [`lint/php-7.3/no-case-insensitive-define`](/docs/rules/lint/php-7-3/no-case-insensitive-define) | `SensitiveDefineRector` | Ported |
| [`lint/php-7.3/no-heredoc-label-in-body`](/docs/rules/lint/php-7-3/no-heredoc-label-in-body) | `SensitiveHereNowDocRector` | Ported |
| [`lint/php-7.3/no-unescaped-regex-dash`](/docs/rules/lint/php-7-3/no-unescaped-regex-dash) | `RegexDashEscapeRector` | Ported |
| [`lint/php-7.3/prefer-array-key-first`](/docs/rules/lint/php-7-3/prefer-array-key-first) | `ArrayKeyFirstLastRector` | Ported |
| [`lint/php-7.3/prefer-array-key-first-last`](/docs/rules/lint/php-7-3/prefer-array-key-first-last) | `ArrayKeysToArrayKeyFirstLastRector` | Ported |
| [`lint/php-7.3/prefer-is-countable`](/docs/rules/lint/php-7-3/prefer-is-countable) | `IsCountableRector` | Ported |
| [`lint/php-7.3/prefer-setcookie-options`](/docs/rules/lint/php-7-3/prefer-setcookie-options) | `SetCookieRector` | Ported |
| [`lint/php-7.3/require-string-needle`](/docs/rules/lint/php-7-3/require-string-needle) | `StringifyStrNeedlesRector` | Ported |
| [`lint/php-7.4/add-null-property-default`](/docs/rules/lint/php-7-4/add-null-property-default) | `RestoreDefaultNullToNullableTypePropertyRector` | Ported |
| [`lint/php-7.4/no-array-key-exists-on-object`](/docs/rules/lint/php-7-4/no-array-key-exists-on-object) | `ArrayKeyExistsOnPropertyRector` | Ported |
| [`lint/php-7.4/no-filter-magic-quotes`](/docs/rules/lint/php-7-4/no-filter-magic-quotes) | `FilterVarToAddSlashesRector` | Ported |
| [`lint/php-7.4/no-hebrevc`](/docs/rules/lint/php-7-4/no-hebrevc) | `HebrevcToNl2brHebrevRector` | Ported |
| [`lint/php-7.4/no-mb-strrpos-encoding-offset`](/docs/rules/lint/php-7-4/no-mb-strrpos-encoding-offset) | `MbStrrposEncodingArgumentPositionRector` | Ported |
| [`lint/php-7.4/no-money-format`](/docs/rules/lint/php-7-4/no-money-format) | `MoneyFormatToNumberFormatRector` | Ported |
| [`lint/php-7.4/no-reflection-export`](/docs/rules/lint/php-7-4/no-reflection-export) | `ExportToReflectionFunctionRector` | Ported |
| [`lint/php-7.4/no-restore-include-path`](/docs/rules/lint/php-7-4/no-restore-include-path) | `RestoreIncludePathToIniRestoreRector` | Ported |
| [`lint/php-7.4/prefer-arrow-function`](/docs/rules/lint/php-7-4/prefer-arrow-function) | `ClosureToArrowFunctionRector` | Ported |
| [`lint/php-7.4/prefer-coalesce-assign-over-if`](/docs/rules/lint/php-7-4/prefer-coalesce-assign-over-if) | `IfToNullCoalescingAssignRector` | Ported |
| [`lint/php-8.0/no-int-get-headers-format`](/docs/rules/lint/php-8-0/no-int-get-headers-format) | `GetHeadersArgumentFormatRector` | Ported |
| [`lint/php-8.0/no-unused-catch-variable`](/docs/rules/lint/php-8-0/no-unused-catch-variable) | `RemoveUnusedVariableInCatchRector` | Ported |
| [`lint/php-8.0/no-version-compare-operator-alias`](/docs/rules/lint/php-8-0/no-version-compare-operator-alias) | `VersionCompareFuncCallArgumentRector` | Ported |
| [`lint/php-8.0/prefer-get-debug-type`](/docs/rules/lint/php-8-0/prefer-get-debug-type) | `GetDebugTypeRector` | Ported |
| [`lint/php-8.0/prefer-match`](/docs/rules/lint/php-8-0/prefer-match) | `ChangeSwitchToMatchRector` | Ported |
| [`lint/php-8.0/prefer-nullsafe-over-ternary`](/docs/rules/lint/php-8-0/prefer-nullsafe-over-ternary) | `TernaryToNullsafeCoalesceRector` | Ported |
| [`lint/php-8.0/prefer-static-class`](/docs/rules/lint/php-8-0/prefer-static-class) | `ClassOnThisVariableObjectRector` | Ported |
| [`lint/php-8.0/prefer-str-ends-with`](/docs/rules/lint/php-8-0/prefer-str-ends-with) | `StrEndsWithRector` | Ported |
| [`lint/php-8.0/prefer-str-starts-with`](/docs/rules/lint/php-8-0/prefer-str-starts-with) | `StrStartsWithRector` | Ported |
| [`lint/php-8.1/no-closure-from-callable`](/docs/rules/lint/php-8-1/no-closure-from-callable) | `ClosureFromCallableToFirstClassCallableRector` | Ported |
| [`lint/php-8.1/no-null-preg-split-limit`](/docs/rules/lint/php-8-1/no-null-preg-split-limit) | `NullToStrictIntPregSlitFuncCallLimitArgRector` | Ported |
| [`lint/php-8.1/no-reflection-set-accessible`](/docs/rules/lint/php-8-1/no-reflection-set-accessible) | `RemoveReflectionSetAccessibleCallsRector` | Ported |
| [`lint/php-8.1/prefer-enum-case-over-myclabs-call`](/docs/rules/lint/php-8-1/prefer-enum-case-over-myclabs-call) | `MyCLabsMethodCallToEnumConstRector` | Ported |
| [`lint/php-8.1/prefer-enum-case-over-spatie-call`](/docs/rules/lint/php-8-1/prefer-enum-case-over-spatie-call) | `SpatieEnumMethodCallToEnumConstRector` | Ported |
| [`lint/php-8.1/prefer-enum-from`](/docs/rules/lint/php-8-1/prefer-enum-from) | `MyCLabsConstructorCallToEnumFromRector` | Ported |
| [`lint/php-8.1/prefer-first-class-callable-argument`](/docs/rules/lint/php-8-1/prefer-first-class-callable-argument) | `FunctionFirstClassCallableRector` | Ported |
| [`lint/php-8.1/prefer-first-class-callable-over-array`](/docs/rules/lint/php-8-1/prefer-first-class-callable-over-array) | `ArrayToFirstClassCallableRector` | Ported |
| [`lint/php-8.1/prefer-first-class-callable-over-arrow-function`](/docs/rules/lint/php-8-1/prefer-first-class-callable-over-arrow-function) | `ArrowFunctionDelegatingCallToFirstClassCallableRector` | Ported |
| [`lint/php-8.1/prefer-first-class-callable-over-closure`](/docs/rules/lint/php-8-1/prefer-first-class-callable-over-closure) | `ClosureDelegatingCallToFirstClassCallableRector` | Ported |
| [`lint/php-8.1/prefer-native-enum-over-myclabs`](/docs/rules/lint/php-8-1/prefer-native-enum-over-myclabs) | `MyCLabsClassToEnumRector` | Ported |
| [`lint/php-8.1/prefer-native-enum-over-spatie`](/docs/rules/lint/php-8-1/prefer-native-enum-over-spatie) | `SpatieEnumClassToEnumRector` | Ported |
| [`lint/php-8.1/prefer-readonly-property`](/docs/rules/lint/php-8-1/prefer-readonly-property) | `ReadOnlyPropertyRector` | Ported |
| [`lint/php-8.2/add-skip-dots-flag`](/docs/rules/lint/php-8-2/add-skip-dots-flag) | `FilesystemIteratorSkipDotsRector` | Ported |
| [`lint/php-8.2/no-dollar-brace-interpolation`](/docs/rules/lint/php-8-2/no-dollar-brace-interpolation) | `VariableInStringInterpolationFixerRector` | Ported |
| [`lint/php-8.2/no-utf8-encode-decode`](/docs/rules/lint/php-8-2/no-utf8-encode-decode) | `Utf8DecodeEncodeToMbConvertEncodingRector` | Ported |
| [`lint/php-8.2/prefer-readonly-class`](/docs/rules/lint/php-8-2/prefer-readonly-class) | `ReadOnlyClassRector` | Ported |
| [`lint/php-8.3/add-const-type`](/docs/rules/lint/php-8-3/add-const-type) | `AddTypeToConstRector` | Ported |
| [`lint/php-8.3/prefer-dynamic-class-constant`](/docs/rules/lint/php-8-3/prefer-dynamic-class-constant) | `DynamicClassConstFetchRector` | Ported |
| [`lint/php-8.3/prefer-json-validate`](/docs/rules/lint/php-8-3/prefer-json-validate) | `JsonValidateRector` | Ported |
| [`lint/php-8.3/prefer-ldap-uri`](/docs/rules/lint/php-8-3/prefer-ldap-uri) | `CombineHostPortLdapUriRector` | Ported |
| [`lint/php-8.3/prefer-readonly-anonymous-class`](/docs/rules/lint/php-8-3/prefer-readonly-anonymous-class) | `ReadOnlyAnonymousClassRector` | Ported |
| [`lint/php-8.3/prefer-self-class`](/docs/rules/lint/php-8-3/prefer-self-class) | `RemoveGetClassGetParentClassNoArgsRector` | Ported |
| [`lint/php-8.4/add-csv-escape-argument`](/docs/rules/lint/php-8-4/add-csv-escape-argument) | `AddEscapeArgumentRector` | Ported |
| [`lint/php-8.4/prefer-array-find`](/docs/rules/lint/php-8-4/prefer-array-find) | `ForeachToArrayAllRector`, `ForeachToArrayAnyRector`, `ForeachToArrayFindKeyRector`, `ForeachToArrayFindRector` | Ported |
| [`lint/php-8.4/prefer-round-mode-enum`](/docs/rules/lint/php-8-4/prefer-round-mode-enum) | `RoundingModeEnumRector` | Ported |
| [`lint/php-8.5/no-finfo-buffer-context`](/docs/rules/lint/php-8-5/no-finfo-buffer-context) | `RemoveFinfoBufferContextArgRector` | Ported |
| [`lint/php-8.5/no-null-array-key`](/docs/rules/lint/php-8-5/no-null-array-key) | `ArrayKeyExistsNullToEmptyStringRector` | Ported |
| [`lint/php-8.5/no-null-debug-info`](/docs/rules/lint/php-8-5/no-null-debug-info) | `NullDebugInfoReturnRector` | Ported |
| [`lint/php-8.5/no-out-of-range-chr`](/docs/rules/lint/php-8-5/no-out-of-range-chr) | `ChrArgModuloRector` | Ported |
| [`lint/php-8.5/prefer-array-first-last`](/docs/rules/lint/php-8-5/prefer-array-first-last) | `ArrayFirstLastRector` | Ported |
| [`lint/php-8.5/prefer-ord-first-byte`](/docs/rules/lint/php-8-5/prefer-ord-first-byte) | `OrdSingleByteRector` | Ported |
| [`lint/php-8.6/prefer-clamp`](/docs/rules/lint/php-8-6/prefer-clamp) | `MinMaxToClampRector` | Ported |
| [`lint/php-8.6/prefer-readonly-property-default`](/docs/rules/lint/php-8-6/prefer-readonly-property-default) | `ConstructorReadonlyAssignToDefaultRector` | Ported |
| [`lint/refactor/add-override-attribute`](/docs/rules/lint/refactor/add-override-attribute) | `AddOverrideAttributeToOverriddenPropertiesRector` | Ported |
| [`lint/refactor/remove-function-argument`](/docs/rules/lint/refactor/remove-function-argument) | `RemoveFuncCallArgRector` | Ported |
| [`lint/refactor/remove-function-call`](/docs/rules/lint/refactor/remove-function-call) | `RemoveFuncCallRector` | Ported |
| [`lint/refactor/rename-cast`](/docs/rules/lint/refactor/rename-cast) | `RenameCastRector` | Ported |
| [`lint/refactor/rename-class-constant`](/docs/rules/lint/refactor/rename-class-constant) | `RenameClassConstFetchRector` | Ported |
| [`lint/refactor/rename-constant`](/docs/rules/lint/refactor/rename-constant) | `RenameConstantRector` | Ported |
| [`lint/refactor/rename-function`](/docs/rules/lint/refactor/rename-function) | `RenameFunctionRector` | Ported |
| [`lint/refactor/rename-method`](/docs/rules/lint/refactor/rename-method) | `RenameMethodRector` | Ported |
| [`lint/refactor/replace-static-with-function`](/docs/rules/lint/refactor/replace-static-with-function) | `StaticCallToFuncCallRector` | Ported |
| [`lint/style/no-ereg`](/docs/rules/lint/style/no-ereg) | `EregToPregMatchRector` | Ported |
| [`lint/style/no-php4-constructor`](/docs/rules/lint/style/no-php4-constructor) | `Php4ConstructorRector` | Ported |
| [`lint/style/no-redundant-final`](/docs/rules/lint/style/no-redundant-final) | `FinalPrivateToPrivateVisibilityRector` | Ported |
| [`lint/style/no-sleep-wakeup`](/docs/rules/lint/style/no-sleep-wakeup) | `SleepToSerializeRector`, `WakeupToUnserializeRector` | Ported |
| [`lint/style/prefer-class-constant`](/docs/rules/lint/style/prefer-class-constant) | `StringClassNameToClassConstantRector` | Ported |
| [`lint/style/prefer-class-keyword-on-object`](/docs/rules/lint/style/prefer-class-keyword-on-object) | `ClassOnObjectRector` | Ported |
| [`lint/style/prefer-dir-constant`](/docs/rules/lint/style/prefer-dir-constant) | `DirNameFileConstantToDirConstantRector` | Ported |
| [`lint/style/prefer-dirname-levels`](/docs/rules/lint/style/prefer-dirname-levels) | `MultiDirnameRector` | Ported |
| [`lint/style/prefer-pow-operator`](/docs/rules/lint/style/prefer-pow-operator) | `PowToExpRector` | Ported |
| [`lint/style/prefer-short-ternary`](/docs/rules/lint/style/prefer-short-ternary) | `TernaryToElvisRector` | Ported |
| [`lint/style/prefer-str-contains`](/docs/rules/lint/style/prefer-str-contains) | `StrContainsRector` | Ported |
| [`lint/style/require-implode-separator`](/docs/rules/lint/style/require-implode-separator) | `ConsistentImplodeRector` | Ported |
| [`lint/types/add-never-return-type`](/docs/rules/lint/types/add-never-return-type) | `ReturnNeverTypeRector` | Ported |
