1 | <?php |
||
2 | |||
3 | namespace Bdf\Prime\Migration\Console; |
||
4 | |||
5 | use Bdf\Prime\Migration\MigrationManager; |
||
6 | use Symfony\Component\Console\Command\Command; |
||
7 | use Symfony\Component\Console\Input\InputInterface; |
||
8 | use Symfony\Component\Console\Output\OutputInterface; |
||
9 | |||
10 | /** |
||
11 | * AbstractCommand |
||
12 | */ |
||
13 | abstract class AbstractCommand extends Command |
||
14 | { |
||
15 | /** |
||
16 | * @var MigrationManager |
||
17 | */ |
||
18 | private $manager; |
||
19 | |||
20 | /** |
||
21 | * Migration command constructor. |
||
22 | * |
||
23 | * @param MigrationManager $manager |
||
24 | */ |
||
25 | 32 | public function __construct(MigrationManager $manager) |
|
26 | { |
||
27 | 32 | $this->manager = $manager; |
|
28 | |||
29 | 32 | parent::__construct(static::$defaultName); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * Add console context on manager |
||
34 | * |
||
35 | * @param InputInterface $input |
||
36 | * @param OutputInterface $output |
||
37 | * |
||
38 | * @return MigrationManager |
||
39 | */ |
||
40 | 32 | public function manager(InputInterface $input, OutputInterface $output): MigrationManager |
|
41 | { |
||
42 | 32 | $this->manager->setOutput($output); |
|
43 | 32 | $this->manager->setInput($input); |
|
44 | 32 | $this->manager->setHelper($this->getHelperSet()); |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
45 | |||
46 | 32 | return $this->manager; |
|
47 | } |
||
48 | } |
||
49 |