PHPMD\Rule\UnusedLocalVariable::isChildOf PHP Method

isChildOf() private method

Checks if the given node is a direct or indirect child of a node with the given type.
private isChildOf ( PHPMD\AbstractNode $node, string $type ) : boolean
$node PHPMD\AbstractNode
$type string
return boolean
    private function isChildOf(AbstractNode $node, $type)
    {
        $parent = $node->getParent();
        return $parent->isInstanceOf($type);
    }