Make WordPress Core

Changeset 48507


Ignore:
Timestamp:
07/18/2020 11:37:59 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/wp-db.php.

Props jenilk.
Fixes #49453.

File:
1 edited

Legend:

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

    r48200 r48507  
    968968                                $blog_id = $this->blogid;
    969969                        }
     970
    970971                        $blog_id = (int) $blog_id;
    971                         if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) ) {
     972
     973                        if ( defined( 'MULTISITE' ) && ( 0 === $blog_id || 1 === $blog_id ) ) {
    972974                                return $this->base_prefix;
    973975                        } else {
    … …  
    13151317                // If args were passed as an array (as in vsprintf), move them up.
    13161318                $passed_as_array = false;
    1317                 if ( is_array( $args[0] ) && count( $args ) == 1 ) {
     1319                if ( is_array( $args[0] ) && count( $args ) === 1 ) {
    13181320                        $passed_as_array = true;
    13191321                        $args            = $args[0];
    … …  
    19401942                }
    19411943
    1942                 if ( empty( $this->dbh ) || 2006 == $mysql_errno ) {
     1944                if ( empty( $this->dbh ) || 2006 === $mysql_errno ) {
    19431945                        if ( $this->check_connection() ) {
    19441946                                $this->_do_query( $query );
    … …  
    25982600                }
    25992601
    2600                 if ( OBJECT == $output ) {
     2602                if ( OBJECT === $output ) {
    26012603                        return $this->last_result[ $y ] ? $this->last_result[ $y ] : null;
    2602                 } elseif ( ARRAY_A == $output ) {
     2604                } elseif ( ARRAY_A === $output ) {
    26032605                        return $this->last_result[ $y ] ? get_object_vars( $this->last_result[ $y ] ) : null;
    2604                 } elseif ( ARRAY_N == $output ) {
     2606                } elseif ( ARRAY_N === $output ) {
    26052607                        return $this->last_result[ $y ] ? array_values( get_object_vars( $this->last_result[ $y ] ) ) : null;
    26062608                } elseif ( OBJECT === strtoupper( $output ) ) {
    … …  
    26762678
    26772679                $new_array = array();
    2678                 if ( OBJECT == $output ) {
     2680                if ( OBJECT === $output ) {
    26792681                        // Return an integer-keyed array of row objects.
    26802682                        return $this->last_result;
    2681                 } elseif ( OBJECT_K == $output ) {
     2683                } elseif ( OBJECT_K === $output ) {
    26822684                        // Return an array of row objects with keys from column 1.
    26832685                        // (Duplicates are discarded.)
    … …  
    26922694                        }
    26932695                        return $new_array;
    2694                 } elseif ( ARRAY_A == $output || ARRAY_N == $output ) {
     2696                } elseif ( ARRAY_A === $output || ARRAY_N === $output ) {
    26952697                        // Return an integer-keyed array of...
    26962698                        if ( $this->last_result ) {
    26972699                                foreach ( (array) $this->last_result as $row ) {
    2698                                         if ( ARRAY_N == $output ) {
     2700                                        if ( ARRAY_N === $output ) {
    26992701                                                // ...integer-keyed row arrays.
    27002702                                                $new_array[] = array_values( get_object_vars( $row ) );
    … …  
    34053407
    34063408                if ( $this->col_info ) {
    3407                         if ( -1 == $col_offset ) {
     3409                        if ( -1 === $col_offset ) {
    34083410                                $i         = 0;
    34093411                                $new_array = array();
Note: See TracChangeset for help on using the changeset viewer.