vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.54k stars 660 forks source link

`Dom\XMLDocument` is unimplemented #11079

Open jnvsor opened 3 weeks ago

jnvsor commented 3 weeks ago

https://psalm.dev/r/fd6cc59c7d

Dom\XMLDocument is no longer an alias of DOMDocument per https://wiki.php.net/rfc/opt_in_dom_spec_compliance

I propose the following BC solution. The HTML 5 RFC added class aliases such as DOMNode -> DOM\Node etc. I propose to make them real classes instead of aliases.

psalm-github-bot[bot] commented 3 weeks ago

I found these snippets:

https://psalm.dev/r/fd6cc59c7d ```php '); $h = Dom\HTMLDocument::createFromString(''); ``` ``` Psalm output (using commit 16b24bd): ERROR: UndefinedClass - 3:6 - Class, interface or enum named Dom\XMLDocument does not exist ```
weirdan commented 6 days ago

PHP 8.4 is not out yet either.