1
0
mirror of synced 2024-12-14 07:06:04 +03:00

[doctrine/common-GH-92] Fixing notice when annotation driver is used in combination with static reflection.

This commit is contained in:
Benjamin Eberlei 2012-01-09 08:02:53 +01:00
parent d34c39555d
commit e16803de61

View File

@ -134,6 +134,11 @@ class AnnotationDriver implements Driver
public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
{
$class = $metadata->getReflectionClass();
if (!$class) {
// this happens when running annotation driver in combination with
// static reflection services. This is not the nicest fix
$class = new \ReflectionClass($class->name);
}
$classAnnotations = $this->_reader->getClassAnnotations($class);