Make WordPress Core


Ignore:
Timestamp:
09/19/2023 12:23:16 PM (15 months ago)
Author:
costdev
Message:

Coding Standards: Replace PHP alias join() with implode().

In [52190], some new instances of the join() alias were introduced in the test suite.

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

This replaces the new join() uses with the canonical implode() function name.

Follow-up to [46182], [49193], [49805], [52190].

Props david.binda, mukesh27.
Fixes #59389.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r56612 r56616  
    553553        }
    554554
    555         $ids1_joined = join( ',', array_slice( $ids1, 0, 3 ) );
    556         $ids2_joined = join( ',', array_slice( $ids2, 3, 3 ) );
     555        $ids1_joined = implode( ',', array_slice( $ids1, 0, 3 ) );
     556        $ids2_joined = implode( ',', array_slice( $ids2, 3, 3 ) );
    557557
    558558        $blob    = <<<BLOB
     
    639639        }
    640640
    641         $imgs1_joined = join( "\n", array_slice( $imgs, 0, 3 ) );
    642         $imgs2_joined = join( "\n", array_slice( $imgs, 3, 3 ) );
     641        $imgs1_joined = implode( "\n", array_slice( $imgs, 0, 3 ) );
     642        $imgs2_joined = implode( "\n", array_slice( $imgs, 3, 3 ) );
    643643
    644644        $blob    = <<<BLOB
     
    678678        }
    679679
    680         $ids1_joined = join( ',', array_slice( $ids, 0, 3 ) );
    681         $ids2_joined = join( ',', array_slice( $ids, 3, 3 ) );
     680        $ids1_joined = implode( ',', array_slice( $ids, 0, 3 ) );
     681        $ids2_joined = implode( ',', array_slice( $ids, 3, 3 ) );
    682682
    683683        $blob    = <<<BLOB
     
    719719        }
    720720
    721         $ids1_joined  = join( "\n", array_slice( $ids, 0, 3 ) );
    722         $ids2_joined  = join( "\n", array_slice( $ids, 3, 3 ) );
    723         $imgs2_joined = join( "\n", array_slice( $imgs, 3, 3 ) );
     721        $ids1_joined  = implode( "\n", array_slice( $ids, 0, 3 ) );
     722        $ids2_joined  = implode( "\n", array_slice( $ids, 3, 3 ) );
     723        $imgs2_joined = implode( "\n", array_slice( $imgs, 3, 3 ) );
    724724
    725725        $blob    = <<<BLOB
     
    763763        }
    764764
    765         $imgs_joined = join( "\n", $imgs );
     765        $imgs_joined = implode( "\n", $imgs );
    766766
    767767        $blob    = <<<BLOB
     
    806806        }
    807807
    808         $imgs_joined = join( "\n", $imgs );
     808        $imgs_joined = implode( "\n", $imgs );
    809809
    810810        $blob    = <<<BLOB
Note: See TracChangeset for help on using the changeset viewer.