I want to convert a DOMNode
object from a call to getElementsByTagName()
to a DOMElement
in order to access methods like getElements
I know this is mostly an annoying IDE problem.
The reason is $DOMNodeList->item(0)
witch returns a DOMNode ( or at least the IDE thinks so ).
To fix this you will have to Extract out the $DOMDocument->getElementsByTagName( $tagName )->item($index)
into a method of its own. In the DOCBlock you set the @return statement to DOMElement witch fixes the inspection problem.
This Works at least in PHPStorm.