Commit 40dc2812 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Ajout d'informations dans la configuration.

A afficher avec app/console config:dump-reference irstea_plant_uml.
parent 6f6e96f2
...@@ -25,15 +25,19 @@ class Configuration implements ConfigurationInterface ...@@ -25,15 +25,19 @@ class Configuration implements ConfigurationInterface
$treeBuilder->root('irstea_plant_uml') $treeBuilder->root('irstea_plant_uml')
->children() ->children()
->arrayNode('binaries') ->arrayNode('binaries')
->info("Chemins vers les fichiers binaires (INUTILISE POUR L'INSTANT).")
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->scalarNode('java') ->scalarNode('java')
->info("Commande 'java'")
->defaultValue("java") ->defaultValue("java")
->end() ->end()
->scalarNode('plamtuml_jar') ->scalarNode('plamtuml_jar')
->info("Archive du logiciel PlantUML")
->defaultValue("plantuml.jar") ->defaultValue("plantuml.jar")
->end() ->end()
->scalarNode('dot') ->scalarNode('dot')
->info("Commande 'dot' du package 'graphviz'")
->defaultValue("dot") ->defaultValue("dot")
->end() ->end()
->end() ->end()
...@@ -48,52 +52,62 @@ class Configuration implements ConfigurationInterface ...@@ -48,52 +52,62 @@ class Configuration implements ConfigurationInterface
{ {
$node = (new TreeBuilder())->root('graphs'); $node = (new TreeBuilder())->root('graphs');
$decorators = ['inheritance', 'traits', 'interfaces', 'entity', 'associations', 'properties', 'methods', 'fields', 'attributes']; $decorators = ['inheritance', 'traits', 'interfaces', 'entity', 'associations', 'methods', 'fields', 'attributes'];
$node $node
->info("Graphes.")
->useAttributeAsKey('name') ->useAttributeAsKey('name')
->prototype('array') ->prototype('array')
->info("description d'un graphe à générer.")
->children() ->children()
->arrayNode('sources') ->arrayNode('sources')
->info("Sélection des classes à examiner.")
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->enumNode('type') ->enumNode('type')
->info("Source de la liste de classes.")
->defaultValue('classes') ->defaultValue('classes')
->values(['classes', 'entities']) ->values(['classes', 'entities'])
->end() ->end()
->scalarNode('entity_manager') ->scalarNode('entity_manager')
->info("Entity Manager à utiliser pour les entités.")
->defaultValue('default') ->defaultValue('default')
->end() ->end()
->arrayNode('directories') ->arrayNode('directories')
->info("Répertoires contenant les sources.")
->defaultValue(['%kernel.root_dir%/../src']) ->defaultValue(['%kernel.root_dir%/../src'])
->prototype('scalar')->end() ->prototype('scalar')->end()
->end() ->end()
->append($this->buildFilterNode('include')) ->append($this->buildFilterNode('include', 'à inclure'))
->append($this->buildFilterNode('exclude')) ->append($this->buildFilterNode('exclude', 'à ignorer'))
->end() ->end()
->end() ->end()
->arrayNode('layout') ->arrayNode('layout')
->info("Configuration de la disposition et du parcours.")
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->enumNode('namespaces') ->enumNode('namespaces')
->info("Types .")
->defaultValue('php') ->defaultValue('php')
->values(['bundles', 'php', 'flat', 'entities']) ->values(['bundles', 'php', 'flat', 'entities'])
->end() ->end()
->append($this->buildFilterNode('include')) ->append($this->buildFilterNode('include', 'à tracer'))
->append($this->buildFilterNode('exclude')) ->append($this->buildFilterNode('exclude', 'à ne pas tracer'))
->end() ->end()
->end() ->end()
->arrayNode('decoration') ->arrayNode('decoration')
->info("Informations à afficher sur les classes.")
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->arrayNode('decorators') ->arrayNode('decorators')
->info("Liste des décorateurs à utiliser.")
->defaultValue($decorators) ->defaultValue($decorators)
->prototype('enum') ->prototype('enum')
->values($decorators) ->values($decorators)
->end() ->end()
->end() ->end()
->append($this->buildFilterNode('include')) ->append($this->buildFilterNode('include', 'à décorer'))
->append($this->buildFilterNode('exclude')) ->append($this->buildFilterNode('exclude', 'à ne pas décorer'))
->end() ->end()
->end() ->end()
->end() ->end()
...@@ -102,16 +116,18 @@ class Configuration implements ConfigurationInterface ...@@ -102,16 +116,18 @@ class Configuration implements ConfigurationInterface
return $node; return $node;
} }
protected function buildFilterNode($nodeName) protected function buildFilterNode($nodeName, $description)
{ {
$node = (new TreeBuilder())->root($nodeName); $node = (new TreeBuilder())->root($nodeName);
$node $node
->children() ->children()
->arrayNode('directories') ->arrayNode('directories')
->info("Répertoires $description")
->prototype('scalar')->end() ->prototype('scalar')->end()
->end() ->end()
->arrayNode('namespaces') ->arrayNode('namespaces')
->info("Namespaces $description")
->prototype('scalar')->end() ->prototype('scalar')->end()
->end() ->end()
->end(); ->end();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment