OutputWriter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 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