In function arguments there must not be arguments with default values before non-default ones.
Modifies the signature of functions; therefore risky when using systems (such as some Symfony components) that rely on those (for example through reflection).
--- Original
+++ New
<?php
-function example($foo = "two words", $bar) {}
+function example($foo, $bar) {}
The rule is part of the following rule sets:
- @PER-CS1.0:risky
- @PER-CS2.0:risky
- @PER-CS:risky
- @PER:risky
- @PHP80Migration:risky
- @PHP82Migration:risky
- @PSR12:risky
- @PhpCsFixer:risky
- @Symfony:risky
- Fixer class: PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer
- Test class: PhpCsFixer\Tests\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.