Skip to content

Commit

Permalink
Stop using DelegateCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Dec 20, 2018
1 parent fe2d0dc commit 0a5fd39
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 42 deletions.
25 changes: 11 additions & 14 deletions Command/Proxy/CollectionRegionDoctrineCommand.php
Expand Up @@ -3,11 +3,14 @@
namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Command to clear a collection cache region.
*/
class CollectionRegionDoctrineCommand extends DelegateCommand
class CollectionRegionDoctrineCommand extends CollectionRegionCommand
{
/**
* {@inheritDoc}
Expand All @@ -16,22 +19,16 @@ protected function configure()
{
parent::configure();

$this->setName('doctrine:cache:clear-collection-region');
$this
->setName('doctrine:cache:clear-collection-region')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
}

/**
* {@inheritDoc}
*/
protected function createCommand()
protected function execute(InputInterface $input, OutputInterface $output)
{
return new CollectionRegionCommand();
}
DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));

/**
* {@inheritDoc}
*/
protected function getMinimalVersion()
{
return '2.5.0-DEV';
return parent::execute($input, $output);
}

}
24 changes: 10 additions & 14 deletions Command/Proxy/EntityRegionCacheDoctrineCommand.php
Expand Up @@ -3,11 +3,14 @@
namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\EntityRegionCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Command to clear a entity cache region.
*/
class EntityRegionCacheDoctrineCommand extends DelegateCommand
class EntityRegionCacheDoctrineCommand extends EntityRegionCommand
{
/**
* {@inheritDoc}
Expand All @@ -16,22 +19,15 @@ protected function configure()
{
parent::configure();

$this->setName('doctrine:cache:clear-entity-region');
$this
->setName('doctrine:cache:clear-entity-region')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
}

/**
* {@inheritDoc}
*/
protected function createCommand()
protected function execute(InputInterface $input, OutputInterface $output)
{
return new EntityRegionCommand();
}
DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));

/**
* {@inheritDoc}
*/
protected function getMinimalVersion()
{
return '2.5.0-DEV';
return parent::execute($input, $output);
}
}
24 changes: 10 additions & 14 deletions Command/Proxy/QueryRegionCacheDoctrineCommand.php
Expand Up @@ -3,11 +3,14 @@
namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;

use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryRegionCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Command to clear a query cache region.
*/
class QueryRegionCacheDoctrineCommand extends DelegateCommand
class QueryRegionCacheDoctrineCommand extends QueryRegionCommand
{
/**
* {@inheritDoc}
Expand All @@ -16,22 +19,15 @@ protected function configure()
{
parent::configure();

$this->setName('doctrine:cache:clear-query-region');
$this
->setName('doctrine:cache:clear-query-region')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
}

/**
* {@inheritDoc}
*/
protected function createCommand()
protected function execute(InputInterface $input, OutputInterface $output)
{
return new QueryRegionCommand();
}
DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));

/**
* {@inheritDoc}
*/
protected function getMinimalVersion()
{
return '2.5.0-DEV';
return parent::execute($input, $output);
}
}

0 comments on commit 0a5fd39

Please sign in to comment.