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

Collection::getId()   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
3
namespace vfalies\tmdb\Results;
4
5
class Collection extends Results
6
{
7
8
    protected $name          = null;
9
10
    /**
11
     * Constructor
12
     * @param \vfalies\tmdb\Tmdb $tmdb
13
     * @param \stdClass $result
14
     * @throws \Exception
15
     */
16 12
    public function __construct(\vfalies\tmdb\Tmdb $tmdb, \stdClass $result)
17
    {
18 12
        parent::__construct($tmdb, $result);
19
20
        // Populate data
21 12
        $this->id            = $result->id;
22 12
        $this->name          = $result->name;
23 12
        $this->poster_path   = $result->poster_path;
24 12
        $this->backdrop_path = $result->backdrop_path;
25 12
    }
26
27
    /**
28
     * Get collection ID
29
     * @return int
30
     */
31 1
    public function getId(): int
32
    {
33 1
        return (int) $this->id;
34
    }
35
36
    /**
37
     * Get collection name
38
     * @return string
39
     */
40 1
    public function getTitle(): string
41
    {
42 1
        return $this->name;
43
    }
44
45 1
    public function getOriginalTitle(): string
46
    {
47 1
        throw new \Exception('Not applicable');
48
    }
49
50 1
    public function getOverview(): string
51
    {
52 1
        throw new \Exception('Not applicable');
53
    }
54
55 1
    public function getReleaseDate(): string
56
    {
57 1
        throw new \Exception('Not applicable');
58
    }
59
60
}
61