Make WordPress Core


Ignore:
Timestamp:
09/11/2023 04:51:09 AM (2 years 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/pomo/pluralForms.php

    r56549 r56552  
    4444     */
    4545    public function test_regression( $lang, $nplurals, $expression ) {
    46         require_once dirname( dirname( __DIR__ ) ) . '/includes/plural-form-function.php';
     46        require_once dirname( __DIR__, 2 ) . '/includes/plural-form-function.php';
    4747
    4848        $parenthesized = self::parenthesize_plural_expression( $expression );
Note: See TracChangeset for help on using the changeset viewer.