.. _functions-unusedarguments: .. _unused-parameter: Unused Parameter ++++++++++++++++ Those parameters are not used inside the method or function. Unused parameters should be removed in functions : they are dead code, and seem to offer features that they do not deliver. Some parameters are unused, due to the signature compatibility: for example, if an interface or a `parent `_ class defines that parameter, but it is not useful in the current method. Then, it must stay. This is a silent error: no `error `_ message is emitted when doing so. .. code-block:: php Connex PHP features ------------------- + `parameter `_ Suggestions ___________ * Drop the argument from the signature * Actually use that argument in the body of the method Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Functions/UnusedArguments | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-thinkphp-functions-unusedarguments`, :ref:`case-phpmyadmin-functions-unusedarguments` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Related rule | :ref:`never-called-parameter`, :ref:`could-be-class-constant` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+