This makes Psalm think that it has neither setAttribute nor getAttribute methods, yet it has them.
$doc = new DOMDocument("1.0");
$node = $doc->createElement("foo");
$newnode = $doc->appendChild($node);
$newnode->setAttribute("bar", "baz");
var_dump($newnode->getAttribute('bar'));
var_dump(method_exists($newnode, 'getAttribute'));
Ah, DOMNode really doesn't have those methods. But it looks like DomDocument::appendChild, contra the documentation, returns a DomElement
At least in some instances
Well, it appears that createElement() always returns what is given.
I'm closing this as a bogus because Psalm can't help it.
Yes it most certainly can :)