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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55642 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-04-10 12:54:28 +00:00
parent ba2f30e4dc
commit 81598dd34f
13 changed files with 18 additions and 18 deletions

View File

@@ -1169,7 +1169,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
$unicode .= $encoded_char;
$unicode_length += $encoded_char_length;
} else {
if ( count( $values ) == 0 ) {
if ( count( $values ) === 0 ) {
if ( $value < 224 ) {
$num_octets = 2;
} elseif ( $value < 240 ) {
@@ -1184,7 +1184,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
if ( $length && ( $unicode_length + ( $num_octets * 3 ) ) > $length ) {
break;
}
if ( count( $values ) == $num_octets ) {
if ( count( $values ) === $num_octets ) {
for ( $j = 0; $j < $num_octets; $j++ ) {
$unicode .= '%' . dechex( $values[ $j ] );
}
@@ -3391,7 +3391,7 @@ function wp_remove_targeted_link_rel_filters() {
function translate_smiley( $matches ) {
global $wpsmiliestrans;
if ( count( $matches ) == 0 ) {
if ( count( $matches ) === 0 ) {
return '';
}
@@ -5242,7 +5242,7 @@ function wp_sprintf_l( $pattern, $args ) {
$args = (array) $args;
$result = array_shift( $args );
if ( count( $args ) == 1 ) {
if ( count( $args ) === 1 ) {
$result .= $l['between_only_two'] . array_shift( $args );
}
@@ -5251,7 +5251,7 @@ function wp_sprintf_l( $pattern, $args ) {
while ( $i ) {
$arg = array_shift( $args );
$i--;
if ( 0 == $i ) {
if ( 0 === $i ) {
$result .= $l['between_last_two'] . $arg;
} else {
$result .= $l['between'] . $arg;