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

Collection   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 56
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getId() 0 4 1
A getTitle() 0 4 1
A getOriginalTitle() 0 4 1
A getOverview() 0 4 1
A getReleaseDate() 0 4 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