Completed
Push — final-forms ( 80b973...cafa21 )
by Kamil
35:41 queued 17:05
created

ImmutableTranslationLocaleProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDefinedLocalesCodes() 0 4 1
A getDefaultLocaleCode() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Component\Resource\Provider;
13
14
/**
15
 * @author Kamil Kokot <[email protected]>
16
 */
17
final class ImmutableTranslationLocaleProvider implements TranslationLocaleProviderInterface
18
{
19
    /**
20
     * @var array
21
     */
22
    private $definedLocalesCodes;
23
24
    /**
25
     * @var string
26
     */
27
    private $defaultLocaleCode;
28
29
    /**
30
     * @param array $definedLocalesCodes
31
     * @param string $defaultLocaleCode
32
     */
33
    public function __construct(array $definedLocalesCodes, $defaultLocaleCode)
34
    {
35
        $this->definedLocalesCodes = $definedLocalesCodes;
36
        $this->defaultLocaleCode = $defaultLocaleCode;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getDefinedLocalesCodes()
43
    {
44
        return $this->definedLocalesCodes;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function getDefaultLocaleCode()
51
    {
52
        return $this->defaultLocaleCode;
53
    }
54
}
55