Completed
Pull Request — master (#2)
by
unknown
08:22
created

TVShow::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
dl 13
loc 13
ccs 10
cts 10
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 2
crap 1
1
<?php
2
3
namespace vfalies\tmdb\Results;
4
5 View Code Duplication
class TVShow extends Results
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
8
    protected $overview       = null;
9
    protected $first_air_date = null;
10
    protected $original_name  = null;
11
    protected $name           = null;
12
13
    /**
14
     * Constructor
15
     * @param \vfalies\tmdb\Tmdb $tmdb
16
     * @param \stdClass $result
17
     * @throws \Exception
18
     */
19 12
    public function __construct(\vfalies\tmdb\Tmdb $tmdb, \stdClass $result)
20
    {
21 12
        parent::__construct($tmdb, $result);
22
23
        // Populate data
24 12
        $this->id             = $result->id;
25 12
        $this->overview       = $result->overview;
26 12
        $this->first_air_date = $result->first_air_date;
27 12
        $this->original_name  = $result->original_name;
28 12
        $this->name           = $result->name;
29 12
        $this->poster_path    = $result->poster_path;
30 12
        $this->backdrop_path  = $result->backdrop_path;
31 12
    }
32
33
    /**
34
     * Get tvshow ID
35
     * @return int
36
     */
37 1
    public function getId(): int
38
    {
39 1
        return (int) $this->id;
40
    }
41
42
    /**
43
     * Get tvshow overview
44
     * @return string
45
     */
46 1
    public function getOverview(): string
47
    {
48 1
        return $this->overview;
49
    }
50
51
    /**
52
     * Get tvshow first air date
53
     * @return string
54
     */
55 1
    public function getReleaseDate(): string
56
    {
57 1
        return $this->first_air_date;
58
    }
59
60
    /**
61
     * Get tvshow original name
62
     * @return string
63
     */
64 1
    public function getOriginalTitle(): string
65
    {
66 1
        return $this->original_name;
67
    }
68
69
    /**
70
     * Get tvshow name
71
     * @return string
72
     */
73 1
    public function getTitle(): string
74
    {
75 1
        return $this->name;
76
    }
77
78
}
79