WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r47625 r47808  
    389389         * The expected return type from this filter depends on the value passed in the request query_vars.
    390390         * When `$this->query_vars['count']` is set, the filter should return the comment count as an int.
    391          * When `'ids' == $this->query_vars['fields']`, the filter should return an array of comment ids.
     391         * When `'ids' === $this->query_vars['fields']`, the filter should return an array of comment ids.
    392392         * Otherwise the filter should return an array of WP_Comment objects.
    393393         *
     
    445445        $comment_ids = array_map( 'intval', $comment_ids );
    446446
    447         if ( 'ids' == $this->query_vars['fields'] ) {
     447        if ( 'ids' === $this->query_vars['fields'] ) {
    448448            $this->comments = $comment_ids;
    449449            return $this->comments;
     
    571571        }
    572572
    573         $order = ( 'ASC' == strtoupper( $this->query_vars['order'] ) ) ? 'ASC' : 'DESC';
     573        $order = ( 'ASC' === strtoupper( $this->query_vars['order'] ) ) ? 'ASC' : 'DESC';
    574574
    575575        // Disable ORDER BY with 'none', an empty array, or boolean false.
Note: See TracChangeset for help on using the changeset viewer.