コード例 #1
0
 /**
  * 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
0
 /**
  * @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();
 }