RegularMarketChange::setRaw()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chemaclass\StockTicker\Domain\WriteModel;
6
7
final class RegularMarketChange extends AbstractWriteModel
8
{
9
    public const FMT = 'fmt';
10
    public const RAW = 'raw';
11
12
    protected const PROPERTY_NAME_MAP = [
13
        'raw' => self::RAW,
14
        'Raw' => self::RAW,
15
        'fmt' => self::FMT,
16
        'Fmt' => self::FMT,
17
    ];
18
19
    private const METADATA = [
20
        self::FMT => [
21
            'type' => self::TYPE_STRING,
22
        ],
23
        self::RAW => [
24
            'type' => self::TYPE_FLOAT,
25
        ],
26
    ];
27
28
    protected ?string $fmt = null;
29
    protected ?float $raw = null;
30
31 1
    public function getFmt(): ?string
32
    {
33 1
        return $this->fmt;
34
    }
35
36 1
    public function setFmt(?string $fmt): self
37
    {
38 1
        $this->fmt = $fmt;
39
40 1
        return $this;
41
    }
42
43 1
    public function getRaw(): ?float
44
    {
45 1
        return $this->raw;
46
    }
47
48 1
    public function setRaw(?float $raw): self
49
    {
50 1
        $this->raw = $raw;
51
52 1
        return $this;
53
    }
54
55 13
    protected function metadata(): array
56
    {
57 13
        return self::METADATA;
58
    }
59
}
60