for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Configuration\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ManagerRegistry;
use RuntimeException;
final class ManagerRegistryEntityManager implements EntityManagerLoader
{
/** @var ManagerRegistry */
private $registry;
/** @var string|null */
private $managerName;
public function __construct(ManagerRegistry $managerRegistry)
$this->registry = $managerRegistry;
}
public function setManagerName(?string $managerName) : void
$this->managerName = $managerName;
public function getEntityManager() : EntityManagerInterface
$em = $this->registry->getManager($this->managerName);
if (! $em instanceof EntityManagerInterface) {
throw new RuntimeException('The returned must be @todo');
return $em;