@@ -8,18 +8,18 @@ |
||
8 | 8 | |
9 | 9 | class Dumper implements DumperInterface |
10 | 10 | { |
11 | - /** |
|
12 | - * @var OutputInterface |
|
13 | - */ |
|
14 | - private $output; |
|
11 | + /** |
|
12 | + * @var OutputInterface |
|
13 | + */ |
|
14 | + private $output; |
|
15 | 15 | |
16 | - public function __construct(OutputInterface $output) |
|
17 | - { |
|
18 | - $this->output = $output; |
|
19 | - } |
|
16 | + public function __construct(OutputInterface $output) |
|
17 | + { |
|
18 | + $this->output = $output; |
|
19 | + } |
|
20 | 20 | |
21 | - public function dumpPatch(string $code): void |
|
22 | - { |
|
23 | - $this->output->writeln($code); |
|
24 | - } |
|
21 | + public function dumpPatch(string $code): void |
|
22 | + { |
|
23 | + $this->output->writeln($code); |
|
24 | + } |
|
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | interface DumperInterface |
8 | 8 | { |
9 | - public function dumpPatch(string $code): void; |
|
9 | + public function dumpPatch(string $code): void; |
|
10 | 10 | } |
@@ -16,51 +16,51 @@ |
||
16 | 16 | */ |
17 | 17 | class RevertPatchCommand extends Command |
18 | 18 | { |
19 | - /** |
|
20 | - * @var PatchService |
|
21 | - */ |
|
22 | - private $patchService; |
|
19 | + /** |
|
20 | + * @var PatchService |
|
21 | + */ |
|
22 | + private $patchService; |
|
23 | 23 | |
24 | - public function __construct(PatchService $patchService) |
|
25 | - { |
|
26 | - parent::__construct(); |
|
27 | - $this->patchService = $patchService; |
|
28 | - } |
|
24 | + public function __construct(PatchService $patchService) |
|
25 | + { |
|
26 | + parent::__construct(); |
|
27 | + $this->patchService = $patchService; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * {@inheritdoc} |
|
33 | - */ |
|
34 | - protected function configure() |
|
35 | - { |
|
36 | - $this |
|
37 | - ->setName('patches:revert') |
|
38 | - ->setDescription('Revert a patch.') |
|
39 | - ->addArgument( |
|
40 | - 'name', |
|
41 | - InputArgument::REQUIRED, |
|
42 | - 'The name of the patch instance to be reverted' |
|
43 | - ) |
|
44 | - ->setHelp(<<<EOT |
|
31 | + /** |
|
32 | + * {@inheritdoc} |
|
33 | + */ |
|
34 | + protected function configure() |
|
35 | + { |
|
36 | + $this |
|
37 | + ->setName('patches:revert') |
|
38 | + ->setDescription('Revert a patch.') |
|
39 | + ->addArgument( |
|
40 | + 'name', |
|
41 | + InputArgument::REQUIRED, |
|
42 | + 'The name of the patch instance to be reverted' |
|
43 | + ) |
|
44 | + ->setHelp(<<<EOT |
|
45 | 45 | Reverts a patch. You must pass in parameter the name of the patch. |
46 | 46 | EOT |
47 | - ); |
|
47 | + ); |
|
48 | 48 | |
49 | - $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The patch will still be reverted.'); |
|
50 | - } |
|
49 | + $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The patch will still be reverted.'); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * {@inheritdoc} |
|
54 | - */ |
|
55 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
56 | - { |
|
57 | - if ($input->getOption('dump')) { |
|
58 | - $this->patchService->setDumper(new Dumper($output)); |
|
59 | - } |
|
52 | + /** |
|
53 | + * {@inheritdoc} |
|
54 | + */ |
|
55 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
56 | + { |
|
57 | + if ($input->getOption('dump')) { |
|
58 | + $this->patchService->setDumper(new Dumper($output)); |
|
59 | + } |
|
60 | 60 | |
61 | - $patchName = $input->getArgument('name'); |
|
62 | - $this->patchService->revert($patchName); |
|
61 | + $patchName = $input->getArgument('name'); |
|
62 | + $this->patchService->revert($patchName); |
|
63 | 63 | |
64 | - $output->writeln('Patch successfully reverted'); |
|
65 | - } |
|
64 | + $output->writeln('Patch successfully reverted'); |
|
65 | + } |
|
66 | 66 | } |
@@ -16,54 +16,54 @@ |
||
16 | 16 | */ |
17 | 17 | class ApplyPatchCommand extends Command |
18 | 18 | { |
19 | - /** |
|
20 | - * @var PatchService |
|
21 | - */ |
|
22 | - private $patchService; |
|
19 | + /** |
|
20 | + * @var PatchService |
|
21 | + */ |
|
22 | + private $patchService; |
|
23 | 23 | |
24 | - public function __construct(PatchService $patchService) |
|
25 | - { |
|
26 | - parent::__construct(); |
|
27 | - $this->patchService = $patchService; |
|
28 | - } |
|
24 | + public function __construct(PatchService $patchService) |
|
25 | + { |
|
26 | + parent::__construct(); |
|
27 | + $this->patchService = $patchService; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * {@inheritdoc} |
|
33 | - */ |
|
34 | - protected function configure() |
|
35 | - { |
|
36 | - $this |
|
37 | - ->setName('patches:apply') |
|
38 | - ->setDescription('Apply a patch.') |
|
39 | - ->addArgument( |
|
40 | - 'name', |
|
41 | - InputArgument::REQUIRED, |
|
42 | - 'The name of the patch instance to be applied' |
|
43 | - ) |
|
44 | - ->setHelp(<<<EOT |
|
31 | + /** |
|
32 | + * {@inheritdoc} |
|
33 | + */ |
|
34 | + protected function configure() |
|
35 | + { |
|
36 | + $this |
|
37 | + ->setName('patches:apply') |
|
38 | + ->setDescription('Apply a patch.') |
|
39 | + ->addArgument( |
|
40 | + 'name', |
|
41 | + InputArgument::REQUIRED, |
|
42 | + 'The name of the patch instance to be applied' |
|
43 | + ) |
|
44 | + ->setHelp(<<<EOT |
|
45 | 45 | Apply a patch. You must pass in parameter the name of the patch. |
46 | 46 | |
47 | 47 | Use patches:apply-all to apply all pending patches. |
48 | 48 | EOT |
49 | - ); |
|
49 | + ); |
|
50 | 50 | |
51 | - $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The patch will still be applied.'); |
|
52 | - } |
|
51 | + $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The patch will still be applied.'); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * {@inheritdoc} |
|
56 | - */ |
|
57 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
58 | - { |
|
59 | - if ($input->getOption('dump')) { |
|
60 | - $this->patchService->setDumper(new Dumper($output)); |
|
61 | - } |
|
54 | + /** |
|
55 | + * {@inheritdoc} |
|
56 | + */ |
|
57 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
58 | + { |
|
59 | + if ($input->getOption('dump')) { |
|
60 | + $this->patchService->setDumper(new Dumper($output)); |
|
61 | + } |
|
62 | 62 | |
63 | 63 | |
64 | - $patchName = $input->getArgument('name'); |
|
65 | - $this->patchService->apply($patchName); |
|
64 | + $patchName = $input->getArgument('name'); |
|
65 | + $this->patchService->apply($patchName); |
|
66 | 66 | |
67 | - $output->writeln('Patch successfully applied'); |
|
68 | - } |
|
67 | + $output->writeln('Patch successfully applied'); |
|
68 | + } |
|
69 | 69 | } |
@@ -16,40 +16,40 @@ |
||
16 | 16 | */ |
17 | 17 | class ResetPatchesCommand extends AbstractApplyAllCommand |
18 | 18 | { |
19 | - /** |
|
20 | - * {@inheritdoc} |
|
21 | - */ |
|
22 | - protected function configure() |
|
23 | - { |
|
24 | - $this |
|
25 | - ->setName('patches:reset') |
|
26 | - ->setDescription('Reset database and reapply all patches.') |
|
27 | - ->setDefinition(array( |
|
28 | - |
|
29 | - )) |
|
30 | - ->setHelp(<<<EOT |
|
19 | + /** |
|
20 | + * {@inheritdoc} |
|
21 | + */ |
|
22 | + protected function configure() |
|
23 | + { |
|
24 | + $this |
|
25 | + ->setName('patches:reset') |
|
26 | + ->setDescription('Reset database and reapply all patches.') |
|
27 | + ->setDefinition(array( |
|
28 | + |
|
29 | + )) |
|
30 | + ->setHelp(<<<EOT |
|
31 | 31 | Reset the database and reapplies all pending patches. You can select the type of patches to be applied using the options. Default patches are always applied. |
32 | 32 | |
33 | 33 | Use patches:apply-all if you want to apply remaining patches without resetting the database. |
34 | 34 | EOT |
35 | - ); |
|
35 | + ); |
|
36 | 36 | |
37 | - $this->registerOptions(); |
|
37 | + $this->registerOptions(); |
|
38 | 38 | |
39 | - $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The database will still be reset.'); |
|
40 | - } |
|
39 | + $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patch to the output. Note: this is not a "dry" mode. The database will still be reset.'); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * {@inheritdoc} |
|
44 | - */ |
|
45 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
46 | - { |
|
47 | - if ($input->getOption('dump')) { |
|
48 | - $this->patchService->setDumper(new Dumper($output)); |
|
49 | - } |
|
42 | + /** |
|
43 | + * {@inheritdoc} |
|
44 | + */ |
|
45 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
46 | + { |
|
47 | + if ($input->getOption('dump')) { |
|
48 | + $this->patchService->setDumper(new Dumper($output)); |
|
49 | + } |
|
50 | 50 | |
51 | - $this->patchService->reset(); |
|
51 | + $this->patchService->reset(); |
|
52 | 52 | |
53 | - $this->applyAll($input, $output); |
|
54 | - } |
|
53 | + $this->applyAll($input, $output); |
|
54 | + } |
|
55 | 55 | } |
@@ -18,37 +18,37 @@ |
||
18 | 18 | { |
19 | 19 | |
20 | 20 | |
21 | - /** |
|
22 | - * {@inheritdoc} |
|
23 | - */ |
|
24 | - protected function configure() |
|
25 | - { |
|
26 | - $this |
|
27 | - ->setName('patches:apply-all') |
|
28 | - ->setDescription('Apply pending patches.') |
|
29 | - ->setDefinition(array( |
|
30 | - |
|
31 | - )) |
|
32 | - ->setHelp(<<<EOT |
|
21 | + /** |
|
22 | + * {@inheritdoc} |
|
23 | + */ |
|
24 | + protected function configure() |
|
25 | + { |
|
26 | + $this |
|
27 | + ->setName('patches:apply-all') |
|
28 | + ->setDescription('Apply pending patches.') |
|
29 | + ->setDefinition(array( |
|
30 | + |
|
31 | + )) |
|
32 | + ->setHelp(<<<EOT |
|
33 | 33 | Apply pending patches. You can select the type of patches to be applied using the options. Default patches are always applied. |
34 | 34 | |
35 | 35 | Use patches:apply if you want to cherry-pick a particular patch. |
36 | 36 | EOT |
37 | - ); |
|
38 | - |
|
39 | - $this->registerOptions(); |
|
40 | - |
|
41 | - $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patches to the output. Note: this is not a "dry" mode. The patches will still be applied.'); |
|
42 | - } |
|
43 | - |
|
44 | - /** |
|
45 | - * {@inheritdoc} |
|
46 | - */ |
|
47 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
48 | - { |
|
49 | - if ($input->getOption('dump')) { |
|
50 | - $this->patchService->setDumper(new Dumper($output)); |
|
51 | - } |
|
52 | - $this->applyAll($input, $output); |
|
53 | - } |
|
37 | + ); |
|
38 | + |
|
39 | + $this->registerOptions(); |
|
40 | + |
|
41 | + $this->addOption('dump', 'd', InputOption::VALUE_NONE, 'Dumps the patches to the output. Note: this is not a "dry" mode. The patches will still be applied.'); |
|
42 | + } |
|
43 | + |
|
44 | + /** |
|
45 | + * {@inheritdoc} |
|
46 | + */ |
|
47 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
48 | + { |
|
49 | + if ($input->getOption('dump')) { |
|
50 | + $this->patchService->setDumper(new Dumper($output)); |
|
51 | + } |
|
52 | + $this->applyAll($input, $output); |
|
53 | + } |
|
54 | 54 | } |