Fixing a bug where abstract classes were wired
This commit is contained in:
parent
3646d08735
commit
5326bab10a
@ -108,7 +108,8 @@ abstract class FileLoader extends BaseFileLoader
|
||||
if (!$r = $this->container->getReflectionClass($class)) {
|
||||
throw new InvalidArgumentException(sprintf('Expected to find class "%s" in file "%s" while importing services from resource "%s", but it was not found! Check the namespace prefix used with the resource.', $class, $path, $pattern));
|
||||
}
|
||||
if (!$r->isInterface() && !$r->isTrait()) {
|
||||
|
||||
if (!$r->isInterface() && !$r->isTrait() && !$r->isAbstract()) {
|
||||
$classes[] = $class;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
abstract class NoLoadAbstractBar
|
||||
{
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
interface NoLoadBarInterface
|
||||
{
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub;
|
||||
|
||||
trait NoLoadBarTrait
|
||||
{
|
||||
}
|
@ -84,7 +84,10 @@ class FileLoaderTest extends TestCase
|
||||
|
||||
$loader->registerClasses(new Definition(), 'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\\', 'Prototype/%sub_dir%/*');
|
||||
|
||||
$this->assertTrue($container->has(Bar::class));
|
||||
$this->assertEquals(
|
||||
array('service_container', Bar::class),
|
||||
array_keys($container->getDefinitions())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user