|
2 | 2 |
|
3 | 3 | namespace Cypress\GitElephantBundle\Command;
|
4 | 4 |
|
5 |
| -use Cypress\GitElephantBundle\Collection\GitElephantRepositoryCollection; |
6 |
| -use GitElephant\Objects\Remote; |
7 | 5 | use GitElephant\Repository;
|
8 |
| -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 6 | +use GitElephant\Objects\Remote; |
| 7 | +use Symfony\Component\Console\Output\Output; |
| 8 | +use Symfony\Component\Console\Command\Command; |
| 9 | +use Symfony\Component\Console\Input\InputOption; |
9 | 10 | use Symfony\Component\Console\Input\InputArgument;
|
10 | 11 | use Symfony\Component\Console\Input\InputInterface;
|
11 |
| -use Symfony\Component\Console\Input\InputOption; |
12 |
| -use Symfony\Component\Console\Output\Output; |
13 | 12 | use Symfony\Component\Console\Output\OutputInterface;
|
| 13 | +use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 14 | +use Cypress\GitElephantBundle\Collection\GitElephantRepositoryCollection; |
14 | 15 |
|
15 | 16 | /**
|
16 | 17 | * Class TagCommand
|
|
19 | 20 | * @package Cypress\GitElephantBundle\Command
|
20 | 21 | * @author David Romaní <[email protected]>
|
21 | 22 | */
|
22 |
| -class TagCommand extends ContainerAwareCommand |
| 23 | +class TagCommand extends Command |
23 | 24 | {
|
| 25 | + |
| 26 | + /** |
| 27 | + * The collection of repositories from which one will be commiting |
| 28 | + * |
| 29 | + * @var GitElephantRepositoryCollection |
| 30 | + */ |
| 31 | + private $repositories; |
| 32 | + |
| 33 | + public function __construct(GitElephantRepositoryCollection $c) |
| 34 | + { |
| 35 | + $this->repositories = $c; |
| 36 | + parent::__construct(); |
| 37 | + } |
| 38 | + |
24 | 39 | /**
|
25 | 40 | * Tag command configuration
|
26 | 41 | */
|
@@ -83,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
|
83 | 98 | }
|
84 | 99 |
|
85 | 100 | /** @var GitElephantRepositoryCollection $rc */
|
86 |
| - $rc = $this->getContainer()->get('git_repositories'); |
| 101 | + $rc = $this->repositories; |
87 | 102 |
|
88 | 103 | if ($rc->count() == 0) {
|
89 | 104 | throw new \Exception('Must have at least one Git repository. See https://github.com/matteosister/GitElephantBundle#how-to-use');
|
|
0 commit comments