Skip to content

Commit

Permalink
Merge pull request #286 from alcaeus/bump-doctrine-bundle-dependency
Browse files Browse the repository at this point in the history
Drop support for older versions of DoctrineBundle
  • Loading branch information
alcaeus committed Jul 14, 2019
2 parents f0db517 + 672b92d commit 948f8b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions Command/LoadDataFixturesDoctrineCommand.php
Expand Up @@ -17,7 +17,6 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use const E_USER_DEPRECATED;
use function implode;
use function method_exists;
use function sprintf;
use function trigger_error;

Expand All @@ -39,8 +38,7 @@ public function __construct(SymfonyFixturesLoader $fixturesLoader, ?ManagerRegis
), E_USER_DEPRECATED);
}

// @todo The method_exists call can be removed once the DoctrineBundle dependency has been bumped to at least 1.10
parent::__construct(method_exists($this, 'getDoctrine') ? $doctrine : null);
parent::__construct($doctrine);

$this->fixturesLoader = $fixturesLoader;
}
Expand Down Expand Up @@ -85,15 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$ui = new SymfonyStyle($input, $output);

// @todo The method_exists call can be removed once the DoctrineBundle dependency has been bumped to at least 1.10
if (method_exists($this, 'getDotrine')) {
$doctrine = $this->getDoctrine();
} else {
/** @var ManagerRegistry $doctrine */
$doctrine = $this->getContainer()->get('doctrine');
}

$em = $doctrine->getManager($input->getOption('em'));
$em = $this->getDoctrine()->getManager($input->getOption('em'));

if (! $input->getOption('append')) {
if (! $ui->confirm(sprintf('Careful, database "%s" will be purged. Do you want to continue?', $em->getConnection()->getDatabase()), ! $input->isInteractive())) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -22,7 +22,7 @@
"require": {
"php": "^7.1",
"doctrine/data-fixtures": "^1.3",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-bundle": "^1.11",
"doctrine/orm": "^2.6.0",
"symfony/doctrine-bridge": "~3.4|^4.1",
"symfony/framework-bundle": "^3.4|^4.1"
Expand Down

0 comments on commit 948f8b5

Please sign in to comment.