YamlFileLoader::setLocale()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

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