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-editor.php

    r47550 r47808  
    525525                                }
    526526
    527                                 if ( 'en' != $mce_locale && empty( $strings ) ) {
     527                                if ( 'en' !== $mce_locale && empty( $strings ) ) {
    528528                                    if ( @is_file( $path . 'en.js' ) ) {
    529529                                        $str1     = @file_get_contents( $path . 'en.js' );
     
    835835                continue;
    836836            } elseif ( ! empty( $value ) && is_string( $value ) && (
    837                 ( '{' == $value[0] && '}' == $value[ strlen( $value ) - 1 ] ) ||
    838                 ( '[' == $value[0] && ']' == $value[ strlen( $value ) - 1 ] ) ||
     837                ( '{' === $value[0] && '}' === $value[ strlen( $value ) - 1 ] ) ||
     838                ( '[' === $value[0] && ']' === $value[ strlen( $value ) - 1 ] ) ||
    839839                preg_match( '/^\(?function ?\(/', $value ) ) ) {
    840840
     
    17771777        $results = array();
    17781778        foreach ( $posts as $post ) {
    1779             if ( 'post' == $post->post_type ) {
     1779            if ( 'post' === $post->post_type ) {
    17801780                $info = mysql2date( __( 'Y/m/d' ), $post->post_date );
    17811781            } else {
Note: See TracChangeset for help on using the changeset viewer.