Skip to content

Commit 79096fb

Browse files
author
James Moey
committed
Remove Symfony framework bundle of ContainerAwareCommand.
Use Command, ContainerAwareInterface and ContainerAwareTrait.
1 parent 110e0f0 commit 79096fb

4 files changed

Lines changed: 28 additions & 12 deletions

File tree

src/Command/QueueBuildCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Command;
2424

25-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
25+
use Symfony\Component\Console\Command\Command;
2626
use Symfony\Component\Console\Input\InputArgument;
2727
use Symfony\Component\Console\Input\InputInterface;
2828
use Symfony\Component\Console\Output\OutputInterface;
29+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
30+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
2931

3032
/**
3133
* @author Keith Kirk <kkirk@undergroundelephant.com>
3234
*/
33-
class QueueBuildCommand extends ContainerAwareCommand
35+
class QueueBuildCommand extends Command implements ContainerAwareInterface
3436
{
37+
use ContainerAwareTrait;
38+
3539
protected $output;
3640

3741
protected function configure()
@@ -51,7 +55,7 @@ protected function configure()
5155
protected function execute(InputInterface $input, OutputInterface $output)
5256
{
5357
$this->output = $output;
54-
$registry = $this->getContainer()->get('uecode_qpush');
58+
$registry = $this->container->get('uecode_qpush');
5559

5660
$name = $input->getArgument('name');
5761

src/Command/QueueDestroyCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Command;
2424

25-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
25+
use Symfony\Component\Console\Command\Command;
2626
use Symfony\Component\Console\Input\InputArgument;
2727
use Symfony\Component\Console\Input\InputInterface;
2828
use Symfony\Component\Console\Input\InputOption;
2929
use Symfony\Component\Console\Output\OutputInterface;
30+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
31+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
3032

3133
/**
3234
* @author Keith Kirk <kkirk@undergroundelephant.com>
3335
*/
34-
class QueueDestroyCommand extends ContainerAwareCommand
36+
class QueueDestroyCommand extends Command implements ContainerAwareInterface
3537
{
38+
use ContainerAwareTrait;
39+
3640
protected $output;
3741

3842
protected function configure()
@@ -58,7 +62,7 @@ protected function configure()
5862
protected function execute(InputInterface $input, OutputInterface $output)
5963
{
6064
$this->output = $output;
61-
$registry = $this->getContainer()->get('uecode_qpush');
65+
$registry = $this->container->get('uecode_qpush');
6266
$dialog = $this->getHelperSet()->get('dialog');
6367

6468
$name = $input->getArgument('name');

src/Command/QueuePublishCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Command;
2424

25-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
25+
use Symfony\Component\Console\Command\Command;
2626
use Symfony\Component\Console\Input\InputArgument;
2727
use Symfony\Component\Console\Input\InputInterface;
2828
use Symfony\Component\Console\Output\OutputInterface;
29+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
30+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
2931

3032
/**
3133
* @author Keith Kirk <kkirk@undergroundelephant.com>
3234
*/
33-
class QueuePublishCommand extends ContainerAwareCommand
35+
class QueuePublishCommand extends Command implements ContainerAwareInterface
3436
{
37+
use ContainerAwareTrait;
38+
3539
protected $output;
3640

3741
protected function configure()
@@ -55,7 +59,7 @@ protected function configure()
5559
protected function execute(InputInterface $input, OutputInterface $output)
5660
{
5761
$this->output = $output;
58-
$registry = $this->getContainer()->get('uecode_qpush');
62+
$registry = $this->container->get('uecode_qpush');
5963

6064
$name = $input->getArgument('name');
6165
$message = $input->getArgument('message');

src/Command/QueueReceiveCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,22 @@
2222

2323
namespace Uecode\Bundle\QPushBundle\Command;
2424

25-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
25+
use Symfony\Component\Console\Command\Command;
2626
use Symfony\Component\Console\Input\InputArgument;
2727
use Symfony\Component\Console\Input\InputInterface;
2828
use Symfony\Component\Console\Output\OutputInterface;
29+
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
30+
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
2931
use Uecode\Bundle\QPushBundle\Event\Events;
3032
use Uecode\Bundle\QPushBundle\Event\MessageEvent;
3133

3234
/**
3335
* @author Keith Kirk <kkirk@undergroundelephant.com>
3436
*/
35-
class QueueReceiveCommand extends ContainerAwareCommand
37+
class QueueReceiveCommand extends Command implements ContainerAwareInterface
3638
{
39+
use ContainerAwareTrait;
40+
3741
protected $output;
3842

3943
protected function configure()
@@ -53,7 +57,7 @@ protected function configure()
5357
protected function execute(InputInterface $input, OutputInterface $output)
5458
{
5559
$this->output = $output;
56-
$registry = $this->getContainer()->get('uecode_qpush');
60+
$registry = $this->container->get('uecode_qpush');
5761

5862
$name = $input->getArgument('name');
5963

0 commit comments

Comments
 (0)