YamlLoader   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseFile() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Translation\Loaders;
5
6
use Symfony\Component\Yaml\Yaml;
7
8
/**
9
 * YamlLoader
10
 * Loads texts from yaml files
11
 *
12
 * @author Jakub Konečný
13
 */
14 1
final class YamlLoader extends FileLoader {
15
  protected $extension = "yaml";
16
17
  /**
18
   * @throws \Symfony\Component\Yaml\Exception\ParseException
19
   */
20
  protected function parseFile(string $filename): array {
21 1
    return Yaml::parseFile($filename);
0 ignored issues
show
Bug Best Practice introduced by Jakub Konečný
The expression return Symfony\Component...l::parseFile($filename) also could return the type Symfony\Component\Yaml\Tag\TaggedValue|null|string which is incompatible with the return type mandated by Nexendrie\Translation\Lo...FileLoader::parseFile() of array.
Loading history...
22
  }
23
}
24
?>