Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/php-8.1

Upgrade to PHP 8.1: code a newer PHP removes, deprecates or does better.

no-closure-from-callable

Change Closure::fromCallable() to first class callable syntax

In the lint-recommended preset and every stricter one. In Rector’s rector/php81 set. Safe fix. Runs only when [php] version is 8.1 or later.

no-null-preg-split-limit

Change null to strict int defined preg_split limit arg function call argument

In the lint-recommended preset and every stricter one. In Rector’s rector/php81 set. Safe fix. Runs only when [php] version is 8.1 or later.

no-null-string-argument

Change null to strict string defined function call args

Not in any preset. Safe fix. Runs only when [php] version is 8.1 or later.

no-reflection-set-accessible

Remove Reflection::setAccessible() calls

In the lint-recommended preset and every stricter one. In Rector’s rector/php81 set. Safe fix. Runs only when [php] version is 8.1 or later.

prefer-enum-case-over-myclabs-call

Refactor MyCLabs enum fetch to Enum const

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-enum-case-over-spatie-call

Refactor Spatie enum method calls

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-enum-from

Refactor MyCLabs Enum using constructor for instantiation

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-first-class-callable

Use first-class callable syntax (strlen(...)) instead of closures, Closure::fromCallable() and string or array callables.

Not in any preset. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-first-class-callable-argument

Upgrade string callback functions to first class callable

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-first-class-callable-over-array

Upgrade array callable to first class callable

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-first-class-callable-over-arrow-function

Convert nested arrow function call to first class callable

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-first-class-callable-over-closure

Convert closure with sole nested call to first class callable

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-native-enum-over-myclabs

Refactor MyCLabs enum class to native Enum

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-native-enum-over-spatie

Refactor Spatie enum class to native Enum

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

prefer-readonly-property

Decorate read-only property with readonly attribute

In the lint-strict preset. In Rector’s rector/php81 set. Unsafe fix: it can change behavior. Runs only when [php] version is 8.1 or later.

Last updated on

Was this page helpful?