Currency   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 22
c 1
b 0
f 0
dl 0
loc 50
rs 10
ccs 12
cts 12
cp 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A metadata() 0 3 1
A setCurrency() 0 5 1
A getCurrency() 0 3 1
A getSymbol() 0 3 1
A setSymbol() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chemaclass\StockTicker\Domain\WriteModel;
6
7
final class Currency extends AbstractWriteModel
8
{
9
    public const CURRENCY = 'currency';
10
    public const SYMBOL = 'symbol';
11
12
    protected const PROPERTY_NAME_MAP = [
13
        'currency' => self::CURRENCY,
14
        'Currency' => self::CURRENCY,
15
        'symbol' => self::SYMBOL,
16
        'Symbol' => self::SYMBOL,
17
    ];
18
19
    private const METADATA = [
20
        self::CURRENCY => [
21
            'type' => self::TYPE_STRING,
22
        ],
23
        self::SYMBOL => [
24
            'type' => self::TYPE_STRING,
25
        ],
26
    ];
27
    protected ?string $currency = null;
28
    protected ?string $symbol = null;
29
30 1
    public function getCurrency(): ?string
31
    {
32 1
        return $this->currency;
33
    }
34
35 1
    public function setCurrency(?string $currency): self
36
    {
37 1
        $this->currency = $currency;
38
39 1
        return $this;
40
    }
41
42 1
    public function getSymbol(): ?string
43
    {
44 1
        return $this->symbol;
45
    }
46
47 1
    public function setSymbol(?string $symbol): self
48
    {
49 1
        $this->symbol = $symbol;
50
51 1
        return $this;
52
    }
53
54 15
    protected function metadata(): array
55
    {
56 15
        return self::METADATA;
57
    }
58
}
59