Make WordPress Core


Ignore:
Timestamp:
09/11/2023 04:51:09 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use dirname() with the $levels parameter.

PHP 7.0 introduced the $levels parameter to the dirname() function, which means nested calls to dirname() are no longer needed.

Note: This is enforced by WPCS 3.0.0.

Reference: PHP Manual: dirname().

Follow-up to [56141].

Props jrf.
See #59161, #58831.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/filesystem/base.php

    r52010 r56552  
    2525    }
    2626    public function filter_abstraction_file( $file ) {
    27         return dirname( dirname( __DIR__ ) ) . '/includes/mock-fs.php';
     27        return dirname( __DIR__, 2 ) . '/includes/mock-fs.php';
    2828    }
    2929
Note: See TracChangeset for help on using the changeset viewer.