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


PHP ArrayNodeDefinition::info方法代码示例

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


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

示例1: getConfigTreeBuilder

 /**
  * Generates the configuration tree builder.
  *
  * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
  */
 public function getConfigTreeBuilder()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('web_sms');
     $connection = new ArrayNodeDefinition('connection');
     $login = new ScalarNodeDefinition('login');
     $secret = new ScalarNodeDefinition('secret');
     $sendMode = new ScalarNodeDefinition('mode');
     $sendMode->defaultValue(AbstractWebSMSConnection::TEST_DISABLED);
     $connection->children()->append($login->info('login')->isRequired())->append($secret->info('secret')->isRequired())->append($sendMode->info('Test mode')->example(array('-1 for special testing (no auth checked)', '1 for usual testing (no sending occurs, no charge for sending)', '0 for production sending')))->end();
     $rootNode->children()->append($connection->info('WebSMS connection parameters'))->end();
     return $treeBuilder;
 }
开发者ID:scaytrase,项目名称:symfony-websms-bundle,代码行数:18,代码来源:Configuration.php

示例2: addConfiguration

 public function addConfiguration(ArrayNodeDefinition $node)
 {
     $node->info('Handler based on league/flysystem, an abstract filesystem library. ' . 'Yes, the metadata handler and binarydata handler look the same; it is NOT a mistake :)')->children()->scalarNode('adapter')->info('Flysystem adapter identifier. Should be configured using oneup flysystem bundle. ' . 'Yes, the same adapter can be used for a binarydata and metadata handler')->isRequired()->example('nfs')->end()->end();
 }
开发者ID:Heyfara,项目名称:ezpublish-kernel,代码行数:4,代码来源:Flysystem.php

示例3: buildEntitiesPropertiesNode

 private function buildEntitiesPropertiesNode()
 {
     $entitiesPropertiesNode = new ArrayNodeDefinition('properties');
     $prototype = $entitiesPropertiesNode->info('List of properties of entity')->prototype('array');
     foreach ($this->treeConfigurators as $configurator) {
         foreach ((array) $configurator->appendEntitiesPropertiesNode() as $node) {
             $prototype->append($node);
         }
     }
     $prototype->children()->scalarNode('type')->info('type of data, standard type of other entity name')->example('DateTime')->cannotBeEmpty()->beforeNormalization()->always(function ($v) {
         return strtolower($v);
     })->end()->validate()->ifTrue(function ($v) {
         return !$this->typeFactory->isValidType($v);
     })->thenInvalid('Invalid Type %s')->end()->end()->scalarNode('cardinality')->info('type of cardinality OneToMany, ManyToMany')->example('(0..1)')->cannotBeEmpty()->end()->scalarNode('accessorPrefix')->info('Prefix used has accessor method : prefixPropertieName')->example('is, has, get')->defaultValue('get')->end()->scalarNode('enum')->info('Name of target enum')->cannotBeEmpty()->end()->scalarNode('entity')->info('name of target entity')->example('DateTime')->cannotBeEmpty()->end()->scalarNode('inverse')->info('define oposite property in cas of relation')->example('MyEntity::propertieName')->cannotBeEmpty()->end()->booleanNode('nullable')->info('Is this propertie is nullable?')->defaultFalse()->end()->booleanNode('primary')->info('Is this propertie is primary key ?')->defaultFalse()->end()->booleanNode('autoincrement')->info('Is this propertie is auto incremented ?')->defaultFalse()->end()->booleanNode('unique')->info('Is this propertie is unique?')->defaultFalse()->end()->variableNode('default')->info('Default value of propertie')->end()->integerNode('length')->info('Max length for string type')->min(0)->end()->integerNode('precision')->info('Number of decimal for float type')->min(1)->max(15)->end();
     $entitiesPropertiesNode->end();
     return $entitiesPropertiesNode;
 }
开发者ID:alborq,项目名称:schema-generator,代码行数:17,代码来源:ConfigurationTree.php

示例4: appendRootNode

 /**
  * You can build node, then it's append into the main tree.
  *
  * @return ArrayNodeDefinition[] An array of NodeDefinition
  */
 public function appendRootNode()
 {
     $node = new ArrayNodeDefinition('doctrine');
     $node->info('doctrine configuration')->prototype('array')->children()->scalarNode('InheritanceType')->defaultValue('SINGLE_TABLE')->end()->end();
     return [$node];
 }
开发者ID:alborq,项目名称:schema-generator,代码行数:11,代码来源:DoctrinePropertyAnnotationGenerator.php

示例5: addConfiguration

 public function addConfiguration(ArrayNodeDefinition $node)
 {
     $node->info('A MySQL based handler, compatible with the legacy DFS one, that stores metadata in the ezdfsfile table')->children()->scalarNode('connection')->info('Doctrine connection service')->example('doctrine.dbal.cluster_connection')->end()->end();
 }
开发者ID:Heyfara,项目名称:ezpublish-kernel,代码行数:4,代码来源:LegacyDFSCluster.php

示例6: appendRootNode

 /**
  * You can build node, then it's append into the main tree.
  *
  * @return ArrayNodeDefinition[] An array of NodeDefinition
  */
 public function appendRootNode()
 {
     $node = new ArrayNodeDefinition('rdfa');
     $node->info('RDFa files')->defaultValue([['uri' => self::SCHEMA_ORG_RDFA_URL, 'format' => null]])->beforeNormalization()->ifArray()->then(function (array $v) {
         return array_map(function ($rdfa) {
             return is_scalar($rdfa) ? ['uri' => $rdfa, 'format' => null] : $rdfa;
         }, $v);
     })->end()->prototype('array')->children()->scalarNode('uri')->info('RDFa URI to use')->defaultValue(self::SCHEMA_ORG_RDFA_URL)->example(self::SCHEMA_ORG_RDFA_URL)->end()->scalarNode('format')->info('RDFa URI data format')->defaultNull()->example('rdfxml')->end()->end()->end();
     return [$node];
 }
开发者ID:alborq,项目名称:schema-generator,代码行数:15,代码来源:RdfaResolver.php

示例7: getRateTypeDefinition

 /**
  * Build configuration tree for "RunOpenCode\Bundle\ExchangeRate\Form\Type\RateType" default settings.
  *
  * @return ArrayNodeDefinition
  */
 protected function getRateTypeDefinition()
 {
     $node = new ArrayNodeDefinition('rate_type');
     $node->info('Modify default "RunOpenCode\\Bundle\\ExchangeRate\\Form\\Type\\RateType" settings.')->addDefaultsIfNotSet()->children()->scalarNode('choice_translation_domain')->defaultValue('roc_exchange_rate')->end()->scalarNode('label_format')->defaultValue('{{currency-code}}, {{rate-type}} ({{source}})')->end()->arrayNode('preferred_choices')->end()->end()->end();
     return $node;
 }
开发者ID:RunOpenCode,项目名称:exchange-rate-bundle,代码行数:11,代码来源:Configuration.php


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