YamlReader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A readRaw() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Reader;
6
7
use Symfony\Component\Yaml\Yaml;
8
use Yiisoft\Composer\Config\Exception\UnsupportedFileTypeException;
9
10
/**
11
 * YamlReader - reads YAML files.
12
 */
13
class YamlReader extends AbstractReader
14
{
15
    protected function readRaw(string $path)
16
    {
17
        if (!class_exists(Yaml::class)) {
18
            throw new UnsupportedFileTypeException("For YAML support require `symfony/yaml` in your composer.json (reading $path)");
19
        }
20
21
        return Yaml::parse($this->getFileContents($path));
22
    }
23
}
24