Passed
Push — master ( 9f17d2...e5ff49 )
by
unknown
03:30
created

Collection::getOverview()   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
use vfalies\tmdb\Abstracts\Results;
6
use vfalies\tmdb\Tmdb;
7
use vfalies\tmdb\Interfaces\Results\CollectionResultsInterface;
8
9
class Collection extends Results implements CollectionResultsInterface
10
{
11
12
    protected $name          = null;
13
    protected $poster_path   = null;
14
    protected $backdrop_path = null;
15
16
    /**
17
     * Constructor
18
     * @param \vfalies\tmdb\Tmdb $tmdb
19
     * @param \stdClass $result
20
     */
21 3
    public function __construct(Tmdb $tmdb, \stdClass $result)
22
    {
23 3
        parent::__construct($tmdb, $result);
24
25
        // Populate data
26 3
        $this->id            = $this->data->id;
27 3
        $this->name          = $this->data->name;
28 3
        $this->poster_path   = $this->data->poster_path;
29 3
        $this->backdrop_path = $this->data->backdrop_path;
30 3
    }
31
32
    /**
33
     * Get collection ID
34
     * @return int
35
     */
36 1
    public function getId(): int
37
    {
38 1
        return (int) $this->id;
39
    }
40
41
    /**
42
     * Get collection name
43
     * @return string
44
     */
45 1
    public function getTitle(): string
46
    {
47 1
        return $this->name;
48
    }
49
}
50