lint/functions
Function and method declarations, calls, arguments and closures. Also in format (8) and analyse (16).
add-attribute-argument-names
Convert positional arguments on attributes into named arguments, using the attribute constructor parameter names
Not in any preset. In Rector’s rector/named-args set. Safe fix.
add-boolean-argument-name
Add parameter names to boolean arguments.
Not in any preset. In Rector’s rector/named-args set. Unsafe fix: it can change behavior.
add-null-argument-name
Add parameter names to null arguments.
Not in any preset. In Rector’s rector/named-args set. Unsafe fix: it can change behavior.
no-assign-in-argument
Detects assignments in function call arguments. They can cause unexpected behavior and make the code harder to read.
In the lint-essential preset and every stricter one. Report only. Intent: correctness.
no-call-user-func-method
Refactor call_user_func() on known class method to a method call
In the lint-strict preset. In Rector’s rector/coding-style set. Unsafe fix: it can change behavior.
no-extra-arguments
Remove extra parameters
In the lint-recommended preset and every stricter one. In Rector’s rector/code-quality, rector/php71 sets. Safe fix. Depends on [php] version.
no-missing-format-argument
Detects sprintf-style format calls where the number of placeholders
In the lint-essential preset and every stricter one. Report only. Intent: correctness.
no-required-after-optional
Report or fix optional parameters declared before required ones.
In the lint-recommended preset and every stricter one. In Rector’s rector/code-quality, rector/php80 sets. Safe fix.
no-swapped-explode-arguments
Detects explode calls whose arguments appear to be swapped.
In the lint-essential preset and every stricter one. Report only. Intent: correctness.
no-unreachable-default-argument-value
In function arguments there must not be arguments with default values before non-default ones.
In the lint-strict preset. Unsafe fix: it can change behavior. Intent: correctness.
no-unused-closure-use
Lambda must not import variables it doesn’t use.
In the lint-essential preset and every stricter one. In Rector’s rector/dead-code set. Safe fix.
no-void-reference-return
Detects functions, methods, closures, arrow functions, and set property hooks that return by reference from a void function.
In the lint-recommended preset and every stricter one. Report only.
require-array-filter-callback
Requires a callback for array_filter(): without one it drops every falsy value, not only null.
In the lint-essential preset and every stricter one. Report only. Intent: suspicious. Upstream setting: strictRules.strictArrayFilter.
require-assert-description
Detects assert functions that do not have a description.
Not in any preset. Report only. Intent: correctness.
require-strict-array-search
Makes array_search search for identical elements
In the lint-essential preset and every stricter one. In Rector’s rector/coding-style set. Safe fix where types prove it, unsafe otherwise. Intent: suspicious.
require-strict-function-call
Requires the strict flag of in_array(), array_search(), array_keys() with a search value and base64_decode().
In the lint-essential preset and every stricter one. Report only. Intent: suspicious. Upstream setting: strictRules.strictFunctionCalls.
require-strict-in-array
Set in_array strict to true when defined on similar type
In the lint-essential preset and every stricter one. In Rector’s rector/coding-style set. Safe fix where types prove it, unsafe otherwise. Intent: suspicious.