diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 1c55eb1bc..42a6e85c9 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -759,14 +759,12 @@ public function __construct() */ protected function getTraits(ClassMetadataInfo $metadata) { - if ($metadata->reflClass !== null || class_exists($metadata->name)) { + if (PHP_VERSION_ID >= 50400 && ($metadata->reflClass !== null || class_exists($metadata->name))) { $reflClass = $metadata->reflClass === null ? new \ReflectionClass($metadata->name) : $metadata->reflClass; - if (PHP_VERSION_ID >= 50400) { - return $reflClass->getTraits(); - } + return $reflClass->getTraits(); } return array();