Given any node, returns the FQN of the symbol that is referenced
Returns null if the FQN could not be resolved or the reference node references a variable
May also return "static", "self" or "parent"

@param Node $node
@return string|null
482189
public function resolveReferenceNodeToFqn(Node $node)
    {
        // TODO all name tokens should be a part of a node
        if ($node instanceof Node\QualifiedName) {
            return $this->resolveQualifiedNameNodeToFqn($node);
        } else if ($node instanceof Node\Expression\MemberAccessExpression) {
            return $this->resolveMemberAccessExpressionNodeToFqn($node);
        } else if (ParserHelpers\isConstantFetch($node)) {
            return (string)($node->getNamespacedName());
        } else if (
            // A\B::C - constant access expression
            $node instanceof Node\Expression\ScopedPropertyAccessExpression
            && !($node->memberName instanceof Node\Expression\Variable)
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node);
        } else if (
            // A\B::$c - static property access expression
            $node->parent instanceof Node\Expression\ScopedPropertyAccessExpression
        ) {
            return $this->resolveScopedPropertyAccessExpressionNodeToFqn($node->parent);
        }

        return null;
    }
618171
public function refactor(Node $node): ?Node
    {
        if (! $this->isName($node, 'parse')) {
            return null;
        }

        if (! $this->isType($node->class, 'Symfony\Component\Yaml\Yaml')) {
            return null;
        }

        if (! $this->isArgumentYamlFile($node)) {
            return null;
        }

        $fileGetContentsFunCallNode = $this->createFunction('file_get_contents', [$node->args[0]]);
        $node->args[0] = new Arg($fileGetContentsFunCallNode);

        return $node;
    }
313581
public function enterNode(Node $node)
    {
        if ($node instanceof Namespace_) {
            $this->currentNamespace = $node;

            return $node;
        }

        return null;
    }
629976
protected function &getNode(&$node, $key)
    {
        if (is_object($node) && isset($node->$key)) {
            return $node->$key;
        }

        if (is_array($node) && isset($node[$key])) {
            return $node[$key];
        }

        // Special handling of eloquent relations
        if (!$this->isEloquentModel($node)) {
            $result = null;

            return $result;
        }

        if (!method_exists($node, $key)) {
            $result = null;

            return $result;
        }

        $relation = $node->{$key}();

        if (!$this->isEloquentRelation($relation)) {
            $result = null;

            return $result;
        }

        return $relation->getResults();
    }
1029923
protected function resolve(Node $node)
    {
        $value = null;
        try {
            ++$this->nodeLevel;

            $methodName = $this->getDispatchMethodFor($node);
            if (method_exists($this, $methodName)) {
                $value = $this->$methodName($node);
            }
        } finally {
            --$this->nodeLevel;
        }

        return $value;
    }
989064
protected function getCacheTtl(Node $node): int
    {
        return $this->ttl[$node::schema()->getQName()->toString()] ?? $this->ttl['default'];
    }
388124
public function getChildrenNodes(Node $node)
    {
        $result = $this->search($node->getDn(), null, false);

        $nodes = array();
        foreach ($result as $node) {
            $nodes[] = $node;
        }

        return $nodes;
    }
676688
private function getNodeIndex( $node )
	{
		for( $i=0; $i<$this->count(); $i++ )
			if( $this->nodes[$i] == $node )
				return $i;
		return NULL;
	}
959874
public static function node($id)
    {
        $id = intval($id);
        if (empty($id)) return null;
        
        if (!static::$caching || empty(static::$_nodes[$id])) {
            $result = static::findOne($id);
            if (static::$caching) {
                static::$_nodes[$id] = $result;
            } else {
                return $result;
            }
        }
        return static::$_nodes[$id];
    }
232635
public static function get_block_parent( \DOMNode $node ) {
		$parent = $node->parentNode;
		if ( ! $parent instanceof \DOMElement ) {
			return null;
		}

		while ( ! self::is_block_tag( $parent ) && $parent->parentNode instanceof \DOMElement ) {
			/**
			 * The parent is sure to be a \DOMElement.
			 *
			 * @var \DOMElement
			 */
			$parent = $parent->parentNode;
		}

		return $parent;
	}
738708
public function getNodeByKey($key): ?Node {
        if (!$this->containsKey($key)) {
            return null;
        }
        $head = $this->getHead();
        while ($head !== null) {
            if (Comparator::equals($head->getKey(), $key)) {
                return $head;
            }
            $head = $head->getNext();
        }
        return null;
    }
638825
public function getNodeLocalCanonical(NodeInterface $node) : ?string
    {
        if ($this->isNodeBlacklisted($node)) {
            return 'node/' . $node->id();
        }

        if ($this->siteManager->hasContext()) {
            return $this->aliasManager->getPathAlias($node->id(), $this->siteManager->getContext()->getId());
        }
    }
600338
function(node = this.fch) {
                if (node && node.nxt != this.fch && this.fch)
                    return node.nxt;
                return null;
            }
761757
private function visitFactorialNode(FunctionNode $node)
    {
        $functionName = $node->getName();
        $op = $node->getOperand();
        $operand = $op->accept($this);

        // Add parentheses most of the time.
        if ($this->isNumeric($op)) {
            if ($op->getValue() < 0) {
                $operand = "($operand)";
            }
        } elseif ($op instanceof VariableNode || $op instanceof ConstantNode) {
            // Do nothing
        } else {
            $operand = "($operand)";
        }

        return "$operand$functionName";
    }
329953
private function getNodeTextContent(Node $node)
    {
        if ($node instanceof Text) {
            return $node->getContent();
        }

        if ($node instanceof AbstractInlineContainer) {
            $text = '';
            foreach ($node->children() as $child) {
                $text .= $this->getNodeTextContent($child);
            }

            return $text;
        }

        return '';
    }
124951
public function getFlattenChildren(Node $node)
    {
        $flatten = array();
        foreach ($node->getNodes() as $subNode) {
            if (count($subNode->getNodes()) > 1 || isset($subNode->getTrace()['query_source']) || !empty($subNode->getValues())) {
                $flatten[] = $subNode;
            } else {
                $flatten = array_merge($flatten, $this->getFlattenChildren($subNode));
            }
        }

        return $flatten;
    }
602781
private function getOuterMostArrayNode(Node $node): Node
    {
        $outerMostArrayParent = $node;

        do {
            if ($node instanceof Node\Expr\Array_) {
                $outerMostArrayParent = $node;
            }
        } while ($node = $node->getAttribute(ParentConnectorVisitor::PARENT_KEY));

        return $outerMostArrayParent;
    }