Skip to content

Commit

Permalink
Drop code for < Symfony 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jul 20, 2021
1 parent f411813 commit 859c5e5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions ManagerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
namespace Doctrine\Bundle\MongoDBBundle;

use Doctrine\ODM\MongoDB\MongoDBException;
use Psr\Container\ContainerInterface;
use Symfony\Bridge\Doctrine\ManagerRegistry as BaseManagerRegistry;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;

use function array_keys;
use function class_uses;

class ManagerRegistry extends BaseManagerRegistry
{
Expand All @@ -22,14 +20,7 @@ class ManagerRegistry extends BaseManagerRegistry
*/
public function __construct($name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName, ?ContainerInterface $container = null)
{
$parentTraits = class_uses(parent::class);
if (isset($parentTraits[ContainerAwareTrait::class])) {
// this case should be removed when Symfony 3.4 becomes the lowest supported version
// and then also, the constructor should type-hint Psr\Container\ContainerInterface
$this->setContainer($container);
} else {
$this->container = $container;
}
$this->container = $container;

parent::__construct($name, $connections, $managers, $defaultConnection, $defaultManager, $proxyInterfaceName);
}
Expand Down

0 comments on commit 859c5e5

Please sign in to comment.