Completed
Push — master ( 5163a0...712d21 )
by Valentyn
06:59
created

MovieDTO::getOriginalPosterUrl()   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, $originalPosterUrl, $imdbId, $budget, $runtime, $releaseDate;
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
9
10
    /**
11
     * MovieDTO constructor.
12
     * @param null|string $originalTitle
13
     * @param null|string $originalPosterUrl
14
     * @param null|string $imdbId
15
     * @param int|null $budget
16
     * @param int|null $runtime
17
     * @param null|string $releaseDate
18
     * @throws \Exception
19
     */
20 2
    public function __construct(?string $originalTitle, ?string $originalPosterUrl, ?string $imdbId, ?int $budget, ?int $runtime, ?string $releaseDate)
21
    {
22 2
        $this->originalTitle = $originalTitle;
23 2
        $this->originalPosterUrl = $originalPosterUrl;
24 2
        $this->imdbId = $imdbId;
25 2
        $this->budget = $budget;
26 2
        $this->runtime = $runtime;
27 2
        $this->releaseDate = new \DateTimeImmutable($releaseDate);
28 2
    }
29
30
    /**
31
     * @return null|string
32
     */
33 2
    public function getOriginalTitle(): ?string
34
    {
35 2
        return $this->originalTitle;
36
    }
37
38
    /**
39
     * @return null|string
40
     */
41 2
    public function getOriginalPosterUrl(): ?string
42
    {
43 2
        return $this->originalPosterUrl;
44
    }
45
46
    /**
47
     * @return null|string
48
     */
49
    public function getImdbId(): ?string
50
    {
51
        return $this->imdbId;
52
    }
53
54
    /**
55
     * @return int
56
     */
57
    public function getBudget(): int
58
    {
59
        return (int)$this->budget;
60
    }
61
62
    /**
63
     * @return int
64
     */
65
    public function getRuntime(): int
66
    {
67
        return (int)$this->runtime;
68
    }
69
70
    /**
71
     * @return \DateTimeImmutable
72
     */
73
    public function getReleaseDate(): \DateTimeImmutable
74
    {
75
        return $this->releaseDate;
76
    }
77
}