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-admin/includes/class-wp-filesystem-ftpext.php

    r47122 r47219  
    575575                $lucifer[3] += 1900; // 4-digit year fix.
    576576            }
    577             $b['isdir'] = ( $lucifer[7] == '<DIR>' );
     577            $b['isdir'] = ( '<DIR>' === $lucifer[7] );
    578578            if ( $b['isdir'] ) {
    579579                $b['type'] = 'd';
     
    599599                }
    600600                $b           = array();
    601                 $b['isdir']  = $lucifer[0][0] === 'd';
    602                 $b['islink'] = $lucifer[0][0] === 'l';
     601                $b['isdir']  = 'd' === $lucifer[0][0];
     602                $b['islink'] = 'l' === $lucifer[0][0];
    603603                if ( $b['isdir'] ) {
    604604                    $b['type'] = 'd';
     
    614614                $b['group']  = $lucifer[3];
    615615                $b['size']   = $lucifer[4];
    616                 if ( $lcount == 8 ) {
     616                if ( 8 == $lcount ) {
    617617                    sscanf( $lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day'] );
    618618                    sscanf( $lucifer[6], '%d:%d', $b['hour'], $b['minute'] );
Note: See TracChangeset for help on using the changeset viewer.