Passed
Push — develop ( 888544...81b1bd )
by Laurent
02:19
created

Settings::changeCurrency()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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 Administration\Domain\Settings\Model;
15
16
use Administration\Domain\Settings\Model\VO\Currency;
17
use Administration\Domain\Settings\Model\VO\Locale;
18
use Administration\Domain\Settings\Model\VO\SettingsUuid;
19
20
final class Settings
21
{
22
    private string $uuid;
23
    private string $locale;
24
    private string $currency;
25
26
    public function __construct(SettingsUuid $uuid, Locale $locale, Currency $currency)
27
    {
28
        $this->uuid = $uuid->toString();
29
        $this->locale = $locale->getValue();
30
        $this->currency = $currency->getValue();
31
    }
32
33
    public static function create(SettingsUuid $uuid, Locale $locale, Currency $currency): self
34
    {
35
        return new self($uuid, $locale, $currency);
36
    }
37
38
    public function uuid(): string
39
    {
40
        return $this->uuid;
41
    }
42
43
    public function locale(): string
44
    {
45
        return $this->locale;
46
    }
47
48
    public function currency(): string
49
    {
50
        return $this->currency;
51
    }
52
53
    public function changeLocale(string $locale): self
54
    {
55
        $this->locale = $locale;
56
57
        return $this;
58
    }
59
60
    public function changeCurrency(string $currency): self
61
    {
62
        $this->currency = $currency;
63
64
        return $this;
65
    }
66
}
67