TaskBasedDoctor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A examine() 0 10 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