Skip to content

Commit

Permalink
[DoctrineBundle] removed redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed May 3, 2011
1 parent 6b5438a commit bd608c8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/Symfony/Bundle/DoctrineBundle/Registry.php
Expand Up @@ -32,15 +32,7 @@ public function __construct(ContainerInterface $container, array $connections, a
$this->container = $container;
$this->connections = $connections;
$this->entityManagers = $entityManagers;

if (!isset($this->connections[$defaultConnection])) {
throw new \LogicException(sprintf('Default connection "%s" is not defined.', $defaultConnection));
}
$this->defaultConnection = $defaultConnection;

if (!isset($this->entityManagers[$defaultEntityManager])) {
throw new \LogicException(sprintf('Default entity manager "%s" is not defined.', $defaultEntityManager));
}
$this->defaultEntityManager = $defaultEntityManager;
}

Expand All @@ -64,7 +56,7 @@ public function getDefaultConnectionName()
public function getConnection($name = null)
{
if (null === $name) {
return $this->container->get($this->connections[$this->defaultConnection]);
$name = $this->defaultConnection;
}

if (!isset($this->connections[$name])) {
Expand Down Expand Up @@ -104,7 +96,7 @@ public function getDefaultEntityManagerName()
public function getEntityManager($name = null)
{
if (null === $name) {
return $this->container->get($this->entityManagers[$this->defaultEntityManager]);
$name = $this->defaultEntityManager;
}

if (!isset($this->entityManagers[$name])) {
Expand Down

0 comments on commit bd608c8

Please sign in to comment.