Opened 3 weeks ago
Closed 3 weeks ago
#64262 closed defect (bug) (fixed)
Coding Standards: Fix improper @return tag documentation across core files
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch |
| Focuses: | docs, coding-standards | Cc: |
Description
Fixes @return tag documentation violations in WordPress core to comply with PHP Documentation Standards.
Changes:
- Replace
boolean/Booleanwithbool - Replace
integer/Integerwithint - Add descriptions to
@returntags (type + description required per standards)
Files Modified: 10 files, 29 functions total
- wp-includes:
class-wp-theme-json-resolver.php,block-supports/elements.php,class-json.php,formatting.php,comment.php,functions.php - wp-admin/includes:
plugin.php,widgets.php,user.php,upgrade.php
Example:
// Before
@return integer|null
// After
@return int|null
// Before
@return string
// After
@return string The base name of the given path.
Change History (7)
This ticket was mentioned in PR #10522 on WordPress/wordpress-develop by @huzaifaalmesbah.
3 weeks ago
#2
- Keywords has-patch added
#3
@
3 weeks ago
Thanks for the patch, @huzaifaalmesbah! I’ve reviewed the changes and they look good to me. The @return tags are now using bool/int and include clear descriptions in accordance with the WordPress PHP Documentation Standards. I’ve also confirmed this is documentation-only with no functional code changes. Nice improvement to consistency across the affected core files.
#4
@
3 weeks ago
- Milestone changed from Awaiting Review to 7.0
- Owner set to westonruter
- Status changed from new to reviewing
@huzaifaalmesbah commented on PR #10522:
3 weeks ago
#5
Thanks @westonruter and @sabernhardt for your detailed reviews and helpful suggestions. I've applied all the recommended changes, and I’ve ignored updates to src/wp-includes/class-json.php as advised since it's a third-party library and deprecated.
@huzaifaalmesbah commented on PR #10522:
3 weeks ago
#6
Thanks for the updates @westonruter The docs feel a lot clearer and more helpful now.
## Description
Fixes https://core.trac.wordpress.org/ticket/64262
Updates
@returntag documentation to comply with WordPress PHP Documentation Standards.Changes:
boolean/Booleanwithboolinteger/Integerwithint@returntags (type + description required)Files: 10 files, 29 functions
class-wp-theme-json-resolver.php,block-supports/elements.php,class-json.php,formatting.php,comment.php,functions.phpplugin.php,widgets.php,user.php,upgrade.phpExample:
// Before @return integer|null // After @return int|null// Before @return string // After @return string The base name of the given path.Testing: