本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\NodeBuilder::variableNode方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeBuilder::variableNode方法的具体用法?PHP NodeBuilder::variableNode怎么用?PHP NodeBuilder::variableNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Config\Definition\Builder\NodeBuilder
的用法示例。
在下文中一共展示了NodeBuilder::variableNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAddPackageTaskNodes
/**
* Add the nodes for the "add-package" task.
*
* @param NodeBuilder $tasks The node builder.
*
* @return void
*
* @throws \InvalidArgumentException Will be thrown by the nodes when the input was invalid.
*/
private function createAddPackageTaskNodes(NodeBuilder $tasks)
{
$tasks->scalarNode('name')->info('The name of the package to include.')->cannotBeEmpty()->validate()->always($this->enforceTypeStringCheck('Invalid package name %s'));
$tasks->scalarNode('include_require')->info('The dependencies to include or true to include all.')->cannotBeEmpty()->defaultTrue()->validate()->always($this->enforceTypeArrayOrBoolCheck('Invalid value for include_require: %s'));
$tasks->scalarNode('include_requiredev')->info('The dev dependencies to include or true to include all.')->cannotBeEmpty()->defaultFalse()->validate()->always($this->enforceTypeArrayOrBoolCheck('Invalid value for include_requiredev: %s'));
$tasks->arrayNode('exclude_dependencies')->prototype('scalar')->info('The dependencies to exclude.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for exclude_dependencies: %s'));
$tasks->arrayNode('include_files')->prototype('scalar')->info('The files to include.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for include_files: %s'));
$tasks->arrayNode('exclude_files')->prototype('scalar')->info('The files to exclude.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for exclude_files: %s'));
$tasks->arrayNode('rewrite_paths')->prototype('scalar')->info('The paths to rewrite.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->enforceTypeStringCheck('Invalid value for rewrite_paths: %s'));
$tasks->variableNode('package_override')->info('The values to override for certain packages.')->cannotBeEmpty()->defaultValue([])->validate()->always($this->createPackageOverrideMangler());
}
示例2: appendDataGridDefinition
/**
* @param NodeBuilder $dataGridDefinition
*/
protected function appendDataGridDefinition(NodeBuilder $dataGridDefinition)
{
$dataGridDefinition->variableNode('filter_config')->end()->scalarNode('form_theme')->defaultNull()->end()->scalarNode('parent')->defaultNull()->end()->scalarNode('renderer')->defaultNull()->end()->variableNode('actions')->end()->variableNode('submit_button')->defaultValue([])->end()->variableNode('reset_button')->defaultValue([])->end()->arrayNode('columns')->prototype('array')->children()->scalarNode('template')->defaultNull()->end()->scalarNode('sort_column')->defaultNull()->end()->scalarNode('property_path')->defaultNull()->end()->scalarNode('label')->defaultNull()->end()->scalarNode('renderer')->defaultNull()->end()->variableNode('formatting_options')->defaultValue([])->end()->end()->end()->end();
}