Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: add sniff to enforce the use of __DIR__ instead of dirname(__FILE__) #2137

Merged
merged 1 commit into from
Dec 8, 2022

Commits on Dec 8, 2022

  1. Core: add sniff to enforce the use of __DIR__ instead of dirname(__FI…

    …LE__)
    
    Related to previous efforts which already fixed all instances of this in WP Core.
    
    The sniff from PHPCSExtra includes an auto-fixer for the issue.
    
    Note: the sniff from PHPCSExtra also contains a check for nested `dirname()` function calls. This check is not (yet) enabled as the fix for this requires PHP 7.0+.
    
    Fixes 1954
    
    Refs:
    * PHPCSStandards/PHPCSExtra 172
    * PHPCSStandards/PHPCSExtra 187
    
    Related to WP Core tickets:
    * https://core.trac.wordpress.org/ticket/48082
    * https://core.trac.wordpress.org/changeset/47198
    jrfnl committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    73e9605 View commit details
    Browse the repository at this point in the history