Completed
Pull Request — master (#15)
by James
02:25
created

SymfonyConsoleTextFormatter::write()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Roave\ApiCompare\Formatter;
5
6
use Roave\ApiCompare\Change;
7
use Roave\ApiCompare\Changes;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
final class SymfonyConsoleTextFormatter implements OutputFormatter
11
{
12
    /**
13
     * @var OutputInterface
14
     */
15
    private $output;
16
17
    public function __construct(OutputInterface $output)
18
    {
19
        $this->output = $output;
20
    }
21
22
    public function write(Changes $changes) : void
23
    {
24
        /** @var Change $change */
25
        foreach ($changes as $change) {
26
            $this->output->writeln((string)$change);
27
        }
28
    }
29
}
30