public function addConfiguration(NodeDefinition $node) { $node ->children() ->end() ; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('min')->isRequired()->info('Starting Number')->example('A numeric number like 1 or 1.67 or 0.87')->validate()->ifTrue(function ($v) { return !is_numeric($v); })->then(function ($v) { throw new EngineException('Range::min Numeric is required'); })->end()->end()->scalarNode('max')->isRequired()->example('A numeric number like 1 or 1.67 or 0.87')->info('The maxium to use in range')->validate()->ifTrue(function ($v) { return !is_numeric($v); })->then(function ($v) { throw new EngineException('Range::max Numeric is required'); })->end()->end()->scalarNode('step')->defaultValue(false)->example('1 , 1.5 , 0.6')->info('Stepping value applied on every increment, not supplied will use random')->validate()->ifTrue(function ($v) { return !(is_numeric($v) || $v === false); })->then(function ($v) { throw new EngineException('Range::Step option should be numeric or bool(false) to use random step'); })->end()->end()->scalarNode('windowStep')->info('Value to add to the base after the iteration has finished (reached max)')->example(1)->defaultValue(0)->validate()->ifTrue(function ($x) { return !is_numeric($x); })->then(function ($x) { throw new EngineException('Range:: windowStep must be an number'); })->end()->end()->booleanNode('random')->defaultFalse()->example('false|true')->info('Enable random step value on every loop, step param must be set to false')->end()->scalarNode('round')->defaultValue(0)->example('an integer')->info('number of places to round too')->validate()->ifTrue(function ($v) { return !(is_integer($v) && $v > 0); })->then(function ($v) { throw new EngineException('Range::Round option should be a positive integer >= 0'); })->end()->end()->end(); return $rootNode; }
/** * @param NodeDefinition $node * @param $name * @param string $info block info line * @param ConfigurationFactory[]|ArrayObject $factories */ private function addHandlersSection(NodeDefinition $node, $name, $info, ArrayObject &$factories) { $handlersNodeBuilder = $node->children()->arrayNode($name)->info($info)->useAttributeAsKey('name')->prototype('array')->performNoDeepMerging()->children(); foreach ($factories as $name => $factory) { $factoryNode = $handlersNodeBuilder->arrayNode($name)->canBeUnset(); $factory->addConfiguration($factoryNode); } }
public function addConfiguration(NodeDefinition $node) { $node ->children() ->scalarNode('client')->isRequired()->end() ->end() ; }
public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('badOption')->treatNullLike('en')->defaultValue('en')->info('Abad option')->validate()->ifTrue(function ($v) { return $v === 'bad'; })->then(function ($v) { throw new InvalidConfigurationException('BadOption is equal to bad'); })->end()->end(); return $rootNode; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->booleanNode('value')->isRequired()->validate()->ifTrue(function ($v) { return !empty($v); })->then(function ($v) { return (bool) $v; })->end()->info('true or false')->example('true | false')->end()->end(); return $rootNode; }
public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('probability')->isRequired()->info('')->example('0.3 | 0.4 | 0.5')->validate()->ifTrue(function ($v) { return !is_numeric($v) || !($v > 0 && $v < 1); })->then(function ($v) { throw new EngineException('PickSelector::Probability must be between 0 and 1'); })->end()->end()->end(); return $rootNode; }
public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('set')->isRequired()->info('The size of the set to pick from')->example('1 | 2 | 3')->validate()->ifTrue(function ($v) { return !is_integer($v) || (int) $v < 1; })->then(function ($v) { throw new EngineException('RandomSelector::Set size is required and must be and integer > 0'); })->end()->end()->end(); return $rootNode; }
public static function configureNode(NodeDefinition $node) { $node->children()->arrayNode("tags")->prototype("scalar")->end()->end()->scalarNode("query")->end()->booleanNode("filter_by_run_id")->end()->integerNode("limit")->defaultValue(10)->end()->arrayNode("processed_tags")->prototype("scalar")->end()->end()->end()->validate()->ifTrue(function ($v) { if ((!isset($v["tags"]) || count($v["tags"]) == 0) && !isset($v["query"])) { return true; } return false; })->thenInvalid("At least one of 'tags' or 'query' parameters must be defined."); }
public function addConfiguration(NodeDefinition $node) { $node ->children() ->scalarNode('container')->isRequired()->end() ->scalarNode('prefix')->defaultNull()->end() ->end() ; }
public function addConfiguration(NodeDefinition $node) { $node ->children() ->scalarNode('location')->isRequired()->end() ->scalarNode('archive')->defaultNull()->end() ->end() ; }
public function addConfiguration(NodeDefinition $node) { $node ->children() ->scalarNode('client')->isRequired()->end() ->scalarNode('key')->defaultValue('flysystem')->end() ->scalarNode('expires')->defaultNull()->end() ->end() ; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('value')->isRequired()->info('The constant value to use')->end()->scalarNode('type')->info('Cast to use')->example('string|boolean|integer|float|double')->defaultValue('integer')->validate()->ifTrue(function ($v) { $valid_values = array(\Faker\Components\Engine\Common\Type\ConstantNumber::INTTYPE, \Faker\Components\Engine\Common\Type\ConstantNumber::STRINGTYPE, \Faker\Components\Engine\Common\Type\ConstantNumber::BOOLTYPE, \Faker\Components\Engine\Common\Type\ConstantNumber::BOOLEANTYPE, \Faker\Components\Engine\Common\Type\ConstantNumber::FLOATTYPE, \Faker\Components\Engine\Common\Type\ConstantNumber::DOUBLETYPE); return !in_array($v, $valid_values); })->then(function ($v) { throw new EngineException('Constant::Type Option not in valid list'); })->end()->end()->end(); return $rootNode; }
public function addConfiguration(NodeDefinition $node) { $builder = $node->children(); $builder->scalarNode('provider')->end()->booleanNode('remember_me')->defaultTrue()->end()->scalarNode('success_handler')->end()->scalarNode('failure_handler')->end(); foreach (array_merge($this->options, $this->defaultSuccessHandlerOptions, $this->defaultFailureHandlerOptions) as $name => $default) { if (is_bool($default)) { $builder->booleanNode($name)->defaultValue($default); } else { $builder->scalarNode($name)->defaultValue($default); } } }
public function addConfiguration(NodeDefinition $node) { $builder = $node->children(); $builder->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end(); foreach ($this->options as $name => $value) { if (is_bool($value)) { $builder->booleanNode($name)->defaultValue($value); } else { $builder->scalarNode($name)->defaultValue($value); } } }
public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('step')->isRequired()->info('The number of passes to make before alternating must be an integer')->example('1 | 2 | 3')->validate()->ifTrue(function ($v) { return !is_integer($v) || (int) $v < 1; })->then(function ($v) { throw new EngineException('AlternateSelector::Step integer is required and must be > 0'); })->end()->end()->scalarNode('set')->isRequired()->info('The size of the set to alternate over')->example('1 | 2 | 3')->validate()->ifTrue(function ($v) { return !is_integer($v) || (int) $v < 1; })->then(function ($v) { throw new EngineException('AlternateSelector::Set integer is required and must be > 0'); })->end()->end()->end(); return $rootNode; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('increment')->defaultValue(1)->info('The increment to add on every loop')->validate()->ifTrue(function ($v) { return !is_numeric($v); })->then(function ($v) { throw new EngineException('AutoIncrement::Increment option must be numeric'); })->end()->end()->scalarNode('start')->validate()->ifTrue(function ($v) { return !is_numeric($v); })->then(function ($v) { throw new EngineException('AutoIncrement::Start option must be numeric'); })->end()->defaultValue(1)->info('The Value to start with')->end()->end(); return $rootNode; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('countries')->defaultValue(array('AU,US,UK'))->info('a list of country codes to use')->example('AU,US,UK')->validate()->ifString()->then(function ($v) { # parse the values into an array $tokens = new TokenIterator($v, ','); $domains = array(); foreach ($tokens as $domain) { $domains[] = $domain; } unset($tokens); return $domains; })->end()->end()->end(); return $rootNode; }
/** * Generates the configuration tree builder. * * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode(self::FORMAT)->info('Text format to use')->example('xxxxx ccccCC')->end()->scalarNode(self::REPEAT_MIN)->info('Minimum number of times to repeat the format')->example('1')->defaultValue(1)->validate()->ifTrue(function ($x) { return !(is_integer($x) && $x >= 0); })->then(function ($x) { $minText = \Faker\Components\Engine\Common\Type\AlphaNumeric::REPEAT_MIN; throw new InvalidConfigurationException('AlphaNumeric::' . $minText . ' value must be an integer greater than or equal to zero'); })->end()->end()->scalarNode(self::REPEAT_MAX)->info('Maximum number of times to repear the format')->example('6')->defaultValue(1)->validate()->ifTrue(function ($x) { return !(is_integer($x) && $x > 0); })->then(function ($x) { $maxText = \Faker\Components\Engine\Common\Type\AlphaNumeric::REPEAT_MAX; throw new InvalidConfigurationException('AlphaNumeric::' . $maxText . ' value must be an integer greater than zero'); })->end()->end()->end(); return $rootNode; }
public function addConfiguration(NodeDefinition $node) { $node->fixXmlConfig('user_provider'); $builder = $node->children(); $builder->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end()->arrayNode('user_providers')->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()->prototype('scalar')->end()->end()->scalarNode('catch_exceptions')->defaultTrue()->end(); foreach ($this->options as $name => $value) { if (is_bool($value)) { $builder->booleanNode($name)->defaultValue($value); } else { $builder->scalarNode($name)->defaultValue($value); } } }
/** * {@inheritDoc} */ public function addConfiguration(NodeDefinition $builder) { $builder ->children() ->scalarNode('service_id')->isRequired()->cannotBeEmpty()->end() ->scalarNode('bucket_name')->isRequired()->cannotBeEmpty()->end() ->arrayNode('options') ->addDefaultsIfNotSet() ->children() ->scalarNode('directory')->defaultValue('')->end() ->booleanNode('create')->defaultFalse()->end() ->scalarNode('acl')->defaultValue('private')->end() ->end() ->end() ->end() ; }
public function addConfiguration(NodeDefinition $node) { $node ->children() ->scalarNode('host')->isRequired()->end() ->scalarNode('port')->defaultValue(22)->end() ->scalarNode('username')->defaultNull()->end() ->scalarNode('password')->defaultNull()->end() ->scalarNode('timeout')->defaultValue(90)->end() ->scalarNode('root')->defaultNull()->end() ->scalarNode('privateKey')->defaultNull()->end() ->scalarNode('permPrivate')->defaultValue(0000)->end() ->scalarNode('permPublic')->defaultNull(0744)->end() ->end() ; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('paragraphs')->defaultValue(4)->info('Text format to use')->validate()->ifTrue(function ($v) { return !is_int($v); })->then(function ($v) { throw new EngineException('Numeric::Paragraphs must be and integer'); })->end()->end()->scalarNode('maxlines')->defaultValue(200)->info('Maxium number of line per paragraph')->example('5 | 10 | ...')->validate()->ifTrue(function ($v) { return !is_integer($v); })->then(function ($v) { throw new EngineException('Numeric::maxlines must be and integer'); })->end()->end()->scalarNode('minlines')->defaultValue(5)->info('Minimum number of lines per paragraph')->example('20 | 100 | ..')->validate()->ifTrue(function ($v) { return !is_integer($v); })->then(function ($v) { throw new EngineException('Numeric::minlines must be and integer'); })->end()->end()->end(); return $rootNode; }
/** * Generates the configuration tree builder. * */ public function getConfigTreeExtension(NodeDefinition $rootNode) { $rootNode->children()->scalarNode('start')->isRequired()->info('The DateTime strtotime to use as base')->example('Auguest 18 1818')->validate()->ifTrue(function ($v) { try { $date = new \DateTime($v); return true; } catch (\Exception $e) { throw new EngineException($e->getMessage()); } })->then(function ($v) { return new \DateTime($v); })->end()->end()->scalarNode('max')->defaultValue(null)->info('The maxium (strtotime) date to use')->example('August 15 2012')->validate()->ifTrue(function ($v) { try { $date = new \DateTime($v); return true; } catch (\Exception $e) { throw new EngineException($e->getMessage()); } })->then(function ($v) { return new \DateTime($v); })->end()->end()->scalarNode('modify')->defaultValue(false)->info('modify string (strtotime) applied on each increment')->example('+1 minute')->end()->booleanNode('random')->defaultValue(false)->info('select a random datetime between min-max')->example('true')->end()->end(); return $rootNode; }
public function addConfiguration(NodeDefinition $node) { $node->children()->scalarNode('provider')->end()->scalarNode('realm')->defaultValue('Secured Area')->end()->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()->end(); }
/** * {@inheritDoc} */ public function addConfiguration(NodeDefinition $node) { $node->children()->scalarNode('directory')->isRequired()->end()->booleanNode('create')->defaultTrue()->end()->end(); }
public function addConfiguration(NodeDefinition $node) { $node->children()->scalarNode('nonce_dir')->defaultValue(null)->end()->scalarNode('lifetime')->defaultValue(300)->end()->scalarNode('provider')->end()->end(); }
/** * {@inheritDoc} */ public function addConfiguration(NodeDefinition $node) { $node->children()->scalarNode('object_store_id')->isRequired()->cannotBeEmpty()->end()->scalarNode('container_name')->isRequired()->cannotBeEmpty()->end()->booleanNode('create_container')->defaultFalse()->end()->booleanNode('detect_content_type')->defaultTrue()->end()->end(); }
/** * @see Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface::addConfiguration() */ public function addConfiguration(NodeDefinition $node) { $builder = $node->children(); $builder->scalarNode('auto_login_user_provider')->defaultNull()->end()->scalarNode('provider')->end()->scalarNode('token_param')->defaultValue('_al')->end()->scalarNode('remember_me')->defaultFalse()->end()->booleanNode('override_already_authenticated')->defaultFalse()->end(); }
/** * Adds configuration of security. * * @param NodeDefinition $node The root node of wsse security. * * @return void */ public function addConfiguration(NodeDefinition $node) { $node->children()->scalarNode('lifetime')->defaultValue(300)->end()->arrayNode('encoder')->addDefaultsIfNotSet()->children()->scalarNode('algorithm')->defaultValue('sha1')->end()->booleanNode('encodeHashAsBase64')->defaultTrue()->end()->end()->end()->end(); }