本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\NodeBuilder::booleanNode方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeBuilder::booleanNode方法的具体用法?PHP NodeBuilder::booleanNode怎么用?PHP NodeBuilder::booleanNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Config\Definition\Builder\NodeBuilder
的用法示例。
在下文中一共展示了NodeBuilder::booleanNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addClientConfiguration
/**
* @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $node
*/
private function addClientConfiguration(NodeBuilder $node)
{
$node->scalarNode('id')->isRequired()->cannotBeEmpty()->info('Your Billomat Id')->example('company_name');
$node->scalarNode('api_key')->isRequired()->cannotBeEmpty()->info('Your Billomat API key')->example('12345abc67890def12345abc67890def');
$children = $node->arrayNode('application')->addDefaultsIfNotSet()->children();
$this->addApplicationConfiguration($children);
$node->booleanNode('wait_for_rate_limit_reset')->defaultFalse()->info('Wait for rate limit reset if rate limit is reached during a request');
$node->booleanNode('async')->defaultFalse()->info('Use asynchronous requests with the Guzzle Async Plugin');
}
示例2: addGeneralSection
private function addGeneralSection(NodeBuilder $pluginSection)
{
$plugin = $this->plugin;
$pluginFqcn = get_class($plugin);
$imgFolder = $plugin->getImgFolder();
$ds = DIRECTORY_SEPARATOR;
$pluginSection->booleanNode('has_options')->defaultFalse()->end()->scalarNode('icon')->validate()->ifTrue(function ($v) use($plugin) {
return !call_user_func_array(__CLASS__ . '::isIconValid', array($v, $plugin));
})->thenInvalid($pluginFqcn . " : this file was not found ({$imgFolder}{$ds}%s)")->end()->end()->end();
}
示例3: addConfiguration
public function addConfiguration(NodeBuilder $node)
{
$node->scalarNode('key')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_provider')->end();
foreach ($this->options as $name => $value) {
if (is_bool($value)) {
$node->booleanNode($name)->defaultValue($value);
} else {
$node->scalarNode($name)->defaultValue($value);
}
}
}
示例4: addConfiguration
public function addConfiguration(NodeBuilder $node)
{
$node->scalarNode('provider')->end()->booleanNode('remember_me')->defaultTrue()->end()->scalarNode('success_handler')->end()->scalarNode('failure_handler')->end();
foreach ($this->options as $name => $default) {
if (is_bool($default)) {
$node->booleanNode($name)->defaultValue($default);
} else {
$node->scalarNode($name)->defaultValue($default);
}
}
}
示例5: addDefinitions
/**
* Adds the definitions.
*
* @param NodeBuilder $node The node builder.
*/
public function addDefinitions(NodeBuilder $node)
{
$node->booleanNode('uuid_handler')->info('Enable the UUID serialization handler for JMS?')->defaultTrue();
}