Page MenuHomePhabricator

Replace DOMUtils::assertElt($node) with ( $node instanceof DOMElement ) wherever feasible
Closed, DuplicatePublic


We added the assertElt helper and added those calls in several places in the codebase during porting to mollify Phan.

However, we later realized that in many places we have a DOMUtils::isElt($node) and DOMUtils::assertElt($node) pair which can be replaced with a $node instanceof DOMElement check that is cheaper and also provides Phan with the same info.

We need to grep for these instances and replace the pair with the instanceof check wherever possible

Event Timeline

Change 606258 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Replace some instances of DOMUtils::assertElt

Change 606258 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Replace some instances of DOMUtils::assertElt