diff --git a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php index 332b33ac6f..5c9a7741c5 100644 --- a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php +++ b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php @@ -79,7 +79,7 @@ class DoctrineTestHelper $symfonyFileLocator = class_exists(SymfonyFileLocator::class) ? SymfonyFileLocator::class : LegacySymfonyFileLocator::class; $driverChain = class_exists(MappingDriverChain::class) ? MappingDriverChain::class : LegacyMappingDriverChain::class; - $driverChain = new MappingDriverChain(); + $driverChain = new $driverChain(); $driverChain->addDriver( new XmlDriver( new $symfonyFileLocator( diff --git a/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php index 3074127e8f..2bbdadd128 100644 --- a/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php +++ b/src/Symfony/Bridge/Doctrine/Test/TestRepositoryFactory.php @@ -29,8 +29,10 @@ final class TestRepositoryFactory implements RepositoryFactory /** * {@inheritdoc} + * + * @return ObjectRepository|LegacyObjectRepository */ - public function getRepository(EntityManagerInterface $entityManager, $entityName): ObjectRepository + public function getRepository(EntityManagerInterface $entityManager, $entityName) { $repositoryHash = $this->getRepositoryHash($entityManager, $entityName);