Skip to content

Commit

Permalink
Fix: Attempted to call an undefined method named "getMetadataCache" o…
Browse files Browse the repository at this point in the history
…f class "Doctrine\ORM\Configuration". (#144)
  • Loading branch information
dmitryuk committed Dec 13, 2022
1 parent 342b4c5 commit d56c4c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Provider/Doctrine/DoctrineProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ public function loadAnnotations(EntityManagerInterface $entityManager, array $en
{
\assert($this->configuration instanceof Configuration); // helps PHPStan
$ormConfiguration = $entityManager->getConfiguration();
$metadataCache = $ormConfiguration->getMetadataCache();

/** @since doctrine/orm:2.7.5 */
$metadataCache = method_exists($ormConfiguration, 'getMetadataCache')
? $ormConfiguration->getMetadataCache()
: null;

$annotationLoader = new AnnotationLoader($entityManager);

Expand Down

0 comments on commit d56c4c1

Please sign in to comment.