WordPress.org

Make WordPress Core

Changeset 46182


Ignore:
Timestamp:
09/19/2019 11:45:15 AM (2 months ago)
Author:
SergeyBiryukov
Message:

Tests: Replace join() with implode() in do_enclose() tests introduced in [46175], and ensure the arguments passed are in the correct order.

The implode() function accepts two parameters, $glue and $pieces. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of $glue, $pieces be used. It is also generally considered best practice to use the canonical function rather than an alias.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

Props jrf.
Fixes #36824. See #47746.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/doEnclose.php

    r46175 r46182  
    253253     */
    254254    protected function get_enclosed_by_post_id( $post_id ) {
    255         return join( (array) get_post_meta( $post_id, 'enclosure', false ), '' );
     255        return implode( '', (array) get_post_meta( $post_id, 'enclosure', false ) );
    256256    }
    257257
Note: See TracChangeset for help on using the changeset viewer.