WordPress.org

Make WordPress Core

Changeset 48421


Ignore:
Timestamp:
07/10/2020 12:44:38 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in WP_List_Util::filter().

Correct comments per the documentation standards.

See #49542, #49572.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-list-util.php

    r48415 r48421  
    106106
    107107            foreach ( $args as $m_key => $m_value ) {
    108 
    109108                if ( is_array( $obj ) ) {
    110 
    111                     // Treat object as an array
     109                    // Treat object as an array.
    112110                    if ( array_key_exists( $m_key, $obj ) && ( $m_value == $obj[ $m_key ] ) ) {
    113111                        $matched++;
    114112                    }
    115113                } elseif ( is_object( $obj ) ) {
    116 
    117                     // Treat object as an object
     114                    // Treat object as an object.
    118115                    if ( isset( $obj->{$m_key} ) && ( $m_value == $obj->{$m_key} ) ) {
    119116                        $matched++;
     
    122119            }
    123120
    124             if (
    125                 ( 'AND' === $operator && $matched == $count ) ||
    126                 ( 'OR' === $operator && $matched > 0 ) ||
    127                 ( 'NOT' === $operator && 0 == $matched )
     121            if ( ( 'AND' === $operator && $matched === $count )
     122                || ( 'OR' === $operator && $matched > 0 )
     123                || ( 'NOT' === $operator && 0 === $matched )
    128124            ) {
    129125                $filtered[ $key ] = $obj;
Note: See TracChangeset for help on using the changeset viewer.