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/src/wp-includes/formatting.php

    r49188 r49193  
    723723 */
    724724function _get_wptexturize_shortcode_regex( $tagnames ) {
    725     $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
     725    $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
    726726    $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex().
    727727    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
     
    825825    }
    826826
    827     $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) );
     827    $tagregexp = implode( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) );
    828828    $spaces    = wp_spaces_regexp();
    829829
     
    32333233
    32343234    $atts['rel']['whole'] = 'rel="' . esc_attr( $rel ) . '"';
    3235     $link_html            = join( ' ', array_column( $atts, 'whole' ) );
     3235    $link_html            = implode( ' ', array_column( $atts, 'whole' ) );
    32363236
    32373237    if ( $is_escaped ) {
     
    36973697
    36983698    // Join valid subs into the new domain.
    3699     $domain = join( '.', $new_subs );
     3699    $domain = implode( '.', $new_subs );
    37003700
    37013701    // Put the email back together.
Note: See TracChangeset for help on using the changeset viewer.