@param NodeBuilder $node

@return NodeBuilder
771819
protected function getChildren(NodeBuilder $node)
    {
        $node = $this->getCredentialsNodes($node);
        $node = $this->getOptionsNodes($node);

        return $node;
    }
540558
public function append(NodeDefinition $node)
    {
        if ($node instanceof ParentNodeDefinitionInterface) {
            $builder = clone $this;
            $builder->setParent(null);
            $node->setBuilder($builder);
        }

        if (null !== $this->parent) {
            $this->parent->append($node);
            // Make this builder the node parent to allow for a fluid interface
            $node->setParent($this);
        }

        return $this;
    }
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);
    }
47794
public function addNode(NodeInterface $node): NodeInterface
    {
        $this->_nodes[$node->getId()] = $node;

        if ($this->getParent()) {
            $this->getParent()->addNode($node);
        }

        return $this;
    }
202034
private function addNodeJSConfiguration(NodeBuilder $node)
    {
        $node
            ->arrayNode('node')
            ->addDefaultsIfNotSet()
            ->children()
                ->arrayNode('binary')
                    ->addDefaultsIfNotSet()
                    ->beforeNormalization()
                    ->ifString()
                        ->then(function ($value) {
                            return [
                                'win32'     => $value,
                                'win64'     => $value,
                                'linux_x32' => $value,
                                'linux_x64' => $value,
                                'darwin'    => $value,
                                'fallback'  => $value,
                            ];
                        })
                    ->end()
                    ->children()
                        ->scalarNode('win32')->defaultValue('node')->end()
                        ->scalarNode('win64')->defaultValue('node')->end()
                        ->scalarNode('linux_x32')->defaultValue('node')->end()
                        ->scalarNode('linux_x64')->defaultValue('node')->end()
                        ->scalarNode('darwin')->defaultValue('node')->end()
                        ->scalarNode('fallback')->defaultValue('node')->end()
                    ->end()
                ->end()
                ->scalarNode('npm_packages_path')->defaultNull()->end()
                ->scalarNode('node_modules_path')->defaultNull()->end()
            ->end();
    }
244493
public function addNode(Node $node): self
    {
        $this->nodes[] = $node;
        $this->nodesByType[$node::NODE_TYPE][] = $node;
        return $this;
    }
1295262
public function mutate(Node $node)
    {
        return new Node\Stmt\Foreach_(
            new Node\Expr\Array_(),
            $node->valueVar,
            [
                'keyVar' => $node->keyVar,
                'byRef' => $node->byRef,
                'stmts' => $node->stmts,
            ],
            $node->getAttributes()
        );
    }
744729
protected function getChildren(NodeBuilder $node)
    {
        return $node
            ->scalarNode('check')
                ->info('Which strategy to use to check the server')
                ->defaultValue('Polyglot')
            ->end()
            ->scalarNode('create-release')
                ->info('Which strategy to use to create a new release and prepare its dependencies')
                ->defaultValue('Clone')
            ->end()
            ->scalarNode('deploy')
                ->info('Which strategy to use to send a release online')
                ->defaultValue('Rolling')
            ->end()
            ->scalarNode('rollback')
                ->info('Which strategy to use to rollback to a previous release')
                ->defaultValue('Rolling')
            ->end()
            ->scalarNode('test')
                ->info('Which strategy to use to test your application')
                ->defaultValue('Phpunit')
            ->end()
            ->scalarNode('migrate')
                ->info('Which strategy to use to migrate your database')
            ->end()
            ->scalarNode('dependencies')
                ->info("Which strategy to use to install your application's dependencies")
                ->defaultValue('Polyglot')
            ->end();
    }
759709
public function nodeCreate($node)
    {
        $this->dispatchHooks('BeforeNodeCreateScope', $node);
        $this->parseEntityFields('node', $node);
        $saved = $this->getDriver()->createNode($node);
        $this->dispatchHooks('AfterNodeCreateScope', $saved);
        $this->nodes[] = $saved;
        return $saved;
    }
852576
private function hydrateZonesNode(NodeBuilder $node)
    {
        $node
            ->booleanNode('main')
                ->defaultFalse()
            ->end()
            ->booleanNode('virtual')
                ->defaultFalse()
            ->end()
            ->arrayNode('aggregation')
                ->addDefaultsIfNotSet()
                ->beforeNormalization()
                    ->always(function ($v) {
                        if (is_string($v)) {   // shortcut case
                            $v = array('type' => $v);
                        }
                        if (is_array($v) && !empty($v['path'])) {   // path shortcut case
                            $v['type'] = 'template';
                        }

                        return $v;
                    })
                ->end()
                ->children()
                    ->scalarNode('type')
                        ->defaultValue('inline')
                        ->cannotBeEmpty()
                    ->end()
                    ->scalarNode('path')->end()
                ->end()
            ->end()
        ;

        return $node;
    }
561449
private function addLoaderConfiguration(NodeBuilder $node)
    {
        $children = $node
            ->arrayNode('loaders')
            ->addDefaultsIfNotSet()
            ->children();

        $this->applyConfigurationFromClass(LoaderInterface::class, $children);
        $children->end();
    }
1356310
public function mutate(Node $node)
    {
        if ($node->value === 0) {
            return new Node\Scalar\LNumber(1);
        }

        return new Node\Scalar\LNumber(0);
    }
464154
public function selectNode(string $node = Pool::MASTER): self
    {
        $this->node = $node;

        return $this;
    }
1173404
protected function build($node) {
		return preg_replace_callback(
			'/\{~(.+?)~\}|\{\*(.+?)\*\}|\{\-(.+?)\-\}|'.
			'\{\{(.+?)\}\}((\r?\n)*)/s',
			function($expr) {
				if ($expr[1])
					$str='<?php '.$this->token($expr[1]).' ?>';
				elseif ($expr[2])
					return '';
				elseif ($expr[3])
					$str=$expr[3];
				else {
					$str='<?= ('.trim($this->token($expr[4])).')'.
						($this->interpolation?
							(!empty($expr[6])?'."'.$expr[6].'"':''):'').' ?>';
					if (isset($expr[5]))
						$str.=$expr[5];
				}
				return $str;
			},
			$node
		);
	}
310170
protected function getOverridesNodes(NodeBuilder $node)
    {
        return $node
            ->arrayNode('on')
                ->info(<<< 'EOF'
In this section you can fine-tune the above configuration according
to the stage or connection currently in use.
Per example :
'stages' => [
    'staging' => [
        'vcs' => ['branch' => 'staging'],
    ],
     'production' => [
       'vcs' => ['branch' => 'master'],
     ],
],
EOF
                )
                ->children()
                    ->arrayNode('stages')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->prototype('variable')->end()
                        ->end()
                    ->end()
                    ->arrayNode('connections')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->prototype('variable')->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
1336487
public function append($node)
    {
        $current = $this->getCurrentNode();

        $current
            ? $current->appendChild($node)
            : $this->setCurrentNode($node);

        return $this;
    }
1071852
public function getConfigTreeBuilder() : TreeBuilder
    {
        $builder = new TreeBuilder($this->alias);

        if (method_exists($builder, 'getRootNode')) {
            $root = $builder->getRootNode();
        } else {
            // BC layer for symfony/config 4.1 and older
            $root = $builder->root($this->alias);
        }

        $root
            ->children()
                ->append($this->createClientsNode())
                ->booleanNode('logging')->defaultValue($this->debug)->end()
                ->booleanNode('profiling')->defaultValue($this->debug)->end()
                ->integerNode('slow_response_time')->defaultValue(0)->end()
                ->end()
            ->end();

        return $builder;
    }