-
Notifications
You must be signed in to change notification settings - Fork 82
Make phpdoc of Node and its subclasses more accurate #176
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
Conversation
- Some node subclasses have `Token` (not an array) as `$this->children` - Undefined variable in coalesce - be more specific about getRoot()'s expected value. - use string ...$classNames (same syntax as a real signature) https://github.com/phpDocumentor/fig-standards/pull/87#r37054459 - EchoExpression has ExpressionList (no expressions would be invalid PHP)
|
@TysonAndre, |
| * Returns null if there is no match. | ||
| * | ||
| * @param array ...$classNames | ||
| * @param string ...$classNames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this needs to be string and not string[]? Could you point to docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/phpDocumentor/fig-standards/pull/87#r37054459 is what an owner of phpDocumentor said
Doesn't seem to be part of PSR-5 yet, but haven't checked: https://youtrack.jetbrains.com/issue/WI-29429
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, not in PSR-5.
Also see https://github.com/phpDocumentor/ReflectionDocBlock/blob/14f9edf1ae14d6ce417afb05a9ed37d7b3cc341e/tests/unit/DocBlock/Tags/ParamTest.php#L152-L168 for how the phpdocumentor implementation works. It parses the individual element types as string from @param string ...$varName
| class NumericLiteral extends Expression { | ||
| /** @var Token[] */ | ||
| /** @var Token */ | ||
| public $children; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird for this to be called children when it's only ever a single token.
|
Thanks! |
Token(not an array) as$this->childrenhttps://github.com/phpDocumentor/fig-standards/pull/87#r37054459
"something $varName"may have multiple tokens and expressions)