Completed
Push — master ( 2cde75...6c52d6 )
by Arne
02:04
created

DumpCommand::executeConfigured()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 1
nop 3
1
<?php
2
3
namespace Storeman\Cli\Command;
4
5
use Storeman\Storeman;
6
use Storeman\Cli\SynchronizationProgressListener;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class DumpCommand extends AbstractCommand
13
{
14 View Code Duplication
    protected function configure()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        parent::configure();
17
18
        $this->setName('dump');
19
        $this->setDescription('Dump the contents of a vault.');
20
        $this->addArgument('path', InputArgument::REQUIRED, 'Target path.');
21
        $this->addOption('revision', 'r', InputOption::VALUE_REQUIRED, 'Restore given revision. Defaults to last revision.');
22
        $this->addOption('vault', null, InputOption::VALUE_REQUIRED, 'Vault to use to download state from.');
23
    }
24
25 View Code Duplication
    protected function executeConfigured(InputInterface $input, OutputInterface $output, Storeman $storeman): int
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        $storeman->dump(
28
            $input->getArgument('path'),
29
            $input->getOption(  'revision') ? (int)$input->getOption('revision') : null,
30
            $input->getOption('vault'),
31
            new SynchronizationProgressListener($output)
32
        );
33
34
        $output->writeln(PHP_EOL . '<info>Done!</info>');
35
36
        return 0;
37
    }
38
}
39