
combine_nested_dirname
¶Replace multiple nested calls of dirname
by only one call with second
$level
parameter. Requires PHP >= 7.0.
--- Original
+++ New
<?php
-dirname(dirname(dirname($path)));
+dirname($path, 3);
The rule is part of the following rule sets:
Using the @PHP70Migration:risky rule set will enable the combine_nested_dirname
rule.
Using the @PHP71Migration:risky rule set will enable the combine_nested_dirname
rule.
Using the @PHP74Migration:risky rule set will enable the combine_nested_dirname
rule.
Using the @PHP80Migration:risky rule set will enable the combine_nested_dirname
rule.
Using the @PhpCsFixer:risky rule set will enable the combine_nested_dirname
rule.
Using the @Symfony:risky rule set will enable the combine_nested_dirname
rule.