Commit 01d23a6
committed
Core/Extra: tweak the inclusion of the
Follow up on 2137
As WP Core has now dropped support for PHP < 7.0, it can start using the `dirname()` `$levels` parameters.
Think:
```php
// PHP < 7.0.
$path = dirname( dirname( dirname( __DIR__ ) ) );
// PHP 7.0+.
$path = dirname( __DIR__, 3 );
```
The `Modernize.FunctionCalls.Dirname` sniff we include also includes a check (and fixer) for that, so we can now include that sniff completely in the `Core` ruleset.
For now, I'm proposing to silence the error code related to the PHP 7.0 modernization opportunity (again) for the `Extra` ruleset as not all plugins/themes will have dropped support for PHP < 7.0 yet.
To be on the safe side, I'm explicitly excluding the whole sniff from the ruleset used for WPCS itself as WPCS still has a PHP 5.4 minimum.Modernize.FunctionCalls.Dirname sniff1 parent 2c593e4 commit 01d23a6
File tree
3 files changed
+12
-2
lines changed- WordPress-Core
- WordPress-Extra
3 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | | - | |
| 926 | + | |
| 927 | + | |
927 | 928 | | |
928 | | - | |
| 929 | + | |
929 | 930 | | |
930 | 931 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
0 commit comments