本文整理匯總了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();
}