Make WordPress Core


Ignore:
Timestamp:
03/27/2022 02:43:25 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-plugin-upgrader.php.

While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the $return variable in Plugin_Upgrader class methods to $response and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r52986 r52997  
    478478
    479479                /**
    480                  * Filters the install response before the installation has started.
     480                 * Filters the installation response before the installation has started.
    481481                 *
    482482                 * Returning a value that could be evaluated as a `WP_Error` will effectively
     
    485485                 * @since 2.8.0
    486486                 *
    487                  * @param bool|WP_Error $response   Response.
     487                 * @param bool|WP_Error $response   Installation response.
    488488                 * @param array         $hook_extra Extra arguments passed to hooked filters.
    489489                 */
Note: See TracChangeset for help on using the changeset viewer.