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-recovery-mode.php

    r55703 r59336  
    162162     *
    163163     * @param array $error Error details from `error_get_last()`.
    164      * @return true|WP_Error True if the error was handled and headers have already been sent.
    165      *                       Or the request will exit to try and catch multiple errors at once.
    166      *                       WP_Error if an error occurred preventing it from being handled.
     164     * @return true|WP_Error|void True if the error was handled and headers have already been sent.
     165     *                            Or the request will exit to try and catch multiple errors at once.
     166     *                            WP_Error if an error occurred preventing it from being handled.
    167167     */
    168168    public function handle_error( array $error ) {
Note: See TracChangeset for help on using the changeset viewer.