Skip to content

Commit

Permalink
bug symfony#1475 [Turbo] add missing use statement (jrushlow)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.x branch.

Discussion
----------

[Turbo] add missing use statement

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Issues        |
| License       | MIT

The new `Ux\...\ClassUtil` and the legacy `Doctrine\...\ClassUtils` are very similar. Adding the missing use statement with an alias to avoid IDE confusion :)

Commits
-------

6e5fe19 [Turbo] add missing use statement
  • Loading branch information
weaverryan committed Feb 8, 2024
2 parents 0143930 + 6e5fe19 commit a20d37b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Turbo/src/Doctrine/ClassUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\UX\Turbo\Doctrine;

use Doctrine\Common\Util\ClassUtils as LegacyClassUtils;
use Symfony\Component\VarExporter\LazyObjectInterface;

/**
Expand All @@ -30,8 +31,8 @@ public static function getEntityClass(object $entity): string
}

// @legacy for old versions of Doctrine
if (class_exists(ClassUtils::class)) {
return ClassUtils::getClass($entity);
if (class_exists(LegacyClassUtils::class)) {
return LegacyClassUtils::getClass($entity);
}

return $entity::class;
Expand Down

0 comments on commit a20d37b

Please sign in to comment.