GetSettings   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 23
rs 10
wmc 7

3 Methods

Rating   Name   Duplication   Size   Complexity  
A locale() 0 3 1
A __construct() 0 7 5
A currency() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Company\Application\Settings\Query;
15
16
use Company\Domain\Model\VO\Currency;
17
use Company\Domain\Model\VO\Locale;
18
use Core\Domain\Common\Query\QueryInterface;
19
20
final class GetSettings implements QueryInterface
21
{
22
    private ?string $currency = null;
23
    private ?string $locale = null;
24
25
    public function __construct(?string $setting = null)
26
    {
27
        if (null !== $setting && \in_array($setting, Locale::LOCALE, true)) {
28
            $this->currency = $setting;
29
        }
30
        if (null !== $setting && \in_array($setting, Currency::CURRENCY, true)) {
31
            $this->locale = $setting;
32
        }
33
    }
34
35
    public function currency(): ?string
36
    {
37
        return $this->currency;
38
    }
39
40
    public function locale(): ?string
41
    {
42
        return $this->locale;
43
    }
44
}
45