@param NodeDefinition $node
@param string         $driver
@param string         $option

@return self
438650
private function validateDriver(NodeDefinition $node, $driver, $option)
    {
        $node
            ->validate()
                ->ifTrue(function ($v) use ($driver, $option) {
                    return $driver === $v['driver'] && empty($v['options'][$option]);
                })
                ->thenInvalid(sprintf('The "%s" option must be defined when using the "%s" driver.', $option, $driver))
            ->end()
        ;

        return $this;
    }
1102122
public static function directiveDefinition(Node $definitionNode, string $name): ?DirectiveNode
    {
        return (new Collection($definitionNode->directives))
            ->first(function (DirectiveNode $directiveDefinitionNode) use ($name): bool {
                return $directiveDefinitionNode->name->value === $name;
            });
    }
51552
private function mapParent($document, NodeInterface $node, $options = [])
    {
        // TODO: performance warning: We are eagerly fetching the parent node
        $targetNode = $node->getParent();

        // Do not map non-referenceable parent nodes
        if (!$targetNode->hasProperty('jcr:uuid')) {
            return;
        }

        $document->setParent($this->proxyFactory->createProxyForNode($document, $targetNode, $options));
    }
38903
public function addFieldToQueryType(FieldDefinitionNode $field): self
    {
        $query = $this->queryTypeDefinition();
        $query->fields = ASTHelper::mergeNodeList($query->fields, [$field]);

        $this->setDefinition($query);

        return $this;
    }
62151
protected function createDriverNode($default = null)
    {
        $builder = new TreeBuilder();
        $node = $builder->root('driver', 'enum');

        if ($default) {
            $node->defaultValue($default);
        }

        $node
            ->values(array(
                SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
                SyliusResourceBundle::DRIVER_DOCTRINE_MONGODB_ODM,
                SyliusResourceBundle::DRIVER_DOCTRINE_PHPCR_ODM,
            ))
            ->cannotBeEmpty()
            ->info(sprintf(
                'Database driver (%s, %s or %s)',
                SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
                SyliusResourceBundle::DRIVER_DOCTRINE_MONGODB_ODM,
                SyliusResourceBundle::DRIVER_DOCTRINE_PHPCR_ODM
            ))
            ->end()
        ;

        return $node;
    }
1273878
private function createNodeRelation($node1, $node2, $options)
    {
        $relation = $node1 . ' -> ' . $node2 . ' [';
        foreach ($options as $key => $value) {
            $relation .= $key . '=' . $value . ' ';
        }
        $relation .= "]\n";

        return $relation;
    }
823946
public function setDriver($dsn, array $config = [], array $options = [])
    {
        $class = '\Micro\Db\Drivers\\'.ucfirst(substr($dsn, 0, strpos($dsn, ':'))).'Driver';

        if (!class_exists($class)) {
            throw new Exception('DB driver `'.$class.'` not supported');
        }

        unset($this->driver);

        $this->driver = new $class($dsn, $config, $options);
    }
619399
public function execute(Node $node, Application $application, Deployment $deployment, array $options = [])
    {
        $sourceNode = $this->nodeFactory->getNodeByArray($options['sourceNode']);
        $credentials = $this->getCredentials($sourceNode, $deployment, $options['sourceNodeOptions'], $application);
        $dumpFile = $this->getDumpFile($options['sourceNodeOptions'], $credentials);
        $this->shell->executeOrSimulate('rm '.$dumpFile, $sourceNode, $deployment);

        $credentials = $this->getCredentials($node, $deployment, $options, $application);
        $dumpFile = $this->getDumpFile($options, $credentials);
        $this->shell->executeOrSimulate('rm '.$dumpFile, $node, $deployment);
    }
1140621
public void addChild(DriverNode dn){
    collectorProcessor.getChildren().add(dn.operator);
    children.add(dn);
  }
1140299
@NonNull
  public SelfT withNodeFilter(@NonNull Predicate<Node> nodeFilter) {
    return withNodeFilter(DriverExecutionProfile.DEFAULT_NAME, nodeFilter);
  }
775872
public static function set($name, $value = '', $option = null) {
        self::driver()->set($name, $value, $option);
    }
161813
public function enterNode(Node $node, Environment $environment): Node
    {
        if ($node instanceof ModelNode) {
            $this->assign($node->getSourceContext(), $node->getAttribute('presentation_model'));
        }

        return $node;
    }
1129146
public static function getDsn($driver, $options = [])
    {
        self::$options = $options;

        if (!is_callable([static::class, $driver])) {
            throw new \DomainException('The ' . $driver . ' driver is not supported.');
        }

        list($dsn, $replace) = static::$driver();

        $dsn = strtr($dsn, $replace);

        self::$options = [];

        return $dsn;
    }
596181
protected function lexOperationTypeDefinition(): OperationTypeDefinitionNode
    {
        $start = $this->lexer->getToken();

        $operation = $this->lexOperationType();

        $this->expect(TokenKindEnum::COLON);

        return new OperationTypeDefinitionNode(
            $operation,
            $this->lexNamedType(),
            $this->createLocation($start)
        );
    }
