PHPMD\Rule\UnusedLocalVariable::isChildOf PHP Méthode

isChildOf() private méthode

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
Résultat boolean
    private function isChildOf(AbstractNode $node, $type)
    {
        $parent = $node->getParent();
        return $parent->isInstanceOf($type);
    }