Completed
Push — master ( 1a9043...984777 )
by Valentyn
08:31
created

MovieDTO::getImdbId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace App\Movies\DTO;
5
6
class MovieDTO
7
{
8
    private $originalTitle;
9
    private $originalPosterUrl;
10
    private $imdbId;
11
    private $budget;
12
    private $runtime;
13
    private $releaseDate;
14
15
    /**
16
     * MovieDTO constructor.
17
     * @param null|string $originalTitle
18
     * @param null|string $originalPosterUrl
19
     * @param null|string $imdbId
20
     * @param int|null $budget
21
     * @param int|null $runtime
22
     * @param null|string $releaseDate
23
     * @throws \Exception
24
     */
25 3
    public function __construct(?string $originalTitle, ?string $originalPosterUrl, ?string $imdbId, ?int $budget, ?int $runtime, ?string $releaseDate)
26
    {
27 3
        $this->originalTitle = $originalTitle;
28 3
        $this->originalPosterUrl = $originalPosterUrl;
29 3
        $this->imdbId = $imdbId;
30 3
        $this->budget = $budget;
31 3
        $this->runtime = $runtime;
32 3
        $this->releaseDate = new \DateTimeImmutable($releaseDate);
33 3
    }
34
35
    /**
36
     * @return null|string
37
     */
38 3
    public function getOriginalTitle(): ?string
39
    {
40 3
        return $this->originalTitle;
41
    }
42
43
    /**
44
     * @return null|string
45
     */
46 3
    public function getOriginalPosterUrl(): ?string
47
    {
48 3
        return $this->originalPosterUrl;
49
    }
50
51
    /**
52
     * @return null|string
53
     */
54 3
    public function getImdbId(): ?string
55
    {
56 3
        return $this->imdbId;
57
    }
58
59
    /**
60
     * @return int
61
     */
62 3
    public function getBudget(): int
63
    {
64 3
        return (int)$this->budget;
65
    }
66
67
    /**
68
     * @return int
69
     */
70 3
    public function getRuntime(): int
71
    {
72 3
        return (int)$this->runtime;
73
    }
74
75
    /**
76
     * @return \DateTimeImmutable
77
     */
78 3
    public function getReleaseDate(): \DateTimeImmutable
79
    {
80 3
        return $this->releaseDate;
81
    }
82
}