private function isChildOf(AbstractNode $node, $type) { $parent = $node->getParent(); return $parent->isInstanceOf($type); }