@param NodeBuilder $node

@return NodeBuilder
974369
protected function getOptionsNodes(NodeBuilder $node)
    {
        return $node
            ->scalarNode('branch')
                ->info('The branch to deploy')
                ->defaultValue('master')
            ->end()
            ->scalarNode('shallow')
                ->info("Whether your VCS should do a \"shallow\" clone of the repository or not - this means a clone with just the latest state of your application (no history).\nIf you're having problems cloning, try setting this to false")
                ->defaultTrue()
            ->end()
            ->scalarNode('submodules')
                ->info("Recursively pull in submodules.\nWorks only with Git")
                ->defaultTrue()
            ->end();
    }
422269
public function getConfigTreeBuilder(): TreeBuilder
    {
        $builder = new TreeBuilder();

        $root = $builder->root('req2cmd');
        $root
            ->children()
                ->append($this->addExtractorNode())
                ->append($this->addCommandBusNode())
                ->append($this->addEventListenersNode())
            ->end();

        return $builder;
    }
1236934
public function leaveNode(Node $node)
    {
        if (!$node instanceof Class_) {
            return null;
        }

        $method = $this->findOrCreateMethod($node, $this->getMethodName());

        $this->replaceMethod($method);

        return $node;
    }
216251
protected function appendChild(Node $node) {
    if ($this->tail === NULL) {
      $this->prependChild($node);
    }
    else {
      $this->insertAfterChild($this->tail, $node);
      $this->tail = $node;
    }
    return $this;
  }
1159030
public function mutate(Node $node)
    {
        $node->value = new Node\Expr\BinaryOp\Greater($node->key, $node->value, $node->getAttributes());
        $node->key = null;

        return $node;
    }
791722
protected function getConnectionsNodes(NodeBuilder $node)
    {
        $node = $node->arrayNode('connections');

        $connections = (array) $this->value('config.connections');
        if (!$connections) {
            $node = $node->useAttributeAsKey('name')->prototype('array');
            $node = $this->getConnectionNode($node, new Fluent());
            $node = $node->end();
        } else {
            $node = $node->children();
            foreach ($connections as $name => $connection) {
                $node = $node->arrayNode($name);
                $node = $this->getConnectionNode($node, new Fluent($connection));
                $node = $node->end();
            }
            $node = $node->end();
        }

        return $node->end();
    }
238809
public function setNode(NodeInterface $node = null)
    {
        $this->node = $node;

        if ($node->getMenu() !== $this) {
            $node->setMenu($this);
        }

        return $this;
    }
1365229
public function mutate(Node $node)
    {
        /* @var ClassMethod $node */
        return new ClassMethod(
            $node->name,
            [
                'flags' => ($node->flags & ~Class_::MODIFIER_PUBLIC) | Class_::MODIFIER_PROTECTED,
                'byRef' => $node->returnsByRef(),
                'params' => $node->getParams(),
                'returnType' => $node->getReturnType(),
                'stmts' => $node->getStmts(),
            ],
            $node->getAttributes()
        );
    }
561449
private function addLoaderConfiguration(NodeBuilder $node)
    {
        $children = $node
            ->arrayNode('loaders')
            ->addDefaultsIfNotSet()
            ->children();

        $this->applyConfigurationFromClass(LoaderInterface::class, $children);
        $children->end();
    }
504503
public function pipe($node)
    {
        array_push($this->destinations, $node);
        $node->source($this);
        return $node;
    }
174311
public function create(DOMElement $node)
    {
        $item = new Item();
        $this->setProperties($node, $item);
        $this->setDate($node, $item);
        $this->setTags($node, $item);
        $this->executeAggregators($node, $item);

        return $item;
    }
185810
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
    {
        $nodeEvent = new NodeEvent($node);
        $this->trigger($nodeEvent);
        $node = $nodeEvent->getNode();

        $this->currentNode = $node;

        foreach ($this->nodeCompilers as $className => $compiler) {
            if (is_a($node, $className)) {
                if (!($compiler instanceof NodeCompilerInterface)) {
                    $compiler = $this->getNamedCompiler($compiler);
                }

                $element = $compiler->compileNode($node, $parent);

                if ($element instanceof ElementInterface && !($element instanceof BlockElement)) {
                    $elementEvent = new ElementEvent($nodeEvent, $element);
                    $this->trigger($elementEvent);
                    $element = $elementEvent->getElement();
                }

                return $element;
            }
        }

        $this->throwException(
            'No compiler found able to compile '.get_class($node),
            $node
        );
    }
1172133
protected function getAdminConfigTreeBuilder(): NodeDefinition
    {
        $builder = new TreeBuilder();
        $node = $builder->root('configurations');
        $adminDefinition = $node
            ->useAttributeAsKey('code')
            ->prototype('array')
            ->performNoDeepMerging()
            ->children();

        $this->appendAdminDefinition($adminDefinition);

        $adminDefinition->end()
            ->end()
            ->end();

        return $node;
    }
648401
public function mutate(Node $node)
    {
        $floatValue = $node->expr instanceof Node\Expr\UnaryMinus
            ? -$node->expr->expr->value
            : $node->expr->value;

        return new Node\Stmt\Return_(
            new Node\Scalar\DNumber(-1 * $floatValue, $node->getAttributes())
        );
    }
1254966
public function createRoot(Node $node)
    {
        if($node instanceof NodeWrapper)
        {
            throw new \InvalidArgumentException('Can\'t create a root node from a NodeWrapper node');
        }

        $node->setLeftValue(1);
        $node->setRightValue(2);

        if($this->getConfiguration()->hasManyRoots())
        {
            $rootValue = $node->getId();
            if($rootValue === null)
            {
                // Set a temporary value in case wrapped node requires root value to be set
                $node->setRootValue(0);
                $this->getEntityManager()->persist($node);
                $this->getEntityManager()->flush();
                $rootValue = $node->getId();
            }

            if($rootValue === null)
            {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException('Node must have an identifier available via getId()');
                // @codeCoverageIgnoreEnd
            }

            $node->setRootValue($rootValue);
        }


        $this->getEntityManager()->persist($node);
        $this->getEntityManager()->flush();

        return $this->wrapNode($node);
    }
769594
public function addToArrayNode(AbstractNode $node): QueryBuilderInterface
    {
        if (!$this->node instanceof ArrayNode) {
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
        }

        $this->node->add($node);
        $this->reassignParent($node);

        return $this;
    }
670201
public function getConfigTreeBuilder(): TreeBuilder
    {
        $rootName = $this->getRootName();
        if (method_exists(TreeBuilder::class, 'getRootNode')) {
            $treeBuilder = /* @scrutinizer ignore-call */ new TreeBuilder($rootName);
            $rootNode = /* @scrutinizer ignore-call */ $treeBuilder->getRootNode();
        } else {
            $treeBuilder = new TreeBuilder();
            $rootNode = $treeBuilder->Root($rootName);
        }
        $this->build($rootNode);

        return $treeBuilder;
    }