1057733
protected function addMappingNode(
        string $nodeName,
        string $entityClass,
        string $entityMappingFile,
        string $entityManager,
        bool $entityEnabled
    ): NodeDefinition {
        $builder = new TreeBuilder();
        $node = $builder->root($nodeName);
        $node
            ->treatFalseLike([
                'enabled' => false,
            ])
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('class')
                    ->defaultValue($entityClass)
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('mapping_file')
                    ->defaultValue($entityMappingFile)
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('manager')
                    ->defaultValue($entityManager)
                    ->cannotBeEmpty()
                ->end()
                ->booleanNode('enabled')
                    ->defaultValue($entityEnabled)
                ->end()
            ->end()
        ->end();

        return $node;
    }
218217
private function normalizeEnabled(NodeDefinition $node)
    {
        $node->beforeNormalization()
                ->always()
                ->then(
                    function ($v) {
                        if (is_string($v['enabled'])) {
                            $v['enabled'] = $v['enabled'] === 'true';
                        }
                        if (is_int($v['enabled'])) {
                            $v['enabled'] = $v['enabled'] === 1;
                        }

                        return $v;
                    }
                )
            ->end();

        return $this;
    }
1189109
private function configureDbalDriverNode(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->scalarNode('url')->info('A URL with connection information; any parameter value parsed from this string will override explicitly set parameters')->end()
                ->scalarNode('dbname')->end()
                ->scalarNode('host')->defaultValue('localhost')->end()
                ->scalarNode('port')->defaultNull()->end()
                ->scalarNode('user')->defaultValue('root')->end()
                ->scalarNode('password')->defaultNull()->end()
                ->scalarNode('application_name')->end()
                ->scalarNode('charset')->end()
                ->scalarNode('path')->end()
                ->booleanNode('memory')->end()
                ->scalarNode('unix_socket')->info('The unix socket to use for MySQL')->end()
                ->booleanNode('persistent')->info('True to use as persistent connection for the ibm_db2 driver')->end()
                ->scalarNode('protocol')->info('The protocol to use for the ibm_db2 driver (default to TCPIP if ommited)')->end()
                ->booleanNode('service')
                    ->info('True to use SERVICE_NAME as connection parameter instead of SID for Oracle')
                ->end()
                ->scalarNode('servicename')
                    ->info(
                        'Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter ' .
                        'for Oracle depending on the service parameter.'
                    )
                ->end()
                ->scalarNode('sessionMode')
                    ->info('The session mode to use for the oci8 driver')
                ->end()
                ->scalarNode('server')
                    ->info('The name of a running database server to connect to for SQL Anywhere.')
                ->end()
                ->scalarNode('default_dbname')
                    ->info(
                        'Override the default database (postgres) to connect to for PostgreSQL connexion.'
                    )
                ->end()
                ->scalarNode('sslmode')
                    ->info(
                        'Determines whether or with what priority a SSL TCP/IP connection will be negotiated with ' .
                        'the server for PostgreSQL.'
                    )
                ->end()
                ->scalarNode('sslrootcert')
                    ->info(
                        'The name of a file containing SSL certificate authority (CA) certificate(s). ' .
                        'If the file exists, the server\'s certificate will be verified to be signed by one of these authorities.'
                    )
                ->end()
                ->scalarNode('sslcert')
                    ->info(
                        'The path to the SSL client certificate file for PostgreSQL.'
                    )
                ->end()
                ->scalarNode('sslkey')
                    ->info(
                        'The path to the SSL client key file for PostgreSQL.'
                    )
                ->end()
                ->scalarNode('sslcrl')
                    ->info(
                        'The file name of the SSL certificate revocation list for PostgreSQL.'
                    )
                ->end()
                ->booleanNode('pooled')->info('True to use a pooled server with the oci8/pdo_oracle driver')->end()
                ->booleanNode('MultipleActiveResultSets')->info('Configuring MultipleActiveResultSets for the pdo_sqlsrv driver')->end()
                ->booleanNode('use_savepoints')->info('Use savepoints for nested transactions')->end()
                ->scalarNode('instancename')
                ->info(
                    'Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection.' .
                    ' It is generally used to connect to an Oracle RAC server to select the name' .
                    ' of a particular instance.'
                )
                ->end()
                ->scalarNode('connectstring')
                ->info(
                    'Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.' .
                    'When using this option, you will still need to provide the user and password parameters, but the other ' .
                    'parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods' .
                    ' from Doctrine\DBAL\Connection will no longer function as expected.'
                )
                ->end()
            ->end()
            ->beforeNormalization()
                ->ifTrue(static function ($v) {
                    return ! isset($v['sessionMode']) && isset($v['session_mode']);
                })
                ->then(static function ($v) {
                    $v['sessionMode'] = $v['session_mode'];
                    unset($v['session_mode']);

                    return $v;
                })
            ->end()
            ->beforeNormalization()
                ->ifTrue(static function ($v) {
                    return ! isset($v['MultipleActiveResultSets']) && isset($v['multiple_active_result_sets']);
                })
                ->then(static function ($v) {
                    $v['MultipleActiveResultSets'] = $v['multiple_active_result_sets'];
                    unset($v['multiple_active_result_sets']);

                    return $v;
                })
            ->end();
    }