Passed
Pull Request — master (#50)
by Marco
02:36
created

SymfonyConsoleTextFormatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A write() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Roave\BackwardCompatibility\Formatter;
6
7
use Roave\BackwardCompatibility\Change;
8
use Roave\BackwardCompatibility\Changes;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
final class SymfonyConsoleTextFormatter implements OutputFormatter
12
{
13
    /** @var OutputInterface */
14
    private $output;
15
16
    public function __construct(OutputInterface $output)
17
    {
18
        $this->output = $output;
19
    }
20
21
    public function write(Changes $changes) : void
22
    {
23
        /** @var Change $change */
24
        foreach ($changes as $change) {
25
            $this->output->writeln((string) $change);
26
        }
27
    }
28
}
29