Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:25:10 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Replace alias PHP functions with the canonical names.

Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:

  • join() with implode()
  • sizeof() with count()
  • is_writeable() with is_writable()
  • doubleval() with a (float) cast

In part, this is a follow-up to #47746.

Props jrf.
See #50767.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/Autop.php

    r48937 r49193  
    338338        }
    339339
    340         $expected = join( "\n", $content );
    341         $input    = join( "\n\n", $content ); // Whitespace difference.
     340        $expected = implode( "\n", $content );
     341        $input    = implode( "\n\n", $content ); // Whitespace difference.
    342342
    343343        $this->assertSame( $expected, trim( wpautop( $input ) ) );
    344344
    345         $input = join( '', $content ); // Whitespace difference.
     345        $input = implode( '', $content ); // Whitespace difference.
    346346
    347347        $this->assertSame( $expected, trim( wpautop( $input ) ) );
     
    354354        }
    355355
    356         $expected = join( "\n", $content );
    357         $input    = join( '', $content );
     356        $expected = implode( "\n", $content );
     357        $input    = implode( '', $content );
    358358
    359359        $this->assertSame( $expected, trim( wpautop( $input ) ) );
     
    366366        }
    367367
    368         $expected = join( "\n", $content );
    369         $input    = join( '', $content );
     368        $expected = implode( "\n", $content );
     369        $input    = implode( '', $content );
    370370
    371371        $this->assertSame( $expected, trim( wpautop( $input ) ) );
     
    427427        }
    428428
    429         $content  = join( "\n\n", $content );
    430         $expected = join( "\n", $expected );
     429        $content  = implode( "\n\n", $content );
     430        $expected = implode( "\n", $expected );
    431431
    432432        $this->assertSame( $expected, trim( wpautop( $content ) ) );
Note: See TracChangeset for help on using the changeset viewer.