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-walker-comment.php

    r46391 r47808  
    182182        }
    183183
    184         if ( ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) && $args['short_ping'] ) {
     184        if ( ( 'pingback' === $comment->comment_type || 'trackback' === $comment->comment_type ) && $args['short_ping'] ) {
    185185            ob_start();
    186186            $this->ping( $comment, $depth, $args );
     
    217217            return;
    218218        }
    219         if ( 'div' == $args['style'] ) {
     219        if ( 'div' === $args['style'] ) {
    220220            $output .= "</div><!-- #comment-## -->\n";
    221221        } else {
     
    236236     */
    237237    protected function ping( $comment, $depth, $args ) {
    238         $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
     238        $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
    239239        ?>
    240240        <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
     
    257257     */
    258258    protected function comment( $comment, $depth, $args ) {
    259         if ( 'div' == $args['style'] ) {
     259        if ( 'div' === $args['style'] ) {
    260260            $tag       = 'div';
    261261            $add_below = 'comment';
     
    274274        ?>
    275275        <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
    276         <?php if ( 'div' != $args['style'] ) : ?>
     276        <?php if ( 'div' !== $args['style'] ) : ?>
    277277        <div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
    278278        <?php endif; ?>
     
    335335        ?>
    336336
    337         <?php if ( 'div' != $args['style'] ) : ?>
     337        <?php if ( 'div' !== $args['style'] ) : ?>
    338338        </div>
    339339        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.