From 83b37ffb4dbfae43f80cb4ea0c0186f262046c02 Mon Sep 17 00:00:00 2001 From: Julien 'ruian' Galenski Date: Fri, 16 Nov 2012 14:04:00 +0100 Subject: [PATCH] [DependencyInjection] Return self for add... Bug fix: no Feature addition: no Backwards compatibility break: yes Symfony2 tests pass: yes License of the code: MIT Return self instance when call an ADD something method. --- .../Component/DependencyInjection/ContainerBuilder.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 8053f5986f..9f375741e0 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -145,6 +145,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * * @param object $object An object instance * + * @return ContainerBuilder The current instance + * * @api */ public function addObjectResource($object) @@ -153,6 +155,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface do { $this->addResource(new FileResource($parent->getFileName())); } while ($parent = $parent->getParentClass()); + + return $this; } /** @@ -187,6 +191,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * @param CompilerPassInterface $pass A compiler pass * @param string $type The type of compiler pass * + * @return ContainerBuilder The current instance + * * @api */ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) @@ -198,6 +204,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface $this->compiler->addPass($pass, $type); $this->addObjectResource($pass); + + return $this; } /**