OutputWriter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 22
rs 10
c 0
b 0
f 0
ccs 10
cts 10
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 10 1
A __construct() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Writer;
5
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
final class OutputWriter implements WriteInterface
9
{
10
    /**
11
     * @var OutputInterface
12
     */
13
    private $output;
14
15 11
    public function __construct(OutputInterface $output)
16
    {
17 11
        $this->output = $output;
18 11
    }
19
20 11
    public function write(string $content, string $fileName): void
21
    {
22 11
        $this->output->writeln(
23 11
            sprintf('<comment>START FILE %s==================================================</comment>', $fileName)
24
        );
25 11
        $this->output->writeln($content);
26 11
        $this->output->writeln(
27 11
            sprintf('<comment>END FILE %s####################################################</comment>', $fileName)
28
        );
29 11
        $this->output->writeln("<comment>#\n#\n#\n#</comment>");
30 11
    }
31
}
32