Skip to content

Commit cded391

Browse files
committed
[Turbo] simplify returning entity class name
1 parent a20d37b commit cded391

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Turbo/src/Doctrine/ClassUtil.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ final class ClassUtil
2222
public static function getEntityClass(object $entity): string
2323
{
2424
if ($entity instanceof LazyObjectInterface) {
25-
$entityClass = get_parent_class($entity);
26-
if (false === $entityClass) {
27-
throw new \LogicException('Parent class missing');
28-
}
29-
30-
return $entityClass;
25+
return get_parent_class($entity) ?: $entity::class;
3126
}
3227

3328
// @legacy for old versions of Doctrine

0 commit comments

Comments
 (0)