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

News::setDatetime()   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 News 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 DATETIME = 'datetime';
10
    public const TIMEZONE = 'timezone';
11
    public const URL = 'url';
12
    public const TITLE = 'title';
13
    public const SUMMARY = 'summary';
14
    public const SOURCE = 'source';
15
    public const PUBLISHER = 'publisher';
16
    public const IMAGES = 'images';
17
18
    private const METADATA = [
19
        self::DATETIME => [
20
            'type' => self::TYPE_STRING,
21
        ],
22
        self::TIMEZONE => [
23
            'type' => self::TYPE_STRING,
24
        ],
25
        self::URL => [
26
            'type' => self::TYPE_STRING,
27
        ],
28
        self::TITLE => [
29
            'type' => self::TYPE_STRING,
30
        ],
31
        self::SUMMARY => [
32
            'type' => self::TYPE_STRING,
33
        ],
34
        self::PUBLISHER => [
35
            'type' => self::TYPE_STRING,
36
        ],
37
        self::IMAGES => [
38
            'type' => self::TYPE_ARRAY,
39
        ],
40
    ];
41
42
    protected ?string $datetime = null;
43
    protected ?string $timezone = null;
44
    protected ?string $url = null;
45
    protected ?string $title = null;
46
    protected ?string $summary = null;
47
    protected ?string $source = null;
48
    protected ?string $publisher = null;
49
    protected ?array $images = null;
50
51 2
    public function getDatetime(): ?string
52
    {
53 2
        return $this->datetime;
54
    }
55
56 2
    public function setDatetime(?string $datetime): self
57
    {
58 2
        $this->datetime = $datetime;
59
60 2
        return $this;
61
    }
62
63
    public function getTimezone(): ?string
64
    {
65
        return $this->timezone;
66
    }
67
68 1
    public function setTimezone(?string $timezone): self
69
    {
70 1
        $this->timezone = $timezone;
71
72 1
        return $this;
73
    }
74
75
    public function getUrl(): ?string
76
    {
77
        return $this->url;
78
    }
79
80 1
    public function setUrl(?string $url): self
81
    {
82 1
        $this->url = $url;
83
84 1
        return $this;
85
    }
86
87
    public function getTitle(): ?string
88
    {
89
        return $this->title;
90
    }
91
92 2
    public function setTitle(?string $title): self
93
    {
94 2
        $this->title = $title;
95
96 2
        return $this;
97
    }
98
99
    public function getSummary(): ?string
100
    {
101
        return $this->summary;
102
    }
103
104 1
    public function setSummary(?string $summary): self
105
    {
106 1
        $this->summary = $summary;
107
108 1
        return $this;
109
    }
110
111
    public function getSource(): ?string
112
    {
113
        return $this->source;
114
    }
115
116
    public function setSource(?string $source): self
117
    {
118
        $this->source = $source;
119
120
        return $this;
121
    }
122
123
    public function getPublisher(): ?string
124
    {
125
        return $this->publisher;
126
    }
127
128
    public function setPublisher(?string $publisher): self
129
    {
130
        $this->publisher = $publisher;
131
132
        return $this;
133
    }
134
135
    public function getImages(): ?array
136
    {
137
        return $this->images;
138
    }
139
140
    public function setImages(?array $images): self
141
    {
142
        $this->images = $images;
143
144
        return $this;
145
    }
146
147 12
    protected function metadata(): array
148
    {
149 12
        return self::METADATA;
150
    }
151
}
152