Make WordPress Core

Changeset 34566


Ignore:
Timestamp:
09/25/2015 11:57:46 PM (10 years ago)
Author:
johnbillion
Message:

callback is not a valid type in PHP, PSR-5, or phpDocumentor. callable should be used instead.

Fixes #34032

Location:
trunk/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-background.php

    r34490 r34566  
    1919     * Callback for administration header.
    2020     *
    21      * @var callback
     21     * @var callable
    2222     * @since 3.0.0
    2323     */
     
    2727     * Callback for header div.
    2828     *
    29      * @var callback
     29     * @var callable
    3030     * @since 3.0.0
    3131     */
     
    4545     *
    4646     * @since 3.0.0
    47      * @param callback $admin_header_callback
    48      * @param callback $admin_image_div_callback Optional custom image div output callback.
     47     * @param callable $admin_header_callback
     48     * @param callable $admin_image_div_callback Optional custom image div output callback.
    4949     */
    5050    public function __construct($admin_header_callback = '', $admin_image_div_callback = '') {
  • trunk/src/wp-admin/custom-header.php

    r34491 r34566  
    1919     * Callback for administration header.
    2020     *
    21      * @var callback
     21     * @var callable
    2222     * @since 2.1.0
    2323     */
     
    2727     * Callback for header div.
    2828     *
    29      * @var callback
     29     * @var callable
    3030     * @since 3.0.0
    3131     */
     
    5454     *
    5555     * @since 2.1.0
    56      * @param callback $admin_header_callback
    57      * @param callback $admin_image_div_callback Optional custom image div output callback.
     56     * @param callable $admin_header_callback
     57     * @param callable $admin_image_div_callback Optional custom image div output callback.
    5858     */
    5959    public function __construct($admin_header_callback, $admin_image_div_callback = '') {
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r34543 r34566  
    21482148     *
    21492149     * @global WP_Filesystem_Base $wp_filesystem Subclass
    2150      * @global callback           $_wp_filesystem_direct_method
     2150     * @global callable           $_wp_filesystem_direct_method
    21512151     *
    21522152     * @param object $current Response object for whether WordPress is current.
  • trunk/src/wp-admin/includes/dashboard.php

    r34565 r34566  
    136136 * @param string   $widget_id
    137137 * @param string   $widget_name
    138  * @param callback $callback
    139  * @param callback $control_callback
     138 * @param callable $callback
     139 * @param callable $control_callback
    140140 * @param array    $callback_args
    141141 */
     
    887887 *
    888888 * @param string $widget_id
    889  * @param callback $callback
     889 * @param callable $callback
    890890 * @param array $check_urls RSS feeds
    891891 * @return bool False on failure. True on success.
  • trunk/src/wp-admin/includes/file.php

    r34348 r34566  
    910910 * @since 2.5.0
    911911 *
    912  * @global callback $_wp_filesystem_direct_method
     912 * @global callable $_wp_filesystem_direct_method
    913913 *
    914914 * @param array  $args                         Optional. Connection details. Default empty array.
  • trunk/src/wp-admin/includes/import.php

    r32655 r34566  
    4949 * @param string   $name        Importer name and title.
    5050 * @param string   $description Importer description.
    51  * @param callback $callback    Callback to run.
     51 * @param callable $callback    Callback to run.
    5252 * @return WP_Error Returns WP_Error when $callback is WP_Error.
    5353 */
  • trunk/src/wp-admin/includes/meta-boxes.php

    r34364 r34566  
    346346 *     @type string   $id       Meta box ID.
    347347 *     @type string   $title    Meta box title.
    348  *     @type callback $callback Meta box display callback.
     348 *     @type callable $callback Meta box display callback.
    349349 *     @type array    $args     Extra meta box arguments.
    350350 * }
     
    387387 *     @type string   $id       Meta box ID.
    388388 *     @type string   $title    Meta box title.
    389  *     @type callback $callback Meta box display callback.
     389 *     @type callable $callback Meta box display callback.
    390390 *     @type array    $args {
    391391 *         Extra meta box arguments.
     
    443443 *     @type string   $id       Meta box ID.
    444444 *     @type string   $title    Meta box title.
    445  *     @type callback $callback Meta box display callback.
     445 *     @type callable $callback Meta box display callback.
    446446 *     @type array    $args {
    447447 *         Extra meta box arguments.
  • trunk/src/wp-admin/includes/plugin.php

    r34314 r34566  
    10151015 * @param string $capability The capability required for this menu to be displayed to the user.
    10161016 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1017  * @param callback $function The function to be called to output the content for this page.
     1017 * @param callable $function The function to be called to output the content for this page.
    10181018 * @param string $icon_url The url to the icon to be used for this menu.
    10191019 *     * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
     
    10751075 * @param string $capability The capability required for this menu to be displayed to the user.
    10761076 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1077  * @param callback $function The function to be called to output the content for this page.
     1077 * @param callable $function The function to be called to output the content for this page.
    10781078 * @param string $icon_url The url to the icon to be used for this menu
    10791079 *
     
    11031103 * @param string $capability The capability required for this menu to be displayed to the user.
    11041104 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1105  * @param callback $function The function to be called to output the content for this page.
     1105 * @param callable $function The function to be called to output the content for this page.
    11061106 * @param string $icon_url The url to the icon to be used for this menu
    11071107 *
     
    11371137 * @param string $capability The capability required for this menu to be displayed to the user.
    11381138 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1139  * @param callback $function The function to be called to output the content for this page.
     1139 * @param callable $function The function to be called to output the content for this page.
    11401140 *
    11411141 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    12031203 * @param string $capability The capability required for this menu to be displayed to the user.
    12041204 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1205  * @param callback $function The function to be called to output the content for this page.
     1205 * @param callable $function The function to be called to output the content for this page.
    12061206 *
    12071207 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    12241224 * @param string $capability The capability required for this menu to be displayed to the user.
    12251225 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1226  * @param callback $function The function to be called to output the content for this page.
     1226 * @param callable $function The function to be called to output the content for this page.
    12271227 *
    12281228 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    12451245 * @param string $capability The capability required for this menu to be displayed to the user.
    12461246 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1247  * @param callback $function The function to be called to output the content for this page.
     1247 * @param callable $function The function to be called to output the content for this page.
    12481248 *
    12491249 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    12661266 * @param string $capability The capability required for this menu to be displayed to the user.
    12671267 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1268  * @param callback $function The function to be called to output the content for this page.
     1268 * @param callable $function The function to be called to output the content for this page.
    12691269 *
    12701270 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    12871287 * @param string $capability The capability required for this menu to be displayed to the user.
    12881288 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1289  * @param callback $function The function to be called to output the content for this page.
     1289 * @param callable $function The function to be called to output the content for this page.
    12901290 *
    12911291 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    13111311 * @param string $capability The capability required for this menu to be displayed to the user.
    13121312 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1313  * @param callback $function The function to be called to output the content for this page.
     1313 * @param callable $function The function to be called to output the content for this page.
    13141314 *
    13151315 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    13321332 * @param string $capability The capability required for this menu to be displayed to the user.
    13331333 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1334  * @param callback $function The function to be called to output the content for this page.
     1334 * @param callable $function The function to be called to output the content for this page.
    13351335 *
    13361336 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    13531353 * @param string $capability The capability required for this menu to be displayed to the user.
    13541354 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1355  * @param callback $function The function to be called to output the content for this page.
     1355 * @param callable $function The function to be called to output the content for this page.
    13561356 *
    13571357 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    13741374 * @param string $capability The capability required for this menu to be displayed to the user.
    13751375 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1376  * @param callback $function The function to be called to output the content for this page.
     1376 * @param callable $function The function to be called to output the content for this page.
    13771377 *
    13781378 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    13951395 * @param string $capability The capability required for this menu to be displayed to the user.
    13961396 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1397  * @param callback $function The function to be called to output the content for this page.
     1397 * @param callable $function The function to be called to output the content for this page.
    13981398 *
    13991399 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
     
    14161416 * @param string $capability The capability required for this menu to be displayed to the user.
    14171417 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
    1418  * @param callback $function The function to be called to output the content for this page.
     1418 * @param callable $function The function to be called to output the content for this page.
    14191419 *
    14201420 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required.
  • trunk/src/wp-admin/includes/template-functions.php

    r34427 r34566  
    851851 * @param string           $id            String for use in the 'id' attribute of tags.
    852852 * @param string           $title         Title of the meta box.
    853  * @param callback         $callback      Function that fills the box with the desired content.
     853 * @param callable         $callback      Function that fills the box with the desired content.
    854854 *                                        The function should echo its output.
    855855 * @param string|WP_Screen $screen        Optional. The screen on which to show the box (like a post
  • trunk/src/wp-includes/SimplePie/Parse/Date.php

    r22798 r34566  
    614614     * @final
    615615     * @access public
    616      * @param callback $callback
     616     * @param callable $callback
    617617     */
    618618    public function add_callback($callback)
  • trunk/src/wp-includes/deprecated.php

    r33969 r34566  
    20812081 *
    20822082 * @param string|int $name Widget ID.
    2083  * @param callback $output_callback Run when widget is called.
     2083 * @param callable $output_callback Run when widget is called.
    20842084 * @param string $classname Classname widget option.
    20852085 * @param mixed $params ,... Widget parameters.
     
    21362136 *
    21372137 * @param int|string $name Sidebar ID.
    2138  * @param callback $control_callback Widget control callback to display and process form.
     2138 * @param callable $control_callback Widget control callback to display and process form.
    21392139 * @param int $width Widget width.
    21402140 * @param int $height Widget height.
     
    29292929 * @see add_theme_support()
    29302930 *
    2931  * @param callback $wp_head_callback Call on 'wp_head' action.
    2932  * @param callback $admin_head_callback Call on custom header administration screen.
    2933  * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
     2931 * @param callable $wp_head_callback Call on 'wp_head' action.
     2932 * @param callable $admin_head_callback Call on custom header administration screen.
     2933 * @param callable $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
    29342934 */
    29352935function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
     
    29652965 * @see add_theme_support()
    29662966 *
    2967  * @param callback $wp_head_callback Call on 'wp_head' action.
    2968  * @param callback $admin_head_callback Call on custom background administration screen.
    2969  * @param callback $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
     2967 * @param callable $wp_head_callback Call on 'wp_head' action.
     2968 * @param callable $admin_head_callback Call on custom background administration screen.
     2969 * @param callable $admin_preview_callback Output a custom background image div on the custom background administration screen. Optional.
    29702970 */
    29712971function add_custom_background( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
  • trunk/src/wp-includes/functions.php

    r34512 r34566  
    18741874 * @param string   $dir                      Directory.
    18751875 * @param string   $filename                 File name.
    1876  * @param callback $unique_filename_callback Callback. Default null.
     1876 * @param callable $unique_filename_callback Callback. Default null.
    18771877 * @return string New filename, if given wasn't unique.
    18781878 */
     
    23962396         * @since 3.4.0
    23972397         *
    2398          * @param callback $function Callback function name.
     2398         * @param callable $function Callback function name.
    23992399         */
    24002400        $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
     
    24052405         * @since 3.4.0
    24062406         *
    2407          * @param callback $function Callback function name.
     2407         * @param callable $function Callback function name.
    24082408         */
    24092409        $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
     
    24142414         * @since 3.0.0
    24152415         *
    2416          * @param callback $function Callback function name.
     2416         * @param callable $function Callback function name.
    24172417         */
    24182418        $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
     
    44764476 * @access private
    44774477 *
    4478  * @param callback $callback      Function that accepts ( ID, $callback_args ) and outputs parent_ID.
     4478 * @param callable $callback      Function that accepts ( ID, $callback_args ) and outputs parent_ID.
    44794479 * @param int      $start         The ID to start the loop check at.
    44804480 * @param int      $start_parent  The parent_ID of $start to use instead of calling $callback( $start ).
     
    45014501 * @access private
    45024502 *
    4503  * @param callback $callback      Function that accepts ( ID, callback_arg, ... ) and outputs parent_ID.
     4503 * @param callable $callback      Function that accepts ( ID, callback_arg, ... ) and outputs parent_ID.
    45044504 * @param int      $start         The ID to start the loop check at.
    45054505 * @param array    $override      Optional. An array of ( ID => parent_ID, ... ) to use instead of $callback.
  • trunk/src/wp-includes/media.php

    r34472 r34566  
    21882188 * @param string   $id       An internal ID/name for the handler. Needs to be unique.
    21892189 * @param string   $regex    The regex that will be used to see if this handler should be used for a URL.
    2190  * @param callback $callback The callback function that will be called if the regex is matched.
     2190 * @param callable $callback The callback function that will be called if the regex is matched.
    21912191 * @param int      $priority Optional. Used to specify the order in which the registered handlers will
    21922192 *                           be tested. Default 10.
     
    23742374     * @since 3.6.0
    23752375     *
    2376      * @param callback $handler Audio embed handler callback function.
     2376     * @param callable $handler Audio embed handler callback function.
    23772377     */
    23782378    wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
     
    23832383     * @since 3.6.0
    23842384     *
    2385      * @param callback $handler Video embed handler callback function.
     2385     * @param callable $handler Video embed handler callback function.
    23862386     */
    23872387    wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
  • trunk/src/wp-includes/nav-menu-template.php

    r34507 r34566  
    220220 *     @type string        $container_class Class that is applied to the container. Default 'menu-{menu slug}-container'.
    221221 *     @type string        $container_id    The ID that is applied to the container. Default empty.
    222  *     @type callback|bool $fallback_cb     If the menu doesn't exists, a callback function will fire.
     222 *     @type callable|bool $fallback_cb     If the menu doesn't exists, a callback function will fire.
    223223 *                                          Default is 'wp_page_menu'. Set to false for no fallback.
    224224 *     @type string        $before          Text before the link text. Default empty.
  • trunk/src/wp-includes/plugin.php

    r34288 r34566  
    9292 *
    9393 * @param string   $tag             The name of the filter to hook the $function_to_add callback to.
    94  * @param callback $function_to_add The callback to be run when the filter is applied.
     94 * @param callable $function_to_add The callback to be run when the filter is applied.
    9595 * @param int      $priority        Optional. Used to specify the order in which the functions
    9696 *                                  associated with a particular action are executed. Default 10.
     
    118118 *
    119119 * @param string        $tag               The name of the filter hook.
    120  * @param callback|bool $function_to_check Optional. The callback to check for. Default false.
     120 * @param callable|bool $function_to_check Optional. The callback to check for. Default false.
    121121 * @return false|int If $function_to_check is omitted, returns boolean for whether the hook has
    122122 *                   anything registered. When checking a specific function, the priority of that
     
    315315 *
    316316 * @param string   $tag                The filter hook to which the function to be removed is hooked.
    317  * @param callback $function_to_remove The name of the function which should be removed.
     317 * @param callable $function_to_remove The name of the function which should be removed.
    318318 * @param int      $priority           Optional. The priority of the function. Default 10.
    319319 * @return bool    Whether the function existed before it was removed.
     
    446446 *
    447447 * @param string   $tag             The name of the action to which the $function_to_add is hooked.
    448  * @param callback $function_to_add The name of the function you wish to be called.
     448 * @param callable $function_to_add The name of the function you wish to be called.
    449449 * @param int      $priority        Optional. Used to specify the order in which the functions
    450450 *                                  associated with a particular action are executed. Default 10.
     
    614614 *
    615615 * @param string        $tag               The name of the action hook.
    616  * @param callback|bool $function_to_check Optional. The callback to check for. Default false.
     616 * @param callable|bool $function_to_check Optional. The callback to check for. Default false.
    617617 * @return bool|int If $function_to_check is omitted, returns boolean for whether the hook has
    618618 *                  anything registered. When checking a specific function, the priority of that
     
    636636 *
    637637 * @param string   $tag                The action hook to which the function to be removed is hooked.
    638  * @param callback $function_to_remove The name of the function which should be removed.
     638 * @param callable $function_to_remove The name of the function which should be removed.
    639639 * @param int      $priority           Optional. The priority of the function. Default 10.
    640640 * @return bool Whether the function is removed.
     
    772772 *
    773773 * @param string   $file     The filename of the plugin including the path.
    774  * @param callback $function The function hooked to the 'activate_PLUGIN' action.
     774 * @param callable $function The function hooked to the 'activate_PLUGIN' action.
    775775 */
    776776function register_activation_hook($file, $function) {
     
    795795 *
    796796 * @param string   $file     The filename of the plugin including the path.
    797  * @param callback $function The function hooked to the 'deactivate_PLUGIN' action.
     797 * @param callable $function The function hooked to the 'deactivate_PLUGIN' action.
    798798 */
    799799function register_deactivation_hook($file, $function) {
     
    825825 *
    826826 * @param string   $file     Plugin file.
    827  * @param callback $callback The callback to run when the hook is called. Must be
     827 * @param callable $callback The callback to run when the hook is called. Must be
    828828 *                           a static method or function.
    829829 */
     
    901901 *
    902902 * @param string   $tag      Used in counting how many hooks were applied
    903  * @param callback $function Used for creating unique id
     903 * @param callable $function Used for creating unique id
    904904 * @param int|bool $priority Used in counting how many hooks were applied. If === false
    905905 *                           and $function is an object reference, we return the unique
  • trunk/src/wp-includes/post-functions.php

    r34513 r34566  
    941941 *     @type array       $supports             An alias for calling {@see add_post_type_support()} directly.
    942942 *                                             Defaults to array containing 'title' & 'editor'.
    943  *     @type callback    $register_meta_box_cb Provide a callback function that sets up the meta boxes for the
     943 *     @type callable    $register_meta_box_cb Provide a callback function that sets up the meta boxes for the
    944944 *                                             edit form. Do remove_meta_box() and add_meta_box() calls in the
    945945 *                                             callback. Default null.
  • trunk/src/wp-includes/rewrite-functions.php

    r34492 r34566  
    8787 *
    8888 * @param string   $feedname
    89  * @param callback $function Callback to run on feed display.
     89 * @param callable $function Callback to run on feed display.
    9090 * @return string Feed action name.
    9191 */
  • trunk/src/wp-includes/widget-functions.php

    r34465 r34566  
    223223 * @param int|string $id              Widget ID.
    224224 * @param string     $name            Widget display title.
    225  * @param callback   $output_callback Run when widget is called.
     225 * @param callable   $output_callback Run when widget is called.
    226226 * @param array      $options {
    227227 *     Optional. An array of supplementary widget options for the instance.
     
    365365 * @param int|string   $id               Sidebar ID.
    366366 * @param string       $name             Sidebar display name.
    367  * @param callback     $control_callback Run when sidebar is displayed.
     367 * @param callable     $control_callback Run when sidebar is displayed.
    368368 * @param array|string $options          Optional. Widget options. See description above. Default empty array.
    369369 */
     
    614614         *     @type string $name                Name of the widget.
    615615         *     @type string $id                  Widget ID.
    616          *     @type array|callback $callback    When the hook is fired on the front-end, $callback is an array
     616         *     @type array|callable $callback    When the hook is fired on the front-end, $callback is an array
    617617         *                                       containing the widget object. Fired on the back-end, $callback
    618618         *                                       is 'wp_widget_control', see $_callback.
  • trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php

    r34428 r34566  
    5454         *     An array of arguments passed to wp_nav_menu() to retrieve a custom menu.
    5555         *
    56          *     @type callback|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
     56         *     @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty.
    5757         *     @type mixed         $menu        Menu ID, slug, or name.
    5858         * }
Note: See TracChangeset for help on using the changeset viewer.