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-admin/includes/class-wp-privacy-requests-table.php

    r56665 r59336  
    431431     *
    432432     * @param WP_User_Request $item Item being shown.
    433      * @return string Status column markup.
     433     * @return string|void Status column markup. Returns a string if no status is found,
     434     *                     otherwise it displays the markup.
    434435     */
    435436    public function column_status( $item ) {
Note: See TracChangeset for help on using the changeset viewer.