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

SymfonyConsoleTextFormatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 5 2
A __construct() 0 3 1
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