Passed
Branch master (609f2f)
by Dorian
08:59
created

Release   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getEditor() 0 3 1
A getTitle() 0 3 1
A getLanguage() 0 3 1
A getOwner() 0 3 1
A getPublicationDate() 0 3 1
A isPublished() 0 3 1
A getFormat() 0 3 1
A getSeries() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gnutix\Library\Model;
6
7
use DateTime;
8
use Gnutix\Library\Helper\ArrayPopulatedObject;
9
10
final class Release extends ArrayPopulatedObject
11
{
12
    protected string $title;
13
    protected Language $language;
14
    protected Editor $editor;
15
    protected Format $format;
16
    protected ?DateTime $publicationDate;
17
    protected Series $series;
18
    protected Owner $owner;
19
20
    public function getTitle(): string
21
    {
22
        return $this->title;
23
    }
24
25
    public function getLanguage(): Language
26
    {
27
        return $this->language;
28
    }
29
30
    public function getEditor(): Editor
31
    {
32
        return $this->editor;
33
    }
34
35
    public function getFormat(): Format
36
    {
37
        return $this->format;
38
    }
39
40
    public function getPublicationDate(): ?DateTime
41
    {
42
        return $this->publicationDate;
43
    }
44
45
    public function isPublished(): bool
46
    {
47
        return $this->publicationDate < new DateTime();
48
    }
49
50
    public function getSeries(): Series
51
    {
52
        return $this->series;
53
    }
54
55
    public function getOwner(): Owner
56
    {
57
        return $this->owner;
58
    }
59
}
60