Make WordPress Core

Ticket #40370: Fix incompatible declarations PHP Warnings - patch.diff

File Fix incompatible declarations PHP Warnings - patch.diff, 1.9 KB (added by davidbawiec, 4 years ago)

Fix PHP Warnings relating to incompatible declarations with WP_Image_Editor::update_crop_hash($hash = NULL).

  • wp-includes/class-wp-image-editor-gd.php

    ---
     wp-includes/class-wp-image-editor-gd.php      | 4 ++--
     wp-includes/class-wp-image-editor-imagick.php | 4 ++--
     2 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php
    index 3cc7c2ee..c3101107 100644
    a b class WP_Image_Editor_GD extends WP_Image_Editor { 
    154154         * @since 5.1.0
    155155         *
    156156         */
    157         protected function update_crop_hash( $crop, $dst_w, $dst_h ) {
     157        protected function create_crop_hash( $crop, $dst_w, $dst_h ) {
    158158                if ( ! is_array( $crop ) ) {
    159159                        return false;
    160160                }
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    218218                imagecopyresampled( $resized, $this->image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
    219219
    220220                if ( is_gd_image( $resized ) ) {
    221                         $this->update_crop_hash( $crop, $dst_w, $dst_h );
     221                        $this->create_crop_hash( $crop, $dst_w, $dst_h );
    222222                        $this->update_size( $dst_w, $dst_h );
    223223                        return $resized;
    224224                }
  • wp-includes/class-wp-image-editor-imagick.php

    diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php
    index fd817f4d..635c6819 100644
    a b class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    251251         * @since 5.1.0
    252252         *
    253253         */
    254         protected function update_crop_hash( $crop, $dst_w, $dst_h ) {
     254        protected function create_crop_hash( $crop, $dst_w, $dst_h ) {
    255255                if ( ! is_array( $crop ) ) {
    256256                        return false;
    257257                }
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    289289                list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;
    290290
    291291                if ( $crop ) {
    292                         $this->update_crop_hash( $crop, $dst_w, $dst_h );
     292                        $this->create_crop_hash( $crop, $dst_w, $dst_h );
    293293                        return $this->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h );
    294294                }
    295295