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

we require return types in @method tags, but phpstan does not #36

Closed
claytonrcarter opened this issue Aug 12, 2024 · 0 comments · Fixed by #37
Closed

we require return types in @method tags, but phpstan does not #36

claytonrcarter opened this issue Aug 12, 2024 · 0 comments · Fixed by #37

Comments

@claytonrcarter
Copy link
Owner

Noticed while using Zed w/ this docblock:

/**
 * @method getSelectorContents(string $selector)
 * @method getSelectorAttribute(string $selector, string $attribute)
 * @method getTrimmedString(string $string)
 */

phpstan does fine with this, but the highlighting was messed up in Zed. The issue is that we are requiring a return type for @method, so the above resulted in a parse error, but phpstan seems to not care if one exists or not.

This snippet was colored correctly:

/**
 * @method DOMNodeList getSelectorContents(string $selector)
 * @method string getSelectorAttribute(string $selector, string $attribute)
 * @method string getTrimmedString(string $string)
 */

Suggestion: make return type optional to match behavior of phpstan.

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

Successfully merging a pull request may close this issue.

1 participant