Make WordPress Core

Changeset 56616


Ignore:
Timestamp:
09/19/2023 12:23:16 PM (13 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.

Location:
trunk/tests/phpunit/tests
Files:
2 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
  • trunk/tests/phpunit/tests/media/getPostGalleries.php

    r56548 r56616  
    576576        }
    577577
    578         $ids_joined = join( ',', $ids );
     578        $ids_joined = implode( ',', $ids );
    579579
    580580        $global_post_id = self::factory()->post->create(
     
    845845        }
    846846
    847         $ids1_joined = join( ',', array_slice( $ids, 0, 3 ) );
    848         $ids2_joined = join( ',', array_slice( $ids, 3, 3 ) );
     847        $ids1_joined = implode( ',', array_slice( $ids, 0, 3 ) );
     848        $ids2_joined = implode( ',', array_slice( $ids, 3, 3 ) );
    849849
    850850        $blob = <<<BLOB
     
    908908        }
    909909
    910         $ids1_joined = join( ',', array_slice( $ids, 0, 3 ) );
    911         $ids2_joined = join( ',', array_slice( $ids, 3, 3 ) );
     910        $ids1_joined = implode( ',', array_slice( $ids, 0, 3 ) );
     911        $ids2_joined = implode( ',', array_slice( $ids, 3, 3 ) );
    912912        $blob        = <<<BLOB
    913913[gallery ids="$ids1_joined" type="type" foo="bar"]
Note: See TracChangeset for help on using the changeset viewer.