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

Quote::setLatestNews()   A

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 0
Metric Value
eloc 2
c 0
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 Quote 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 SYMBOL = 'symbol';
10
    public const COMPANY_NAME = 'companyName';
11
    public const REGULAR_MARKET_PRICE = 'regularMarketPrice';
12
    public const CURRENCY = 'currency';
13
    public const REGULAR_MARKET_CHANGE = 'regularMarketChange';
14
    public const REGULAR_MARKET_CHANGE_PERCENT = 'regularMarketChangePercent';
15
    public const MARKET_CAP = 'marketCap';
16
    public const URL = 'url';
17
    public const LAST_TREND = 'lastTrend';
18
    public const LATEST_NEWS = 'latestNews';
19
20
    private const METADATA = [
21
        self::SYMBOL => [
22
            'type' => self::TYPE_STRING,
23
            'mandatory' => true,
24
        ],
25
        self::COMPANY_NAME => [
26
            'type' => CompanyName::class,
27
            'mandatory' => true,
28
        ],
29
        self::REGULAR_MARKET_PRICE => [
30
            'type' => RegularMarketPrice::class,
31
        ],
32
        self::CURRENCY => [
33
            'type' => Currency::class,
34
        ],
35
        self::REGULAR_MARKET_CHANGE => [
36
            'type' => RegularMarketChange::class,
37
        ],
38
        self::REGULAR_MARKET_CHANGE_PERCENT => [
39
            'type' => RegularMarketChangePercent::class,
40
        ],
41
        self::MARKET_CAP => [
42
            'type' => MarketCap::class,
43
        ],
44
        self::URL => [
45
            'type' => self::TYPE_STRING,
46
        ],
47
        self::LAST_TREND => [
48
            'type' => Trend::class,
49
            'is_array' => true,
50
        ],
51
        self::LATEST_NEWS => [
52
            'type' => News::class,
53
            'is_array' => true,
54
        ],
55
    ];
56
57
    protected ?string $symbol = null;
58
    protected ?CompanyName $companyName = null;
59
    protected ?Currency $currency = null;
60
    protected ?string $url = null;
61
    protected ?RegularMarketPrice $regularMarketPrice = null;
62
    protected ?RegularMarketChange $regularMarketChange = null;
63
    protected ?RegularMarketChangePercent $regularMarketChangePercent = null;
64
    protected ?MarketCap $marketCap = null;
65
66
    /** @var Trend[] */
67
    protected array $lastTrend = [];
68
69
    /** @var News[] */
70
    protected array $latestNews = [];
71
72 3
    public function getCompanyName(): ?CompanyName
73
    {
74 3
        return $this->companyName;
75
    }
76
77 1
    public function setCompanyName(CompanyName $companyName): self
78
    {
79 1
        $this->companyName = $companyName;
80
81 1
        return $this;
82
    }
83
84 8
    public function getSymbol(): ?string
85
    {
86 8
        return $this->symbol;
87
    }
88
89 5
    public function setSymbol(string $symbol): self
90
    {
91 5
        $this->symbol = $symbol;
92
93 5
        return $this;
94
    }
95
96 1
    public function getRegularMarketPrice(): ?RegularMarketPrice
97
    {
98 1
        return $this->regularMarketPrice;
99
    }
100
101
    public function setRegularMarketPrice(RegularMarketPrice $regularMarketPrice): self
102
    {
103
        $this->regularMarketPrice = $regularMarketPrice;
104
105
        return $this;
106
    }
107
108 1
    public function getCurrency(): ?Currency
109
    {
110 1
        return $this->currency;
111
    }
112
113
    public function setCurrency(Currency $currency): self
114
    {
115
        $this->currency = $currency;
116
117
        return $this;
118
    }
119
120 1
    public function getRegularMarketChangePercent(): ?RegularMarketChangePercent
121
    {
122 1
        return $this->regularMarketChangePercent;
123
    }
124
125
    public function setRegularMarketChangePercent(RegularMarketChangePercent $regularMarketChangePercent): self
126
    {
127
        $this->regularMarketChangePercent = $regularMarketChangePercent;
128
129
        return $this;
130
    }
131
132 1
    public function getRegularMarketChange(): ?RegularMarketChange
133
    {
134 1
        return $this->regularMarketChange;
135
    }
136
137
    public function setRegularMarketChange(RegularMarketChange $changePercent): self
138
    {
139
        $this->regularMarketChange = $changePercent;
140
141
        return $this;
142
    }
143
144 1
    public function getUrl(): ?string
145
    {
146 1
        return $this->url;
147
    }
148
149
    public function setUrl(string $url): self
150
    {
151
        $this->url = $url;
152
153
        return $this;
154
    }
155
156 1
    public function getLastTrend(): ?array
157
    {
158 1
        return $this->lastTrend;
159
    }
160
161
    public function setLastTrend(array $lastTrend): self
162
    {
163
        $this->lastTrend = $lastTrend;
164
165
        return $this;
166
    }
167
168 1
    public function getMarketCap(): ?MarketCap
169
    {
170 1
        return $this->marketCap;
171
    }
172
173
    public function setMarketCap(?MarketCap $marketCap): self
174
    {
175
        $this->marketCap = $marketCap;
176
177
        return $this;
178
    }
179
180 3
    public function getLatestNews(): array
181
    {
182 3
        return $this->latestNews;
183
    }
184
185 1
    public function setLatestNews(array $latestNews): self
186
    {
187 1
        $this->latestNews = $latestNews;
188
189 1
        return $this;
190
    }
191
192 16
    protected function metadata(): array
193
    {
194 16
        return self::METADATA;
195
    }
196
}
197