WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 7 months ago

#45849 new defect (bug)

Missing @return statement in function

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0.2
Component: Plugins Keywords: needs-patch
Focuses: docs, coding-standards Cc:
PR Number:

Description

Are we already tracking the following or fixed already?

If not, get_admin_page_parent function in wp-admin/includes/plugin.php has no return type specified in its Doc block.

Also, it does not have a signature for $parent argument in Doc block as well.

I think the Doc block may be rewritten in the following manner:

/**
 *
 * @global string $parent_file
 * @global array $menu
 * @global array $submenu
 * @global string $pagenow
 * @global string $typenow
 * @global string $plugin_page
 * @global array $_wp_real_parent_file
 * @global array $_wp_menu_nopriv
 * @global array $_wp_submenu_nopriv
 *
 * $parent string. Name of admin page parent. Default is empty when current page has no parent.
 * @return string.
 */

 function get_admin_page_parent( $parent = '' ) {
    ...
 }

Attachments (1)

45849.diff (533 bytes) - added by subrataemfluence 7 months ago.

Download all attachments as: .zip

Change History (2)

#1 @SergeyBiryukov
7 months ago

  • Keywords needs-patch added; dev-feedback removed

@return tag was added in [45085], though it would also benefit from a description.

@param tag is still missing.

Note: See TracTickets for help on using tickets.