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

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

Function and method declarations, calls, arguments and closures. Also in [format](/docs/rules/format/functions) (8) and [analyse](/docs/rules/analyse/functions) (16).

**[no-assign-in-argument](/docs/rules/lint/functions/no-assign-in-argument)**

Detects assignments in function call arguments which can lead to unexpected behavior and make

In the `code-quality` set. Report only. Intent: correctness.

**[no-call-user-func-method](/docs/rules/lint/functions/no-call-user-func-method)**

Refactor `call_user_func()` on known class method to a method call

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

**[no-extra-arguments](/docs/rules/lint/functions/no-extra-arguments)**

Remove extra parameters

In the `code-quality` set. Safe fix. Gated by php-version.

**[no-missing-format-argument](/docs/rules/lint/functions/no-missing-format-argument)**

Detects `sprintf`-style format calls where the number of placeholders

In the `code-quality` set. Report only. Intent: correctness.

**[no-required-after-optional](/docs/rules/lint/functions/no-required-after-optional)**

Report or fix optional parameters declared before required ones.

In the `code-quality` set. Safe fix.

**[no-swapped-explode-arguments](/docs/rules/lint/functions/no-swapped-explode-arguments)**

Detects `explode` calls whose arguments appear to be swapped.

In the `code-quality` set. Report only. Intent: correctness.

**[no-unreachable-default-argument-value](/docs/rules/lint/functions/no-unreachable-default-argument-value)**

In function arguments there must not be arguments with default values before non-default ones.

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

**[no-unused-closure-use](/docs/rules/lint/functions/no-unused-closure-use)**

Lambda must not import variables it doesn't use.

In the `dead-code` set. Safe fix.

**[no-void-reference-return](/docs/rules/lint/functions/no-void-reference-return)**

Detects functions, methods, closures, arrow functions, and set property hooks that return by reference from a void function.

In the `modernize` set. Report only.

**[require-array-filter-callback](/docs/rules/lint/functions/require-array-filter-callback)**

Requires a callback for `array_filter()`: without one it drops every falsy value, not only `null`.

In the `code-quality` set. Report only. Intent: suspicious. Upstream gates: `strictRules.strictArrayFilter`.

**[require-assert-description](/docs/rules/lint/functions/require-assert-description)**

Detects assert functions that do not have a description.

Not in any set. Report only. Intent: correctness.

**[require-strict-array-search](/docs/rules/lint/functions/require-strict-array-search)**

Makes array_search search for identical elements

In the `coding-style` set. Safe fix where types prove it, unsafe otherwise. Intent: suspicious.

**[require-strict-function-call](/docs/rules/lint/functions/require-strict-function-call)**

Requires the strict flag of `in_array()`, `array_search()`, `array_keys()` with a search value and `base64_decode()`.

In the `coding-style` set. Report only. Intent: suspicious. Upstream gates: `strictRules.strictFunctionCalls`.

**[require-strict-in-array](/docs/rules/lint/functions/require-strict-in-array)**

Set in_array strict to true when defined on similar type

In the `coding-style` set. Safe fix where types prove it, unsafe otherwise. Intent: suspicious.
