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/post/bodyClass.php

    r48060 r49193  
    1414
    1515    public function test_body_class() {
    16         $expected = 'class="' . join( ' ', get_body_class( '', $this->post_id ) ) . '"';
     16        $expected = 'class="' . implode( ' ', get_body_class( '', $this->post_id ) ) . '"';
    1717        $this->expectOutputString( $expected );
    1818        body_class( '', $this->post_id );
     
    2222        $classes              = get_body_class( '', $this->post_id );
    2323        $escaped_again        = array_map( 'esc_attr', $classes );
    24         $escaped_another_time = 'class="' . esc_attr( join( ' ', $escaped_again ) ) . '"';
     24        $escaped_another_time = 'class="' . esc_attr( implode( ' ', $escaped_again ) ) . '"';
    2525
    2626        $this->expectOutputString( $escaped_another_time );
Note: See TracChangeset for help on using the changeset viewer.