@param \PHPMD\AbstractNode $node

@return void
436331
public function apply(AbstractNode $node)
    {
        if (preg_match('(\\\\[^\\\\]+Controller$)', $node->getFullQualifiedName()) === 0) {
            return;
        }
        if ($node->getName() === 'AbstractController') {
            return;
        }

        /** @var \PHPMD\Node\ClassNode $node */
        foreach ($node->getMethods() as $method) {
            $this->applyPublicMethodsHaveActionSuffix($method);
        }
    }
861250
public function persist(AbstractEntity $entity)
    {
        $update = $entity->getId() !== null;

        for ($i = count($this->registries) - 1; $i >= 0; $i--) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            if ($update) {
                $registry->update($entity->getId(), $entity);
            } else {
                $registry->add($entity->getId(), $entity);
            }
        }
    }
1066686
protected function isFactory(AbstractNode $node): bool
    {
        $className = $this->getClassName($node);

        if (preg_match(static::PATTERN_FACTORY, $className) === 0) {
            return false;
        }

        return true;
    }
525939
public function removeNode(AbstractNode $node) {
        if (true === array_key_exists($node->id, $this->index)) {
            unset($this->nodes[$this->index[$node->id]]);
            unset($this->index[$node->id]);
            $node->parent = null;
        }
        return $this;
    }
1221099
function it_compiles_nodes_using_a_generic_solution($node)
    {
        $node->compile($this)->will(function ($args) {
            $args[0]->write('echo $message');
        });

        $this->repr($node)->getSource()->shouldMatch('/echo \$message/');
    }
162065
public function addNode(AbstractNode $node) {
        $node->parent           = $this;
        $this->index[$node->id] = count($this->nodes);
        $this->nodes[]          = $node;
        return $this;
    }
977125
public function enterNode(Node $node)
    {
        if ($node instanceof DeclareDeclare && ($node->getLine() === 1 || $node->getLine() === 2)) {
            throw new StrictTypesException();
        }
    }
3934
public function addChild(TreeNodeInterface $node): void
    {
        $this->children[] = $node;
        $this->isLeaf = false;
    }
792380
public function apply(AbstractNode $node)
    {
        if (preg_match('([A-Za-z0-9]+Bridge$)', $node->getName()) === 0 ||
            preg_match('#.*\\\\Dependency\\\\.*#', $node->getNamespaceName()) === 0) {
            return;
        }

        preg_match('#(?<moduleName>[\w]+)\\\\Dependency\\\\(?<layerName>[\w]+)#is', $node->getNamespaceName(), $namespaceParts);

        $this->verifyClass($node, $namespaceParts);
        $this->verifyInterface($node, $namespaceParts);
    }
655662
public function apply(AbstractNode $node)
    {
        /** @var \PHPMD\Node\ClassNode $node */
        $methods = $node->getMethods();
        foreach ($methods as $method) {
            if (strtolower($method->getName()) !== '__construct') {
                continue;
            }

            $this->check($method, $node);
        }
    }
359897
protected function extendsAbstractPlugin(AbstractNode $node): bool
    {
        if (!($this instanceof ClassAware)) {
            return false;
        }

        $parentClass = $this->getAstClass($node)->getParentClass();

        if (!($parentClass instanceof ASTClass)) {
            return false;
        }

        if ($parentClass->getName() === static::EXTENDS_CLASS_NAME) {
            return true;
        }

        return false;
    }
1029496
protected function refreshExistingNode(AbstractNestedNode $node)
    {
        if (true === $this->_em->contains($node)) {
            $this->_em->refresh($node);
        } elseif (null === $node = $this->find($node->getUid())) {
            $this->_em->persist($node);
        }

        return $this;
    }
284025
protected function isPlugin(AbstractNode $node): bool
    {
        if ($this->isServiceProvider($node)) {
            return false;
        }

        if ($this->extendsAbstractPlugin($node)) {
            return true;
        }

        if ($this->isInPluginDirectory($node)) {
            return true;
        }

        return false;
    }
24730
private function isChildOfTry(AbstractNode $node)
    {
        $parent = $node->getParent();

        while (is_object($parent)) {
            if ($parent->isInstanceOf('TryStatement')) {
                return true;
            }

            $parent = $parent->getParent();
        }

        return false;
    }
1158208
final public function setNode(Node $node)
    {
        $this->node = $node;
        foreach ($node->getParams() as $key => $value) {
            $this->$key = $value;
        }
    }
538737
public function invoke($node, NodeInterface $parent): void
    {
        if ($this->config->hasInterfaceParsing()) {
            if (! $node instanceof Node\Stmt\Interface_ || ! $parent instanceof PhpFileModelInterface) {
                throw new Exception('InterfaceNodeParser is made to parse an interface node');
            }

            $interface = new InterfaceModel();
            $interface->setParentNode($parent);
            $interface->setName(ClassLikeNameHelper::getName($node));
            $parent->addConcreteUse($parent->getFullNameFor($interface->getName()), $interface->getName());

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

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

            $parent->addInterface($interface);
        }
    }
1169609
public function apply(AbstractNode $node)
    {
        if (!$this->isFactory($node)) {
            return;
        }

        foreach ($node->getMethods() as $method) {
            $this->applyRule($method);
        }
    }