Passed
Push — master ( f6cdcb...e2cbe1 )
by Chema
03:23
created

Trend   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 129
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 13
eloc 60
c 0
b 0
f 0
dl 0
loc 129
rs 10
ccs 32
cts 32
cp 1

13 Methods

Rating   Name   Duplication   Size   Complexity  
A metadata() 0 3 1
A getPeriod() 0 3 1
A getStrongBuy() 0 3 1
A setBuy() 0 5 1
A getHold() 0 3 1
A getBuy() 0 3 1
A setSell() 0 5 1
A setHold() 0 5 1
A setPeriod() 0 5 1
A getStrongSell() 0 3 1
A setStrongBuy() 0 5 1
A getSell() 0 3 1
A setStrongSell() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chemaclass\StockTicker\Domain\WriteModel;
6
7
final class Trend extends AbstractWriteModel
0 ignored issues
show
Bug introduced by
The type Chemaclass\StockTicker\D...odel\AbstractWriteModel 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...
8
{
9
    public const PERIOD = 'period';
10
    public const STRONG_BUY = 'strongBuy';
11
    public const BUY = 'buy';
12
    public const HOLD = 'hold';
13
    public const SELL = 'sell';
14
    public const STRONG_SELL = 'strongSell';
15
16
    protected const PROPERTY_NAME_MAP = [
17
        'period' => self::PERIOD,
18
        'Period' => self::PERIOD,
19
        'strong_buy' => self::STRONG_BUY,
20
        'strongBuy' => self::STRONG_BUY,
21
        'StrongBuy' => self::STRONG_BUY,
22
        'buy' => self::BUY,
23
        'Buy' => self::BUY,
24
        'hold' => self::HOLD,
25
        'Hold' => self::HOLD,
26
        'sell' => self::SELL,
27
        'Sell' => self::SELL,
28
        'strong_sell' => self::STRONG_SELL,
29
        'strongSell' => self::STRONG_SELL,
30
        'StrongSell' => self::STRONG_SELL,
31
    ];
32
33
    private const METADATA = [
34
        self::PERIOD => [
35
            'type' => self::TYPE_STRING,
36
        ],
37
        self::STRONG_BUY => [
38
            'type' => self::TYPE_INT,
39
        ],
40
        self::BUY => [
41
            'type' => self::TYPE_INT,
42
        ],
43
        self::HOLD => [
44
            'type' => self::TYPE_INT,
45
        ],
46
        self::SELL => [
47
            'type' => self::TYPE_INT,
48
        ],
49
        self::STRONG_SELL => [
50
            'type' => self::TYPE_INT,
51
        ],
52
    ];
53
54
    protected ?string $period = null;
55
    protected ?int $strongBuy = null;
56
    protected ?int $buy = null;
57
    protected ?int $hold = null;
58
    protected ?int $sell = null;
59
    protected ?int $strongSell = null;
60
61 1
    public function getPeriod(): ?string
62
    {
63 1
        return $this->period;
64
    }
65
66 1
    public function setPeriod(string $period): self
67
    {
68 1
        $this->period = $period;
69
70 1
        return $this;
71
    }
72
73 1
    public function getStrongBuy(): ?int
74
    {
75 1
        return $this->strongBuy;
76
    }
77
78 1
    public function setStrongBuy(int $strongBuy): self
79
    {
80 1
        $this->strongBuy = $strongBuy;
81
82 1
        return $this;
83
    }
84
85 1
    public function getBuy(): ?int
86
    {
87 1
        return $this->buy;
88
    }
89
90 1
    public function setBuy(int $buy): self
91
    {
92 1
        $this->buy = $buy;
93
94 1
        return $this;
95
    }
96
97 1
    public function getHold(): ?int
98
    {
99 1
        return $this->hold;
100
    }
101
102 1
    public function setHold(int $hold): self
103
    {
104 1
        $this->hold = $hold;
105
106 1
        return $this;
107
    }
108
109 1
    public function getSell(): ?int
110
    {
111 1
        return $this->sell;
112
    }
113
114 1
    public function setSell(int $sell): self
115
    {
116 1
        $this->sell = $sell;
117
118 1
        return $this;
119
    }
120
121 1
    public function getStrongSell(): ?int
122
    {
123 1
        return $this->strongSell;
124
    }
125
126 1
    public function setStrongSell(int $strongSell): self
127
    {
128 1
        $this->strongSell = $strongSell;
129
130 1
        return $this;
131
    }
132
133 13
    protected function metadata(): array
134
    {
135 13
        return self::METADATA;
136
    }
137
}
138