Code Duplication    Length = 31-32 lines in 4 locations

src/Nexus/Dumper/Communication/Command/DumpLocalCommand.php 1 location

@@ 15-46 (lines=32) @@
12
/**
13
 * @method \Nexus\Dumper\DumperFacade getFacade()
14
 */
15
class DumpLocalCommand extends AbstractCommand
16
{
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('dumper:dump:local')
21
            ->setDescription('Dump one volume')
22
            ->addArgument('volume', InputArgument::REQUIRED, 'The volume to dump')
23
            ->addArgument('path', InputArgument::REQUIRED, 'The path inside the volume to dump')
24
            ->addArgument('version', InputArgument::REQUIRED, 'The version for naming of your dump')
25
            ->addArgument('datapath', InputArgument::OPTIONAL, 'The Datapath for naming of your dump', '/data');
26
    }
27
28
    /**
29
     * @param \Symfony\Component\Console\Input\InputInterface $input
30
     * @param \Symfony\Component\Console\Output\OutputInterface $output
31
     *
32
     * @return int|null|void
33
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
34
     * @throws \Xervice\Config\Exception\ConfigNotFound
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output)
37
    {
38
        $this->getFacade()->dumpToLocal(
39
            $input->getArgument('volume'),
40
            $input->getArgument('path'),
41
            $input->getArgument('version'),
42
            $input->getArgument('datapath')
43
        );
44
    }
45
46
}

src/Nexus/Dumper/Communication/Command/DumpSshCommand.php 1 location

@@ 15-45 (lines=31) @@
12
/**
13
 * @method \Nexus\Dumper\DumperFacade getFacade()
14
 */
15
class DumpSshCommand extends AbstractCommand
16
{
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('dumper:dump:ssh')
21
            ->setDescription('Dump one volume to ssh')
22
            ->addArgument('volume', InputArgument::REQUIRED, 'The volume to dump')
23
            ->addArgument('path', InputArgument::REQUIRED, 'The path inside the volume to dump')
24
            ->addArgument('version', InputArgument::REQUIRED, 'The version for naming of your dump')
25
            ->addArgument('datapath', InputArgument::OPTIONAL, 'The Datapath for naming of your dump', '/data');
26
    }
27
28
    /**
29
     * @param \Symfony\Component\Console\Input\InputInterface $input
30
     * @param \Symfony\Component\Console\Output\OutputInterface $output
31
     *
32
     * @return int|null|void
33
     * @throws \Xervice\Config\Exception\ConfigNotFound
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output)
36
    {
37
        $this->getFacade()->dumpToSsh(
38
            $input->getArgument('volume'),
39
            $input->getArgument('path'),
40
            $input->getArgument('version'),
41
            $input->getArgument('datapath')
42
        );
43
    }
44
45
}

src/Nexus/Dumper/Communication/Command/RestoreLocalCommand.php 1 location

@@ 15-46 (lines=32) @@
12
/**
13
 * @method \Nexus\Dumper\DumperFacade getFacade()
14
 */
15
class RestoreLocalCommand extends AbstractCommand
16
{
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('dumper:restore:local')
21
            ->setDescription('Restore one volume')
22
            ->addArgument('volume', InputArgument::REQUIRED, 'The volume to restore')
23
            ->addArgument('path', InputArgument::REQUIRED, 'The path inside the volume to restore')
24
            ->addArgument('version', InputArgument::REQUIRED, 'The version for naming of your restore')
25
            ->addArgument('datapath', InputArgument::OPTIONAL, 'The Datapath for naming of your restore', '/data');
26
    }
27
28
    /**
29
     * @param \Symfony\Component\Console\Input\InputInterface $input
30
     * @param \Symfony\Component\Console\Output\OutputInterface $output
31
     *
32
     * @return int|null|void
33
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
34
     * @throws \Xervice\Config\Exception\ConfigNotFound
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output)
37
    {
38
        $this->getFacade()->restoreToLocal(
39
            $input->getArgument('volume'),
40
            $input->getArgument('path'),
41
            $input->getArgument('version'),
42
            $input->getArgument('datapath')
43
        );
44
    }
45
46
}

src/Nexus/Dumper/Communication/Command/RestoreSshCommand.php 1 location

@@ 15-46 (lines=32) @@
12
/**
13
 * @method \Nexus\Dumper\DumperFacade getFacade()
14
 */
15
class RestoreSshCommand extends AbstractCommand
16
{
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('dumper:restore:ssh')
21
            ->setDescription('Restore one volume to ssh')
22
            ->addArgument('volume', InputArgument::REQUIRED, 'The volume to restore')
23
            ->addArgument('path', InputArgument::REQUIRED, 'The path inside the volume to restore')
24
            ->addArgument('version', InputArgument::REQUIRED, 'The version for naming of your restore')
25
            ->addArgument('datapath', InputArgument::OPTIONAL, 'The Datapath for naming of your restore', '/data');
26
    }
27
28
    /**
29
     * @param \Symfony\Component\Console\Input\InputInterface $input
30
     * @param \Symfony\Component\Console\Output\OutputInterface $output
31
     *
32
     * @return int|null|void
33
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
34
     * @throws \Xervice\Config\Exception\ConfigNotFound
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output)
37
    {
38
        $this->getFacade()->restoreToSsh(
39
            $input->getArgument('volume'),
40
            $input->getArgument('path'),
41
            $input->getArgument('version'),
42
            $input->getArgument('datapath')
43
        );
44
    }
45
46
}