Make WordPress Core


Ignore:
Timestamp:
11/02/2024 02:59:16 PM (19 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing void to DocBlock @return types.

This commit adds missing void return types to (parent) methods that can explicitly return void as one of their conditional paths.

Addressed methods:

  • WP_Privacy_Requests_Table::column_status()
  • WP_Recovery_Mode::handle_error()
  • WP_Widget::form() — unlike the others, it's the child classes that return void when the method is correctly implemented.

Note: @return void (where void is the single type returned) should not be used outside the default bundled themes and the PHP compatibility shims included in WordPress Core, as per the documentation standards.

Follow-up to [30382], [42967], [43256], [44973], [45448].

Props justlevine.
See #52217, #62281.

File:
1 edited

Legend:

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

    r59196 r59336  
    139139     *
    140140     * @param array $instance The settings for the particular instance of the widget.
    141      * @return string Default return is 'noform'.
     141     * @return string|void Default return is 'noform'.
    142142     */
    143143    public function form( $instance ) {
Note: See TracChangeset for help on using the changeset viewer.