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(UnmapedSubClass::class); + + $this->assertCount(2, $metadata->classMetadata); + $this->assertEquals(UnmapedSubClass::class, $metadata->getOutsideClassMetadata()->name); + } + + /** + * @return MetadataFactory + */ + private function getMetadataFactory() + { + return $this->createClient()->getContainer()->get('jms_di_extra.metadata.metadata_factory'); + } +}