8000 [DependencyInjection] Return self for add... · symfony/symfony@83b37ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 83b37ff

Browse files
committed
[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.
1 parent e3f8d2d commit 83b37ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public function setResources(array $resources)
145145
*
146146
* @param object $object An object instance
147147
*
148+
* @return ContainerBuilder The current instance
149+
*
148150
* @api
149151
*/
150152
public function addObjectResource($object)
@@ -153,6 +155,8 @@ public function addObjectResource($object)
153155
do {
154156
$this->addResource(new FileResource($parent->getFileName()));
155157
} while ($parent = $parent->getParentClass());
158+
159+
return $this;
156160
}
157161

158162
/**
@@ -187,6 +191,8 @@ public function loadFromExtension($extension, array $values = array())
187191
* @param CompilerPassInterface $pass A compiler pass
188192
* @param string $type The type of compiler pass
189193
*
194+
* @return ContainerBuilder The current instance
195+
*
190196
* @api
191197
*/
192198
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
@@ -198,6 +204,8 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
198204
$this->compiler->addPass($pass, $type);
199205

200206
$this->addObjectResource($pass);
207+
208+
return $this;
201209
}
202210

203211
/**

0 commit comments

Comments
 (0)
0