You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#7681 is valid issue, xpath expression in the repro below always returns collection of DOMElements.
This is a feature request to analyse constant string xpath input to narrow the return type based on it. Per [1] the result is also never false as long as the expression is valid.
The text was updated successfully, but these errors were encountered:
mvorisek
changed the title
Analyse xpath expression to determine if the result is collection of DOM elements
Analyse constant xpath expression
Jul 1, 2023
@@ @@-20: Cannot call method getAttribute() on DOMNode|null.+ 7: Property Foo::$content is never written, only read.+ 9: Method Foo::doFoo() has no return type specified.
Full report
Line
Error
7
Property Foo::$content is never written, only read.
Feature request
Like https://phpstan.org/r/9c6ac5fc-d975-473e-ab7c-dc95ece0c6b1 (issue #2046) -
DOMDocument::getElementsByTagName()
always return collection ofDOMElement
.#7681 is valid issue, xpath expression in the repro below always returns collection of
DOMElement
s.This is a feature request to analyse constant string xpath input to narrow the return type based on it. Per [1] the result is also never
false
as long as the expression is valid.repro https://phpstan.org/r/6f02c158-3f87-4c04-b4d5-0dd5ee322ce7
functional repro: https://3v4l.org/l2B9Hq/rfc#vgit.master
[1] https://www.php.net/manual/en/domxpath.query.php#refsect1-domxpath.query-returnvalues
The text was updated successfully, but these errors were encountered: