.. _functions-wrongnumberofargumentsmethods: .. _wrong-number-of-arguments-in-methods: Wrong Number Of Arguments In Methods ++++++++++++++++++++++++++++++++++++ Those methods are called with a wrong number of arguments : too many or too few. Check the signature. Methods with a variable number of argument, either using ellipsis or `func_get_args() `_ are ignored. PHP emits an `error `_ at runtime, when arguments are not enough : ''. PHP doesn't emit an `error `_ when too many arguments are provided. .. code-block:: php Bar(1); // Good amount $this->Bar(1, 2); // Too Many $this->Bar(1, 2, 3); } } ?> Related PHP errors ------------------- + `Too few arguments to function Foo::Bar(), 1 passed `_ Connex PHP features ------------------- + `composer `_ Suggestions ___________ * Adapt the call to use one of the right number of arguments : this means dropping the extra ones, or adding the missing ones * Adapt the signature of the method, and use a default value Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Functions/WrongNumberOfArgumentsMethods | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+