当前位置: 首页>>代码示例>>PHP>>正文


PHP NodeDefinition::children方法代码示例

本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\NodeDefinition::children方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeDefinition::children方法的具体用法?PHP NodeDefinition::children怎么用?PHP NodeDefinition::children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Config\Definition\Builder\NodeDefinition的用法示例。


在下文中一共展示了NodeDefinition::children方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node
         ->children()
         ->end()
     ;
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:7,代码来源:NullAdapterFactory.php

示例2: getConfigTreeExtension

 /**
  * 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:29,代码来源:Range.php

示例3: addHandlersSection

 /**
  * @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);
     }
 }
开发者ID:Heyfara,项目名称:ezpublish-kernel,代码行数:14,代码来源:Configuration.php

示例4: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node
         ->children()
             ->scalarNode('client')->isRequired()->end()
         ->end()
     ;
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:8,代码来源:GridFSFactory.php

示例5: getConfigTreeExtension

 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:9,代码来源:MockDatasource.php

示例6: getConfigTreeExtension

 /**
  * 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:13,代码来源:BooleanType.php

示例7: getConfigTreeExtension

 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:9,代码来源:PickSelector.php

示例8: getConfigTreeExtension

 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:9,代码来源:RandomSelector.php

示例9: configureNode

 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.");
 }
开发者ID:keboola,项目名称:input-mapping,代码行数:9,代码来源:File.php

示例10: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node
         ->children()
             ->scalarNode('container')->isRequired()->end()
             ->scalarNode('prefix')->defaultNull()->end()
         ->end()
     ;
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:9,代码来源:RackspaceFactory.php

示例11: addConfiguration

 public function addConfiguration(NodeDefinition $node)
 {
     $node
         ->children()
             ->scalarNode('client')->isRequired()->end()
             ->scalarNode('key')->defaultValue('flysystem')->end()
             ->scalarNode('expires')->defaultNull()->end()
         ->end()
     ;
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:10,代码来源:MemcachedFactory.php

示例12: getConfigTreeExtension

 /**
  * 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:14,代码来源:ConstantNumber.php

示例13: addConfiguration

 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);
         }
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:12,代码来源:AbstractFactory.php

示例14: addConfiguration

 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);
         }
     }
 }
开发者ID:nickaggarwal,项目名称:sample-symfony2,代码行数:12,代码来源:RememberMeFactory.php

示例15: getConfigTreeExtension

 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;
 }
开发者ID:icomefromthenet,项目名称:faker,代码行数:13,代码来源:AlternateSelector.php


注:本文中的Symfony\Component\Config\Definition\Builder\NodeDefinition::children方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。