YamlFileLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setLocale() 0 10 3
1
<?php
2
3
/*
4
 * This file is part of the ConfigCacheBundle package.
5
 *
6
 * Copyright (c) 2015-2016 Yahoo Japan Corporation
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace YahooJapan\ConfigCacheBundle\ConfigCache\Locale\Loader;
13
14
use YahooJapan\ConfigCacheBundle\ConfigCache\Loader\YamlFileLoader as BaseYamlFileLoader;
15
16
/**
17
 * YamlFileLoader loads YAML files translated user configurations.
18
 */
19
class YamlFileLoader extends BaseYamlFileLoader implements TranslationLoaderInterface
20
{
21
    /**
22
     * Sets a locale.
23
     *
24
     * @param string $locale
25
     *
26
     * @return YamlFileLoader
27
     */
28 5
    public function setLocale($locale)
29
    {
30 5
        foreach ($this->loaders as $loader) {
31 5
            if ($loader instanceof TranslationLoaderInterface) {
32 5
                $loader->setLocale($locale);
33 5
            }
34 5
        }
35
36 5
        return $this;
37
    }
38
}
39