Completed
Push — master ( 95a54c...7178fa )
by Samuel
10:58
created

DoctorCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
namespace Dock\Cli\Docker;
4
5
use Dock\Doctor\Doctor;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Input\InputOption;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class DoctorCommand extends Command
12
{
13
    /**
14
     * @var Doctor
15
     */
16
    private $doctor;
17
18
    /**
19
     * @param Doctor $doctor
20
     */
21
    public function __construct(Doctor $doctor)
22
    {
23
        parent::__construct();
24
25
        $this->doctor = $doctor;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function configure()
32
    {
33
        $this
34
            ->setName('docker:doctor')
35
            ->setDescription('Diagnose problems with Docker setup and attempt to fix them')
36
            ->addOption(
37
                'dry-run',
38
                null,
39
                InputOption::VALUE_NONE,
40
                "Diagnose problems, don't attempt to fix them"
41
            )
42
        ;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function execute(InputInterface $input, OutputInterface $output)
49
    {
50
        $this->doctor->examine($output, $input->getOption('dry-run'));
51
    }
52
}
53