Make WordPress Core


Ignore:
Timestamp:
04/10/2023 12:54:28 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where count() is involved.

Follow-up to [1636], [6974], [8114], [10322], [13326], [14760], [18006], [18541], [19743], [23249], [24115], [33359].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r55563 r55642  
    11701170            $unicode_length += $encoded_char_length;
    11711171        } else {
    1172             if ( count( $values ) == 0 ) {
     1172            if ( count( $values ) === 0 ) {
    11731173                if ( $value < 224 ) {
    11741174                    $num_octets = 2;
     
    11851185                break;
    11861186            }
    1187             if ( count( $values ) == $num_octets ) {
     1187            if ( count( $values ) === $num_octets ) {
    11881188                for ( $j = 0; $j < $num_octets; $j++ ) {
    11891189                    $unicode .= '%' . dechex( $values[ $j ] );
     
    33923392    global $wpsmiliestrans;
    33933393
    3394     if ( count( $matches ) == 0 ) {
     3394    if ( count( $matches ) === 0 ) {
    33953395        return '';
    33963396    }
     
    52435243    $args   = (array) $args;
    52445244    $result = array_shift( $args );
    5245     if ( count( $args ) == 1 ) {
     5245    if ( count( $args ) === 1 ) {
    52465246        $result .= $l['between_only_two'] . array_shift( $args );
    52475247    }
     
    52525252        $arg = array_shift( $args );
    52535253        $i--;
    5254         if ( 0 == $i ) {
     5254        if ( 0 === $i ) {
    52555255            $result .= $l['between_last_two'] . $arg;
    52565256        } else {
Note: See TracChangeset for help on using the changeset viewer.