Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for older versions of DoctrineBundle #286

Merged
merged 1 commit into from Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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