Browse files

minor fixes

  • Loading branch information...
1 parent b3414e3 commit 3b7b457d35657911d551ef69639e4a9db111501c @Padam87 committed Apr 4, 2013
View
6 lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -759,12 +759,12 @@ protected function hasMethod($method, ClassMetadataInfo $metadata)
*/
protected function getTraits(ClassMetadataInfo $metadata)
{
- if ($metadata->reflClass != null || class_exists($metadata->name)) {
- $reflClass = $metadata->reflClass == null
+ if ($metadata->reflClass !== null || class_exists($metadata->name)) {
+ $reflClass = $metadata->reflClass === null
? new \ReflectionClass($metadata->name)
: $metadata->reflClass;
- if (method_exists($reflClass, 'getTraits')) {
+ if (PHP_VERSION_ID >= 50400) {
return $reflClass->getTraits();
}
}
View
2 tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php
@@ -458,7 +458,7 @@ public function testEntityTypeAlias(array $field)
*/
public function testTraitPropertiesAndMethodsAreNotDuplicated()
{
- if (function_exists('trait_exists')) {
+ if (PHP_VERSION_ID >= 50400) {
$cmf = new ClassMetadataFactory();
$em = $this->_getTestEntityManager();
$cmf->setEntityManager($em);

0 comments on commit 3b7b457

Please sign in to comment.