Passed
Push — master ( 67aa47...d37a32 )
by vincent
02:27
created

Item::getTVShow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace vfalies\tmdb;
4
5
use vfalies\tmdb\Items\Movie;
6
use vfalies\tmdb\Items\Collection;
7
use vfalies\tmdb\Items\TVShow;
8
9
class Item
10
{
11
    private $tmdb          = null;
12
13
    /**
14
     * Constructor
15
     * @param \vfalies\tmdb\Tmdb $tmdb
16
     */
17
18 3
    public function __construct(Tmdb $tmdb)
19
    {
20 3
        $this->tmdb = $tmdb;
21 3
    }
22
23
    /**
24
     * Get movie details
25
     * @param int $movie_id
26
     * @param array $options
27
     * @return \vfalies\tmdb\Items\Movie
28
     */
29 1
    public function getMovie(int $movie_id, array $options = array()): Movie
30
    {
31 1
        $movie = new Movie($this->tmdb, $movie_id, $options);
32
33 1
        return $movie;
34
    }
35
36
    /**
37
     * Get collection details
38
     * @param int $collection_id
39
     * @param array $options
40
     * @return \vfalies\tmdb\Items\Collection
41
     */
42 1
    public function getCollection(int $collection_id, array $options = array()): Collection
43
    {
44 1
        $collection = new Collection($this->tmdb, $collection_id, $options);
45
46 1
        return $collection;
47
    }
48
49
    /**
50
     * Get TV Show details
51
     * @param int $tv_id
52
     * @param array $options
53
     * @return \vfalies\tmdb\Items\TVShow
54
     */
55 1
    public function getTVShow(int $tv_id, array $options = array()): TVShow
56
    {
57 1
        $tv = new TVShow($this->tmdb, $tv_id, $options);
58
59 1
        return $tv;
60
    }
61
62
63
}
64