Passed
Push — develop ( 6aee1f...577144 )
by Laurent
01:44
created

Settings   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
dl 0
loc 69
rs 10
c 1
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setLocale() 0 5 1
A getUuid() 0 3 1
A __construct() 0 5 1
A getCurrency() 0 3 1
A setUuid() 0 5 1
A getLocale() 0 3 1
A setCurrency() 0 5 1
A fromModel() 0 6 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 Administration\Infrastructure\Persistence\DoctrineOrm\Entities;
15
16
use Administration\Domain\Settings\Model\Settings as SettingsModel;
17
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
19
/**
20
 * @ORM\Table(name="settings")
21
 * @ORM\Entity(repositoryClass="Administration\Infrastructure\Persistence\DoctrineOrm\Repositories\DoctrineSettingsRepository")
22
 */
23
class Settings
24
{
25
    /**
26
     * @ORM\Id
27
     * @ORM\Column(type="guid", name="uuid")
28
     * @ORM\GeneratedValue(strategy="NONE")
29
     */
30
    private string $uuid;
31
32
    /**
33
     * @ORM\Column(type="string", name="locale", nullable=false)
34
     */
35
    private string $locale;
36
37
    /**
38
     * @ORM\Column(type="string", name="currency", nullable=false)
39
     */
40
    private string $currency;
41
42
    public function __construct(string $uuid, string $locale, string $currency)
43
    {
44
        $this->uuid = $uuid;
45
        $this->locale = $locale;
46
        $this->currency = $currency;
47
    }
48
49
    public static function fromModel(SettingsModel $settingsModel): self
50
    {
51
        return new self(
52
            $settingsModel->uuid(),
53
            $settingsModel->locale(),
54
            $settingsModel->currency()
55
        );
56
    }
57
58
    public function getUuid(): string
59
    {
60
        return $this->uuid;
61
    }
62
63
    public function setUuid(string $uuid): self
64
    {
65
        $this->uuid = $uuid;
66
67
        return $this;
68
    }
69
70
    public function getLocale(): string
71
    {
72
        return $this->locale;
73
    }
74
75
    public function setLocale(string $locale): self
76
    {
77
        $this->locale = $locale;
78
79
        return $this;
80
    }
81
82
    public function getCurrency(): string
83
    {
84
        return $this->currency;
85
    }
86
87
    public function setCurrency(string $currency): self
88
    {
89
        $this->currency = $currency;
90
91
        return $this;
92
    }
93
}
94