TaskBasedDoctor::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
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