Skip to content

Misc docblock improvements - #6306

Merged
swissspidy merged 3 commits into
wp-cli:mainfrom
praful2111:bugfix/6305
Apr 27, 2026
Merged

swissspidy merged 3 commits into
wp-cli:mainfrom
praful2111:bugfix/6305

Conversation

@praful2111

@praful2111 praful2111 commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixed: Missing DocBlocks for Class Constructors and Properties #6305

@praful2111
praful2111 requested a review from a team as a code owner April 24, 2026 09:50
@github-actions

Copy link
Copy Markdown
Contributor

Hello! 👋

Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project.

Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Here are some useful Composer commands to get you started:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

To run a single Behat test, you can use the following command:

# Run all tests in a single file
composer behat features/some-feature.feature

# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123

You can find a list of all available Behat steps in our handbook.

@github-actions github-actions Bot added the bug label Apr 24, 2026
@codecov

codecov Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds PHPDoc documentation blocks to the properties and constructor of the Subcommand class to improve code clarity and type hinting. I have no feedback to provide as there are no review comments.

@swissspidy

Copy link
Copy Markdown
Member

Thanks for your PR. Note that there are now some PHPStan errors.

Also, are there any more such cases to fix? It would be easier to fix everything at once.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing DocBlocks to improve inline documentation and static analysis for the Dispatcher Subcommand class and its factory usage.

Changes:

  • Added DocBlocks for Subcommand properties and constructor parameters.
  • Refined CommandFactory::create_subcommand() $parent parameter type from mixed to RootCommand|CompositeCommand.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
php/WP_CLI/Dispatcher/Subcommand.php Adds DocBlocks for properties and the constructor to improve readability/IDE support.
php/WP_CLI/Dispatcher/CommandFactory.php Tightens DocBlock type for $parent when creating Subcommand instances.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread php/WP_CLI/Dispatcher/Subcommand.php
Comment thread php/WP_CLI/Dispatcher/Subcommand.php Outdated
@swissspidy swissspidy linked an issue Apr 27, 2026 that may be closed by this pull request
@swissspidy swissspidy changed the title fix: add docblocks Add some docblocks for Subcommand class Apr 27, 2026
@swissspidy swissspidy changed the title Add some docblocks for Subcommand class Misc docblock improvements Apr 27, 2026
@swissspidy swissspidy added this to the 3.0.0 milestone Apr 27, 2026
@swissspidy
swissspidy merged commit 4bcff03 into wp-cli:main Apr 27, 2026
72 of 73 checks passed
swissspidy added a commit that referenced this pull request May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing DocBlocks for Class Constructors and Properties

3 participants