Skip to content

Commit aa32751

Browse files
committed
Added missing catch for Doctrine persistence class
1 parent 1a32023 commit aa32751

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Doctrine/EntityRegenerator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
namespace Symfony\Bundle\MakerBundle\Doctrine;
1313

14-
use Doctrine\Common\Persistence\Mapping\MappingException as CommonMappingException;
14+
use Doctrine\Common\Persistence\Mapping\MappingException as LegacyCommonMappingException;
1515
use Doctrine\ORM\Mapping\ClassMetadata;
1616
use Doctrine\ORM\Mapping\MappingException;
17+
use Doctrine\Persistence\Mapping\MappingException as PersistenceMappingException;
1718
use Symfony\Bundle\MakerBundle\Exception\RuntimeCommandException;
1819
use Symfony\Bundle\MakerBundle\FileManager;
1920
use Symfony\Bundle\MakerBundle\Generator;
@@ -43,7 +44,7 @@ public function regenerateEntities(string $classOrNamespace)
4344
{
4445
try {
4546
$metadata = $this->doctrineHelper->getMetadata($classOrNamespace);
46-
} catch (MappingException | CommonMappingException $mappingException) {
47+
} catch (MappingException | LegacyCommonMappingException | PersistenceMappingException $mappingException) {
4748
$metadata = $this->doctrineHelper->getMetadata($classOrNamespace, true);
4849
}
4950

0 commit comments

Comments
 (0)