Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda conditions where appropriate.

See #49222.

File:
1 edited

Legend:

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

    r47198 r47219  
    256256                        case 'from':
    257257                            $bracket_pos = strpos( $content, '<' );
    258                             if ( $bracket_pos !== false ) {
     258                            if ( false !== $bracket_pos ) {
    259259                                // Text before the bracketed email is the "From" name.
    260260                                if ( $bracket_pos > 0 ) {
     
    539539        $user = apply_filters( 'authenticate', null, $username, $password );
    540540
    541         if ( $user == null ) {
     541        if ( null == $user ) {
    542542            // TODO: What should the error message be? (Or would these even happen?)
    543543            // Only needed if all authentication handlers fail to return anything.
     
    14661466        $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
    14671467
    1468         if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts ) && $lp['host'] != strtolower( $wpp['host'] ) ) ) {
     1468        if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) {
    14691469            $location = $default;
    14701470        }
     
    15451545
    15461546        // The author moderated a comment on their own post.
    1547         if ( $author && ! $notify_author && $post->post_author == get_current_user_id() ) {
     1547        if ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) {
    15481548            unset( $emails[ $author->user_email ] );
    15491549        }
     
    19581958     */
    19591959    function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
    1960         if ( $deprecated !== null ) {
     1960        if ( null !== $deprecated ) {
    19611961            _deprecated_argument( __FUNCTION__, '4.3.1' );
    19621962        }
     
    25282528
    25292529        // Reduce the value to be within the min - max range.
    2530         if ( $max != 0 ) {
     2530        if ( 0 != $max ) {
    25312531            $value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
    25322532        }
Note: See TracChangeset for help on using the changeset viewer.