Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP_CLI\Formatter::display_items should use \Iterator, not Iterator #7

Open
mundschenk-at opened this issue Jul 25, 2021 · 7 comments
Open

Comments

@mundschenk-at
Copy link

mundschenk-at commented Jul 25, 2021

WP_CLI\Formatter::display_items has Iterator (without the \) set as the type of its parameter $items, expanding to WP_CLI\Iterator.

@szepeviktor
Copy link
Member

@szepeviktor
Copy link
Member

szepeviktor commented Jul 25, 2021

I see!
Imported classes are not modified in PHPDoc blocks.
FQCN should be used in PHPDoc (and in exceptions) but the WP-CLI project does not seem to be doing that.

@szepeviktor
Copy link
Member

Talked about in GiacoCorsiglia/php-stubs-generator#8

@szepeviktor
Copy link
Member

@mundschenk-at If you convince @schlessera to always use FQCN ...

@mundschenk-at
Copy link
Author

Unlikely. Always using FQCN in doc blocks makes them very unwieldy if you have deeply nested namespaces.

@mundschenk-at
Copy link
Author

FQCN should be used in PHPDoc (and in exceptions) but the WP-CLI project does not seem to be doing that.

Not according to https://docs.phpdoc.org/3.0/guide/guides/types.html

@szepeviktor
Copy link
Member

This is not a technical rule. It makes PHPDoc blocks easy to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants