From 8f0fa1997619b07067b73752e576766fec75f8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Tue, 17 May 2016 16:43:00 +0200 Subject: [PATCH] =?UTF-8?q?Les=20namespaces=20n'=C3=A9tant=20pas=20statele?= =?UTF-8?q?ss,=20il=20faut=20les=20instancier=20pour=20chaque=20graphe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Builder/GraphDefinitionBuilder.php | 9 ++++++--- Resources/config/services.yml | 12 +++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/DependencyInjection/Builder/GraphDefinitionBuilder.php b/DependencyInjection/Builder/GraphDefinitionBuilder.php index 1be9d73..654e01f 100644 --- a/DependencyInjection/Builder/GraphDefinitionBuilder.php +++ b/DependencyInjection/Builder/GraphDefinitionBuilder.php @@ -90,7 +90,7 @@ class GraphDefinitionBuilder protected function doBuild() { list($source, $sourceFilter) = $this->buildSources(); - + $layoutFilter = $this->filterBuilder->build($this->config['layout']) ?: $sourceFilter; $decorator = $this->buildFilteredDecorator(); $namespace = $this->buildNamespace(); @@ -199,7 +199,7 @@ class GraphDefinitionBuilder protected function buildNamespace() { $type = $this->config['layout']['namespaces']; - + if ($type === "entities") { return $this->setDefinitionDecorator( "namespace.$type", @@ -208,7 +208,10 @@ class GraphDefinitionBuilder ); } - return new Reference("irstea.plant_uml.namespaces.$type"); + return $this->setDefinitionDecorator( + "namespace.$type", + "irstea.plant_uml.namespaces.$type.template", + ); } /** diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 4459e36..fe95ed4 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -54,15 +54,21 @@ services: abstract: true public: false - irstea.plant_uml.namespaces.php: + irstea.plant_uml.namespaces.php.template: class: Irstea\PlantUmlBundle\Model\Namespace_\Php\RootNamespace + abstract: true + public: false - irstea.plant_uml.namespaces.flat: + irstea.plant_uml.namespaces.flat.template: class: Irstea\PlantUmlBundle\Model\Namespace_\FlatNamespace + abstract: true + public: false - irstea.plant_uml.namespaces.bundles: + irstea.plant_uml.namespaces.bundles.template: class: Irstea\PlantUmlBundle\Model\Namespace_\BundleNamespace arguments: ["%kernel.bundles%"] + abstract: true + public: false irstea.plant_uml.namespaces.entities.template: class: Irstea\PlantUmlBundle\Doctrine\DoctrineNamespace -- GitLab