Handle a dom node.
@param Parser $parser
@param \DOMNode $node
@param NodeInterface $target
@return void
184213
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $target->{$this->setterName}($node->attributes->getNamedItem('href')->nodeValue);
    }
127062
protected function handleTagOpenForObject( $parser, $tag, $attributes )
	{
		$count		= count( $this->last ) - 1;
		$parentNode	=& $this->last[$count];
		$childNode	= new XML_DOM_Node(
			$tag,
			"",
			$attributes
		);
		$parentNode->addChild( $childNode );
		$this->last[]	=& $childNode;
	}
135718
protected void moveChildNodes(final DOMNode sourceNode, final DOMNode targetNode) {

		DOMNode child = (DOMNode) sourceNode.getFirstChild();

		while (child != null) {

			DOMNode next = (DOMNode) child.getNextSibling();

			targetNode.appendChild(child);

			child = next;

		}

	}
170298
public function afterNodeCreate(NodeInterface $node)
    {
        if (!$this->eventEmittingService->isEnabled()) {
            return;
        }

        /* @var $nodeEvent NodeEvent */
        $nodeEvent = array_pop($this->currentNodeAddEvents);
        $nodeEvent->setNode($node);
        $this->eventEmittingService->popContext();
        $this->eventEmittingService->add($nodeEvent);
    }
468349
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $rel = $this->getAttr($node, 'rel');
        $link = $this->getAttr($node, 'href');
        $title = $this->getAttr($node, 'title');
        $mime = $this->getAttr($node, 'type');
        $relation = new RelationLink();
        $relation
            ->setTitle($title)
            ->setMimeType($mime)
            ->setRelationType($rel)
            ->setUrl($link);
        /** @var ChannelInterface $target */
        $target->setRelation($relation);
    }
564317
private function processDOM(\DOMNode $node, \DOMDocument $dom)
    {
        if ($node->hasChildNodes()) {
            $nodes = [];
            foreach ($node->childNodes as $childNode) {
                if ($childNode instanceof \DOMElement && $childNode->tagName) {
                    if (in_array($childNode->tagName, $this->protectedTags)) {
                        continue;
                    }
                }

                $nodes[] = $childNode;
            }

            $depth = $this->stateBag->getCurrentDepth();

            foreach ($nodes as $childNode) {
                if ($childNode instanceof \DOMText && !$childNode->isWhitespaceInElementContent()) {
                    $this->stateBag->setCurrentDepth($depth);
                    $this->doFix($childNode, $node, $dom);
                } else {
                    $this->stateBag->setCurrentDepth($this->stateBag->getCurrentDepth() + 1);
                    $this->processDOM($childNode, $dom);
                }
            }
        }
    }
460986
public function copyNode(NodeInterface $node)
    {
        $this->nodeContextPath = $node->getContextPath();
        $this->mode = self::MODE_COPY;
    }
805050
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return strtolower($node->nodeName) == 'lastbuilddate' && $target instanceof FeedInterface;
    }
1271682
public function enterNode(PhpParser\Node $node)
    {
        $attrs = $node->getAttributes();

        if ($cs = $node->getComments()) {
            $new_comments = [];

            foreach ($cs as $c) {
                if ($c instanceof PhpParser\Comment\Doc) {
                    $new_comments[] = new PhpParser\Comment\Doc(
                        $c->getText(),
                        $c->getLine() + $this->line_offset,
                        $c->getFilePos() + $this->file_offset
                    );
                } else {
                    $new_comments[] = new PhpParser\Comment(
                        $c->getText(),
                        $c->getLine() + $this->line_offset,
                        $c->getFilePos() + $this->file_offset
                    );
                }
            }

            $node->setAttribute('comments', $new_comments);
        }

        /** @psalm-suppress MixedOperand */
        $node->setAttribute('startFilePos', $attrs['startFilePos'] + $this->file_offset);
        /** @psalm-suppress MixedOperand */
        $node->setAttribute('endFilePos', $attrs['endFilePos'] + $this->file_offset);
        /** @psalm-suppress MixedOperand */
        $node->setAttribute('startLine', $attrs['startLine'] + $this->line_offset);
    }
