Handle a dom node.
@param Parser $parser
@param \DOMNode $node
@param NodeInterface $target
@return void
341815
public function handle(Parser $parser, \DOMNode $node, NodeInterface $target)
    {
        $url = $node->attributes->getNamedItem('href')->nodeValue;
        $type = $node->attributes->getNamedItem('type')->nodeValue;
        $length = intval($node->attributes->getNamedItem('length')->nodeValue, 10);
        $title = $node->attributes->getNamedItem('title') ? $node->attributes->getNamedItem('title')->nodeValue : basename($url);
        $enclosure = new Enclosure();
        $enclosure
            ->setType($type)
            ->setLength($length)
            ->setTitle($title)
            ->setUrl($url);
        /** @var ItemInterface $target */
        $target->addEnclosure($enclosure);
    }
1211562
protected function processNode( Node $node, \XMLReader $xmlReader )
    {
        $node = parent::processNode( $node, $xmlReader );
        $children = [ ];

        if( !$xmlReader->isEmptyElement )
        {
            $scanner = new NodeStrategyTraversal();
            $scanner->addNodeHandler( '*', new self( function ( $node ) use ( &$children )
            {
                $children[] = $node;
            } ) );
            $scanner->parse( $xmlReader, $this->startDepth );
        }

        $node->children = $children;

        return $node;
    }
366362
protected function runActionHandler($action, TreeNodeInterface $node)
    {
        if ($node instanceof Token) {
            try {
                return $action($node->getContent());
            } catch (AbortParsingException $e) {
                if (null === $e->getOffset()) {
                    throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
                }
                throw $e;
            } catch (AbortNodeException $e) {
                throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
            } catch (\Throwable $e) {
                throw new \RuntimeException("Action failure in `{$this::buildActionName($node)}`", 0, $e);
            }
        }

        $args = [];
        foreach ($node->getChildren() as $child) {
            $args[] = $child->made();
        }

        try {
             $result = $action(...$args);
        } catch (AbortNodeException $e) {
            throw new AbortParsingException(
                $e->getMessage(),
                $node->getChild($e->getNodeIndex() - 1)->getOffset(),
                $e
            );
        } catch (AbortParsingException $e) {
            if (null === $e->getOffset()) {
                throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
            }
            throw $e;
        } catch (\Throwable $e) {
            throw new \RuntimeException("Action failure in `{$this::buildActionName($node)}`", 0, $e);
        }

        if ($this->prune) {
            $node->prune();
        }

        return $result;
    }
465442
public function setProperty(NodeInterface $node, \DOMElement $element) : void
    {
        $node->setTitle($element->nodeValue);
    }
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;
        }
    }
958476
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return
            strtolower($node->localName) == 'link' &&
            $node->namespaceURI == Atom10Standard::NAMESPACE_URI &&
            $target instanceof ChannelInterface;
    }
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()));
    }
1104727
public function add(NodeInterface $node)
	{
		$max = $this->getMax();
		$node->setLeftValue($max + 1);
		$node->setRightValue($max + 2);
		$node->setLevel(0);
	}
514271
public function beforeAdoptNode(NodeInterface $node, Context $context, $recursive)
    {
        if (!$this->eventEmittingService->isEnabled()) {
            return;
        }

        if ($this->currentlyAdopting === 0) {
            /* @var $nodeEvent NodeEvent */
            $nodeEvent = $this->eventEmittingService->emit(self::NODE_ADOPT, [
                'targetWorkspace' => $context->getWorkspaceName(),
                'targetDimensions' => $context->getTargetDimensions(),
                'recursive' => $recursive
            ], NodeEvent::class);
            $nodeEvent->setNode($node);
            $this->eventEmittingService->pushContext();
        }

        $this->currentlyAdopting++;
    }
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);
                }
            }
        }
    }
383423
public function preParseUses(array $nodes, PhpFileModelInterface $parent): void
    {
        foreach ($nodes as $node) {
            if ($node instanceof Use_) {
                $this->useNodeParser->invoke($node, $parent);
            } else {
                if ($node instanceof GroupUse) {
                    $this->groupUseNodeParser->invoke($node, $parent);
                }
            }
        }
    }
1065773
public function executeNodeReactions($reaction_type, NodeInterface $node) {
    $provider = new NodeContextProvider($node);
    $provided = $provider->getRuntimeContexts([]);
    $this->contextManager->evaluateContexts($provided);

    // Fire off index reactions.
    foreach ($this->contextManager->getActiveReactions($reaction_type) as $reaction) {
      $reaction->execute($node);
    }
  }
656123
public function canHandle(\DOMNode $node, NodeInterface $target)
    {
        return strtolower($node->nodeName) == 'link' && $target instanceof ChannelInterface;
    }
424408
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Property || ! $parent instanceof TraitModelInterface) {
            throw new Exception('AttributeNodeParser is made to parse a property node');
        }
        $isStatic   = $node->isStatic();
        $visibility = AttributeVisibilityHelper::getVisibility($node);

        foreach ($node->props as $property) {
            $attribute = new AttributeModel();
            $attribute->setParentNode($parent);
            $attribute->setName($property->name);
            $attribute->setIsStatic($isStatic);
            $attribute->setVisibility($visibility);

            if ($property->default !== null) {
                $this->valueNodeParser->invoke($property->default, $attribute);
            }

            $parent->addAttribute($attribute);
        }
    }
1231571
public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName)
    {
        if($annotation instanceof \Imi\Bean\Annotation\Listener)
        {
            $this->data[] = [$annotation->eventName, $className, $annotation->priority];
            Event::on($annotation->eventName, $className, $annotation->priority);
        }
    }
535509
public function invoke($node, NodeInterface $parent): void
    {
        if (! $node instanceof Node\Stmt\Class_ || ! $parent instanceof PhpFileModelInterface) {
            throw new Exception('ClassNodeParser is made to parse a class node');
        }
        $class = new ClassModel();
        $class->setParentNode($parent);
        $class->setName(ClassLikeNameHelper::getName($node));
        $class->setIsAbstract($node->isAbstract());
        $class->setIsFinal($node->isFinal());
        $parent->addConcreteUse($parent->getFullNameFor($class->getName()), $class->getName());

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

        $this->parseSubNodes($node->stmts, $class);

        $parent->addClass($class);
    }
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();
    }