diff --git a/.gitignore b/.gitignore index 7579f74..88e99d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ vendor -composer.lock +composer.lock \ No newline at end of file diff --git a/Metadata/Driver/AnnotationDriver.php b/Metadata/Driver/AnnotationDriver.php index 53c32d2..f2a02d9 100644 --- a/Metadata/Driver/AnnotationDriver.php +++ b/Metadata/Driver/AnnotationDriver.php @@ -224,10 +224,6 @@ public function loadMetadataForClass(\ReflectionClass $class) } } - if (null == $metadata->id && !$hasInjection) { - return null; - } - return $metadata; } diff --git a/Tests/Functional/Bundle/TestBundle/Inheritance/MappedSuperClass.php b/Tests/Functional/Bundle/TestBundle/Inheritance/MappedSuperClass.php new file mode 100644 index 0000000..8c615fc --- /dev/null +++ b/Tests/Functional/Bundle/TestBundle/Inheritance/MappedSuperClass.php @@ -0,0 +1,33 @@ +foo = $foo; + $this->bar = $bar; + } + + public function getFoo() + { + return $this->foo; + } + + public function getBar() + { + return $this->bar; + } +} diff --git a/Tests/Functional/Bundle/TestBundle/Inheritance/UnmapedSubClass.php b/Tests/Functional/Bundle/TestBundle/Inheritance/UnmapedSubClass.php new file mode 100644 index 0000000..85d6494 --- /dev/null +++ b/Tests/Functional/Bundle/TestBundle/Inheritance/UnmapedSubClass.php @@ -0,0 +1,13 @@ +getMetadataFactory(); + + $this->assertInstanceOf('\Metadata\MetadataFactory', $metadataFactory); + + $metadata = $metadataFactory->getMetadataForClass( + 'JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Inheritance\UnmapedSubClass' + ); + + $this->assertCount(2, $metadata->classMetadata); + $this->assertEquals( + 'JMS\DiExtraBundle\Tests\Functional\Bundle\TestBundle\Inheritance\UnmapedSubClass', + $metadata->getOutsideClassMetadata()->name + ); + } + + /** + * @return MetadataFactory + */ + private function getMetadataFactory() + { + return $this->createClient()->getContainer()->get('jms_di_extra.metadata.metadata_factory'); + } +} diff --git a/Tests/Functional/config/framework.yml b/Tests/Functional/config/framework.yml index aba0cbf..58b789c 100644 --- a/Tests/Functional/config/framework.yml +++ b/Tests/Functional/config/framework.yml @@ -9,7 +9,7 @@ framework: enabled: true enable_annotations: true router: - resource: %kernel.root_dir%/config/routing.yml + resource: "%kernel.root_dir%/config/routing.yml" services: logger: diff --git a/Tests/Functional/config/twig.yml b/Tests/Functional/config/twig.yml index 105ae64..a6f61d0 100644 --- a/Tests/Functional/config/twig.yml +++ b/Tests/Functional/config/twig.yml @@ -3,5 +3,5 @@ framework: engines: [twig, php] twig: - debug: %kernel.debug% - strict_variables: %kernel.debug% + debug: "%kernel.debug%" + strict_variables: "%kernel.debug%"