Docs: Add missing @return tags and improve return value descriptions#146
Docs: Add missing @return tags and improve return value descriptions#146huzaifaalmesbah wants to merge 1 commit intoWordPress:trunkfrom
Conversation
- Add @return void tags to all register_routes() methods across REST controllers - Enhance boolean return descriptions to cover both true/false cases - Clarify mixed return types to explain when null is returned - Fix spacing in array type hints (array<string, mixed>) Per WordPress Inline Documentation Standards, all methods must document their return types, including void. Boolean returns should describe both success and failure cases. Mixed types should clarify all possible return values including null. Affected files: - includes/rest-api/class-wp-rest-abilities-init.php - includes/rest-api/endpoints/class-wp-rest-abilities-v1-list-controller.php - includes/rest-api/endpoints/class-wp-rest-abilities-v1-categories-controller.php - includes/rest-api/endpoints/class-wp-rest-abilities-v1-run-controller.php - includes/abilities-api/class-wp-ability-category.php
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #146 +/- ##
=========================================
Coverage 80.46% 80.46%
Complexity 178 178
=========================================
Files 20 20
Lines 1474 1474
Branches 120 119 -1
=========================================
Hits 1186 1186
Misses 288 288
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Improves inline documentation compliance with WordPress Inline Documentation Standards by adding missing
@returntags and enhancing return value descriptions.Changes
✅ Added @return void tags (4 methods)
WP_REST_Abilities_Init::register_routes()WP_REST_Abilities_V1_List_Controller::register_routes()WP_REST_Abilities_V1_Categories_Controller::register_routes()WP_REST_Abilities_V1_Run_Controller::register_routes()✅ Enhanced boolean return descriptions (4 methods)
Before:
@return bool True if the request has read access.After:
@return bool True if the request has read access, false otherwise.Covers both true and false cases for all permission check methods.
✅ Clarified mixed return type (1 method)
Before:
@return mixed|null The input parameters.After:
@return mixed|null The input parameters, or null if not provided.✅ Fixed type hint spacing (1 location)
Before:
array<string,mixed>After:
array<string, mixed>✅ Enhanced file description (1 file)
Added more detailed description to
class-wp-ability-category.phpheader.Impact