Skip to content

Commit 746f802

Browse files
Merge pull request liip#473 from karser/dont-extend-from-container-aware-command
ContainerAwareCommand is deprecated since Symfony 4.2
2 parents 478dd98 + c732089 commit 746f802

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/Command/RunParatestCommand.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@
1313

1414
namespace Liip\FunctionalTestBundle\Command;
1515

16-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1716
use Symfony\Bundle\FrameworkBundle\Console\Application;
17+
use Symfony\Component\Console\Command\Command;
1818
use Symfony\Component\Console\Input\ArrayInput;
1919
use Symfony\Component\Console\Input\InputArgument;
2020
use Symfony\Component\Console\Input\InputInterface;
2121
use Symfony\Component\Console\Output\OutputInterface;
22+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
23+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
2224
use Symfony\Component\Process\Process;
2325

2426
/**
2527
* Command used to update the project.
2628
*/
27-
class RunParatestCommand extends ContainerAwareCommand
29+
class RunParatestCommand extends Command implements ContainerAwareInterface
2830
{
31+
use ContainerAwareTrait;
32+
2933
private $output;
3034

3135
private $process;
@@ -49,17 +53,17 @@ protected function configure(): void
4953

5054
protected function prepare(): void
5155
{
52-
$this->phpunit = $this->getContainer()->getParameter('liip_functional_test.paratest.phpunit');
53-
$this->process = $this->getContainer()->getParameter('liip_functional_test.paratest.process');
56+
$this->phpunit = $this->container->getParameter('liip_functional_test.paratest.phpunit');
57+
$this->process = $this->container->getParameter('liip_functional_test.paratest.process');
5458

55-
$this->testDbPath = $this->getContainer()->get('kernel')->getCacheDir();
59+
$this->testDbPath = $this->container->get('kernel')->getCacheDir();
5660
$this->output->writeln("Cleaning old dbs in $this->testDbPath ...");
5761
$createDirProcess = new Process('mkdir -p '.$this->testDbPath);
5862
$createDirProcess->run();
5963
$cleanProcess = new Process("rm -fr $this->testDbPath/dbTest.db $this->testDbPath/dbTest*.db*");
6064
$cleanProcess->run();
6165
$this->output->writeln("Creating Schema in $this->testDbPath ...");
62-
$application = new Application($this->getContainer()->get('kernel'));
66+
$application = new Application($this->container->get('kernel'));
6367
$input = new ArrayInput(['doctrine:schema:create', '--env' => 'test']);
6468
$application->run($input, $this->output);
6569

0 commit comments

Comments
 (0)