376292
public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName)
    {
        if($annotation instanceof Tool)
        {
            $this->data['class'][$className]['Tool'] = $annotation;
            Event::trigger('TOOL_PARSER.PARSE_TOOL.' . $className);
        }
        else if($annotation instanceof Operation)
        {
            if(isset($this->data['class'][$className]['Methods'][$targetName]['Operation']) && $this->data['class'][$className]['Methods'][$targetName]['Operation'] != $annotation)
            {
                throw new \RuntimeException(sprintf('Tool %s/%s is already exists!', isset($this->data['class'][$className]['Tool']) ? $this->data['class'][$className]['Tool']->name : $className, $annotation->name));
            }
            $this->data['class'][$className]['Methods'][$targetName]['Operation'] = $annotation;
            if(isset($this->data['class'][$className]['Tool']))
            {
                $this->data['tool'][$this->data['class'][$className]['Tool']->name][$annotation->name] = [$className, $targetName];
            }
            else
            {
                $operation = $annotation;
                Event::one('TOOL_PARSER.PARSE_TOOL.' . $className, function() use($className, $operation, $targetName){
                    $this->data['tool'][$this->data['class'][$className]['Tool']->name][$operation->name] = [$className, $targetName];
                });
            }
            
        }
        else if($annotation instanceof Arg)
        {
            $this->data['class'][$className]['Methods'][$targetName]['Args'][$annotation->name] = $annotation;
        }
    }
263440
public function enterNode(Node $node)
    {
        parent::enterNode($node);

        if (self::isConditional($node)) {
            $this->conditionalScopes++;
        } else {
            // @todo add an "else" here which adds a runtime check for instances where we can't tell
            // whether a class is being redefined by static analysis alone.
            if ($this->conditionalScopes === 0) {
                if ($node instanceof Class_) {
                    $this->validateClassStatement($node);
                } elseif ($node instanceof Interface_) {
                    $this->validateInterfaceStatement($node);
                } elseif ($node instanceof Trait_) {
                    $this->validateTraitStatement($node);
                }
            }
        }
    }
1352984
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Function_ || ! $parent instanceof PhpFileModelInterface) {
            throw new Exception('FunctionNodeParser is made to parse a function node');
        }

        $function = new FunctionModel();
        $function->setParentNode($parent);
        $function->setName($node->name);
        $function->setIsGlobal(true);

        $this->parseFunction($node, $function);

        if (($documentation = $node->getDocComment()) !== null) {
            $this->documentationNodeParser->invoke($documentation, $function);
        }

        $parent->addFunction($function);
    }
1115002
public function registerNodeChange(NodeInterface $node)
    {
        if (in_array($node->getIdentifier(), $this->tagsToFlush)) {
            return;
        }
        if (!$node->getNodeType()->isOfType('Neos.Neos:Document')) {
            return;
        }
        $this->tagsToFlush[] = $node->getIdentifier();
    }
210682
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $target->{$this->setterName}($this->getNodeContent($node));
    }
660909
protected function handleShortcutNode(NodeInterface $node)
    {
        $resolvedNode = $this->nodeShortcutResolver->resolveShortcutTarget($node);
        if ($resolvedNode === null) {
            throw new NodeNotFoundException(sprintf('The shortcut node target of node "%s" could not be resolved', $node->getPath()), 1430218730);
        } elseif (is_string($resolvedNode)) {
            $this->redirectToUri($resolvedNode);
        } elseif ($resolvedNode instanceof NodeInterface && $resolvedNode === $node) {
            throw new NodeNotFoundException('The requested node does not exist or isn\'t accessible to the current user', 1502793585);
        } elseif ($resolvedNode instanceof NodeInterface) {
            $this->redirect('show', null, null, ['node' => $resolvedNode]);
        } else {
            throw new UnresolvableShortcutException(sprintf('The shortcut node target of node "%s" resolves to an unsupported type "%s"', $node->getPath(), is_object($resolvedNode) ? get_class($resolvedNode) : gettype($resolvedNode)), 1430218738);
        }
    }
690672
public function addElement(\DomDocument $document, \DOMElement $rootElement, NodeInterface $node): void
    {
        if (!($node instanceof FeedInterface) || is_null($node->getLanguage())) {
            return;
        }
        $rootElement->appendChild($document->createElement($this->getNodeName(), $node->getLanguage()));
    }
393533
public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName)
    {
        if($annotation instanceof \Imi\Bean\Annotation\ClassEventListener)
        {
            if(!isset($this->data[$annotation->className][$annotation->eventName]))
            {
                $this->data[$annotation->className][$annotation->eventName] = [];
            }
            $this->data[$annotation->className][$annotation->eventName][] = [
                'className' => $className,
                'priority'  => $annotation->priority,
            ];
        }
    }