Passed
Pull Request — master (#6)
by ANTHONIUS
02:39
created

RestoreCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the dotfiles project.
7
 *
8
 *     (c) Anthonius Munthi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Dotfiles\Core\Command;
15
16
use Dotfiles\Core\Processor\Restore;
17
use Symfony\Component\Console\Input\InputInterface;
18
use Symfony\Component\Console\Output\OutputInterface;
19
20
class RestoreCommand extends Command
21
{
22
    /**
23
     * @var Restore
24
     */
25
    private $restore;
26
27
    public function __construct(?string $name = null, Restore $restore)
28
    {
29
        parent::__construct($name);
30
        $this->restore = $restore;
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function configure(): void
37
    {
38
        $this
39
            ->setName('restore')
40
            ->setDescription('Restore dotfiles from backup')
41
        ;
42
    }
43
44
    protected function execute(InputInterface $input, OutputInterface $output): void
45
    {
46
        $this->restore->run();
47
    }
48
}
49