YamlWriter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtension() 0 3 1
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of FlexPHP.
4
 *
5
 * (c) Freddie Gar <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace FlexPHP\Generator\Domain\Writers;
11
12
use Symfony\Component\Yaml\Yaml;
13
14 3
final class YamlWriter extends AbstractWriter
15
{
16 3
    public function __construct(array $data, string $filename, string $path)
17 3
    {
18 3
        parent::__construct(Yaml::dump($data, 4, 2), $filename, $path);
19 3
    }
20
21 3
    protected function getExtension(): string
22
    {
23 3
        return 'yaml';
24
    }
25
}
26