WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/09/2020 04:52:28 PM (22 months 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/image-edit.php

    r47084 r47219  
    3434    $can_restore  = false;
    3535    if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) {
    36         $can_restore = $backup_sizes['full-orig']['file'] != wp_basename( $meta['file'] );
     36        $can_restore = wp_basename( $meta['file'] ) !== $backup_sizes['full-orig']['file'];
    3737    }
    3838
     
    577577        switch ( $operation->type ) {
    578578            case 'rotate':
    579                 if ( $operation->angle != 0 ) {
     579                if ( 0 != $operation->angle ) {
    580580                    if ( $image instanceof WP_Image_Editor ) {
    581581                        $image->rotate( $operation->angle );
     
    586586                break;
    587587            case 'flip':
    588                 if ( $operation->axis != 0 ) {
     588                if ( 0 != $operation->axis ) {
    589589                    if ( $image instanceof WP_Image_Editor ) {
    590590                        $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );
     
    955955        update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes );
    956956
    957         if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
     957        if ( 'thumbnail' === $target || 'all' === $target || 'full' === $target ) {
    958958            // Check if it's an image edit from attachment edit screen.
    959959            if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) {
Note: See TracChangeset for help on using the changeset viewer.