Passed
Push — master ( 5bd4e8...a1df2d )
by vincent
40s
created

Item::getPeople()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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
use vfalies\tmdb\Items\People;
9
10
class Item
11
{
12
13
    private $tmdb   = null;
14
    private $logger = null;
15
16
    /**
17
     * Constructor
18
     * @param \vfalies\tmdb\Tmdb $tmdb
19
     */
20
21 4
    public function __construct(Tmdb $tmdb)
22
    {
23 4
        $this->tmdb   = $tmdb;
24 4
        $this->logger = $tmdb->logger;
25 4
    }
26
27
    /**
28
     * Get movie details
29
     * @param int $movie_id
30
     * @param array $options
31
     * @return \vfalies\tmdb\Items\Movie
32
     */
33 1
    public function getMovie($movie_id, array $options = array())
34
    {
35 1
        $this->logger->debug('Starting getting movie');
36 1
        $movie = new Movie($this->tmdb, $movie_id, $options);
37
38 1
        return $movie;
39
    }
40
41
    /**
42
     * Get collection details
43
     * @param int $collection_id
44
     * @param array $options
45
     * @return \vfalies\tmdb\Items\Collection
46
     */
47 1
    public function getCollection($collection_id, array $options = array())
48
    {
49 1
        $this->logger->debug('Starting getting collection');
50 1
        $collection = new Collection($this->tmdb, $collection_id, $options);
51
52 1
        return $collection;
53
    }
54
55
    /**
56
     * Get TV Show details
57
     * @param int $tv_id
58
     * @param array $options
59
     * @return \vfalies\tmdb\Items\TVShow
60
     */
61 1
    public function getTVShow($tv_id, array $options = array())
62
    {
63 1
        $this->logger->debug('Starting getting tvshow');
64 1
        $tv = new TVShow($this->tmdb, $tv_id, $options);
65
66 1
        return $tv;
67
    }
68
69
    /**
70
     * Get People details
71
     * @param int $people_id
72
     * @param array $options
73
     * @return \vfalies\tmdb\Items\People
74
     */
75 1
    public function getPeople($people_id, array $options = array())
76
    {
77 1
        $this->logger->debug('Starting getting people');
78 1
        $people = new People($this->tmdb, $people_id, $options);
79
80 1
        return $people;
81
    }
82
83
}
84