Opened 8 years ago
Closed 7 years ago
#44253 closed defect (bug) (fixed)
@return missing in doc comment of get_admin_page_parent function
| Reported by: | subrataemfluence | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: | Focuses: | docs |
Description
@return is missing in the Doc comment of get_admin_page_parent function.
Also I have a question. At the end of the function body we are returning hard coded empty string i.e. return '';
Why don't we return the $parent_file instead? Since we are already returning the value from rest of the if-else blocks and foreach loop the last final statement either will return an empty string or a value assigned to $parent_file variable.
<?php if( empty( $parent_file ) ) { $parent_file = ''; } return $parent_file;
Attachments (3)
Change History (9)
#2
@
8 years ago
Given PHPs type coercion, this really could just return $parent_file; without any check for empty, the caller should be responsible for checking for empty().
#3
@
8 years ago
@kennithnichol I understand the concern! Thank you for explaining and correcting me.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Since
get_admin_page_titlefunction is also missing the @return in Doc comment I am uploading a revised patch which combines both the functions.