TaskBasedDoctor::examine()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
namespace Dock\Doctor;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
class TaskBasedDoctor implements Doctor
8
{
9
    /**
10
     * @var Task[]
11
     */
12
    private $tasks;
13
14
    /**
15
     * @param Task[] $tasks
16
     */
17
    public function __construct(array $tasks)
18
    {
19
        $this->tasks = $tasks;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function examine(OutputInterface $output, $dryRun)
26
    {
27
        $output->writeLn('<info>Running Docker Doctor</info>');
28
29
        foreach ($this->tasks as $task) {
30
            $task->run($output, $dryRun);
31
        }
32
33
        $output->writeLn('<info>Yay! Your setup is working perfectly!</info>');
34
    }
35
}
36