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
add phpstan typechecked phpdocs #111
Conversation
@@ -25,6 +25,7 @@ public function meetsCriteria(Node $node): bool | |||
/** | |||
* @param Node&ClassConstFetch $node | |||
* @return array<string> | |||
* @phpstan-return array<class-string> | |||
*/ | |||
public function extractNamespaces(Node $node): array |
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.
I am wondering whether these methods should read $class->toCodeString()
as it seems toString
will not always return a proper FQCN, per phpdocs in
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.
Hm but as it states toCodeString
just used toString
Question is: Is this overridden in some specific types?
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.
Ok, it is changed depending on Relative
or FullyQualified
nodes.
That would prepend \\
or namespace\
. Which I don't know if it's good.
But it could be a possibility for resolving the problem @OskarStark and @localheinz faced in #100 where
"Relative" classes were not recognized correctly.
All Submissions:
New Feature Submissions:
Changes to Core Features:
Adding some phpdocs to make it easier to contribute. the question came up in a recent PR and having this types defined makes it easier for humans and also tools to reason about the code.
#100 (comment)