Skip to content

Conversation

@huzaifaalmesbah
Copy link
Member

Summary

Improves inline documentation compliance with WordPress Inline Documentation Standards by adding missing @return tags 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.php header.

Impact

  • ✅ Complies with WordPress documentation standards
  • ✅ Improves IDE autocomplete and static analysis
  • ✅ Makes return values clearer for developers
  • ✅ Documentation-only changes (no functional changes)
- 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
@github-actions
Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: huzaifaalmesbah <huzaifaalmesbah@git.wordpress.org> 

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.46%. Comparing base (41ccde1) to head (4b2c039).

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 
Flag Coverage Δ
javascript 94.61% <ø> (ø)
unit 76.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant