Make WordPress Core

Changeset 57917


Ignore:
Timestamp:
04/03/2024 10:31:53 AM (6 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-gd.php.

Follow-up to [22094], [22817], [50810], [57524].

Props aristath, poena, afercia, SergeyBiryukov.
See #60700.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r57900 r57917  
    6565        switch ( $mime_type ) {
    6666            case 'image/jpeg':
    67                 return ( $image_types & IMG_JPG ) != 0;
     67                return ( $image_types & IMG_JPG ) !== 0;
    6868            case 'image/png':
    69                 return ( $image_types & IMG_PNG ) != 0;
     69                return ( $image_types & IMG_PNG ) !== 0;
    7070            case 'image/gif':
    71                 return ( $image_types & IMG_GIF ) != 0;
     71                return ( $image_types & IMG_GIF ) !== 0;
    7272            case 'image/webp':
    73                 return ( $image_types & IMG_WEBP ) != 0;
     73                return ( $image_types & IMG_WEBP ) !== 0;
    7474            case 'image/avif':
    75                 return ( $image_types & IMG_AVIF ) != 0;
     75                return ( $image_types & IMG_AVIF ) !== 0;
    7676        }
    7777
     
    189189     */
    190190    public function resize( $max_w, $max_h, $crop = false ) {
    191         if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {
     191        if ( ( $this->size['width'] === $max_w ) && ( $this->size['height'] === $max_h ) ) {
    192192            return true;
    193193        }
Note: See TracChangeset for help on using the changeset viewer.