Skip to content

Commit

Permalink
This commit fixes two bugs:
Browse files Browse the repository at this point in the history
- interfaces can now also be defined on containers which are built with an Extension
- interface injection can also be used on classes that require constructor arguments
  • Loading branch information
schmittjoh authored and fabpot committed Dec 10, 2010
1 parent cc3a783 commit e49cc36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -241,6 +241,7 @@ public function merge(ContainerBuilder $container)

$this->addDefinitions($container->getDefinitions());
$this->addAliases($container->getAliases());
$this->addInterfaceInjectors($container->getInterfaceInjectors());
$this->parameterBag->add($container->getParameterBag()->all());

foreach ($container->getResources() as $resource) {
Expand Down
Expand Up @@ -79,8 +79,11 @@ public function processDefinition(Definition $definition, $class = null)
public function supports($object)
{
if (is_string($object)) {
$class = new \ReflectionClass($object);
$object = $class->newInstance();
$reflection = new \ReflectionClass($object);

return $reflection->implementsInterface($this->class)
|| $reflection->isSubClassOf($this->class)
|| $object === $this->class;
}

if ( ! is_object($object)) {
Expand Down

0 comments on commit e49cc36

Please sign in to comment.