Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule no_unreachable_default_argument_value

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

Warning

Using this rule is risky

Modifies the signature of functions; therefore risky when using systems (such as some Symfony components) that rely on those (for example through reflection).

Examples

Example #1

--- Original
+++ New
 <?php
-function example($foo = "two words", $bar) {}
+function example($foo, $bar) {}
The logo is © 2010-2022 Sensio Labs