-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Docblock types to show all possibilites #293
Comments
This solution won't work. If static analysis is complaining that there isn't a I'm going to leave this open until certain common functions are type hinted to return |
Currently, the returned type of a function like
cloneNode()
orquerySelector
is hard-coded toNode
andElement
respectfully, but there may be any child type returned in reality.This means that
$document->querySelector("a")->href = "/test";
shows up as an error during static analysis, because anElement
doesn't have ahref
property, whereas the actual type returned does (HTMLAnchorElement
).The developer must type-hint the object returned by the DOM API, so it would be better for IDEs and static analysis if the available methods/properties were shown, rather than showing an error for all objects.
The text was updated successfully, but these errors were encountered: