UnusedFunctionParameterSniff
in package
implements
Sniff
Table of Contents
Interfaces
Constants
- MAGIC_METHODS = ['__destruct' => true, '__call' => true, '__callstatic' => true, '__get' => true, '__set' => true, '__isset' => true, '__unset' => true, '__sleep' => true, '__wakeup' => true, '__serialize' => true, '__unserialize' => true, '__tostring' => true, '__set_state' => true, '__clone' => true, '__debuginfo' => true]
- A list of all PHP magic methods with fixed method signatures.
Properties
- $ignoreTypeHints : array<string|int, mixed>
- The list of class type hints which will be ignored.
Methods
- process() : void
- Processes this test, when one of its tokens is encountered.
- register() : array<string|int, int|string>
- Returns an array of tokens this test wants to listen for.
Constants
MAGIC_METHODS
A list of all PHP magic methods with fixed method signatures.
private
array<string, true>
MAGIC_METHODS
= ['__destruct' => true, '__call' => true, '__callstatic' => true, '__get' => true, '__set' => true, '__isset' => true, '__unset' => true, '__sleep' => true, '__wakeup' => true, '__serialize' => true, '__unserialize' => true, '__tostring' => true, '__set_state' => true, '__clone' => true, '__debuginfo' => true]
Note: __construct() and __invoke() are excluded on purpose
as their method signature is not fixed.
Properties
$ignoreTypeHints
The list of class type hints which will be ignored.
public
array<string|int, mixed>
$ignoreTypeHints
= []
Methods
process()
Processes this test, when one of its tokens is encountered.
public
process(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
register()
Returns an array of tokens this test wants to listen for.
public
register() : array<string|int, int|string>