Passed
Push — master ( c0f32c...e879f4 )
by Chema
04:17 queued 41s
created

Trend   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 112
Duplicated Lines 0 %

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 13
eloc 45
c 0
b 0
f 0
dl 0
loc 112
ccs 20
cts 32
cp 0.625
rs 10

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
    private const METADATA = [
17
        self::PERIOD => [
18
            'type' => self::TYPE_STRING,
19
        ],
20
        self::STRONG_BUY => [
21
            'type' => self::TYPE_INT,
22
        ],
23
        self::BUY => [
24
            'type' => self::TYPE_INT,
25
        ],
26
        self::HOLD => [
27
            'type' => self::TYPE_INT,
28
        ],
29
        self::SELL => [
30
            'type' => self::TYPE_INT,
31
        ],
32
        self::STRONG_SELL => [
33
            'type' => self::TYPE_INT,
34
        ],
35
    ];
36
37
    protected ?string $period = null;
38
    protected ?int $strongBuy = null;
39
    protected ?int $buy = null;
40
    protected ?int $hold = null;
41
    protected ?int $sell = null;
42
    protected ?int $strongSell = null;
43
44
    public function getPeriod(): ?string
45
    {
46
        return $this->period;
47
    }
48
49 2
    public function setPeriod(string $period): self
50
    {
51 2
        $this->period = $period;
52
53 2
        return $this;
54
    }
55
56
    public function getStrongBuy(): ?int
57
    {
58
        return $this->strongBuy;
59
    }
60
61 2
    public function setStrongBuy(int $strongBuy): self
62
    {
63 2
        $this->strongBuy = $strongBuy;
64
65 2
        return $this;
66
    }
67
68
    public function getBuy(): ?int
69
    {
70
        return $this->buy;
71
    }
72
73 2
    public function setBuy(int $buy): self
74
    {
75 2
        $this->buy = $buy;
76
77 2
        return $this;
78
    }
79
80
    public function getHold(): ?int
81
    {
82
        return $this->hold;
83
    }
84
85 2
    public function setHold(int $hold): self
86
    {
87 2
        $this->hold = $hold;
88
89 2
        return $this;
90
    }
91
92
    public function getSell(): ?int
93
    {
94
        return $this->sell;
95
    }
96
97 2
    public function setSell(int $sell): self
98
    {
99 2
        $this->sell = $sell;
100
101 2
        return $this;
102
    }
103
104
    public function getStrongSell(): ?int
105
    {
106
        return $this->strongSell;
107
    }
108
109 2
    public function setStrongSell(int $strongSell): self
110
    {
111 2
        $this->strongSell = $strongSell;
112
113 2
        return $this;
114
    }
115
116 12
    protected function metadata(): array
117
    {
118 12
        return self::METADATA;
119
    }
120
}
121