Make WordPress Core


Ignore:
Timestamp:
09/09/2021 08:38:20 PM (3 years ago)
Author:
hellofromTonya
Message:

Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Image_Editor::save().

Renames the first parameter in WP_Image_Editor_GD::save() to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Adds parameter descriptions to parent and both child classes.

Follow-up to [22094], [22619], [30681].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.

File:
1 edited

Legend:

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

    r51717 r51790  
    7878     * @abstract
    7979     *
    80      * @param string $destfilename
    81      * @param string $mime_type
     80     * @param string $destfilename Optional. Destination filename. Default null.
     81     * @param string $mime_type    Optional. The mime-type. Default null.
    8282     * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}
    8383     */
Note: See TracChangeset for help on using the changeset viewer.