Passed
Push — master ( 89f3f2...2d8591 )
by vincent
39s
created

Item   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 87
c 0
b 0
f 0
wmc 6
lcom 1
cbo 7
ccs 24
cts 24
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMovie() 0 7 1
A getCollection() 0 7 1
A getTVShow() 0 7 1
A getPeople() 0 7 1
A getCompany() 0 7 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
use vfalies\tmdb\Items\Company;
10
11
class Item
12
{
13
14
    private $tmdb   = null;
15
    private $logger = null;
16
17
    /**
18
     * Constructor
19
     * @param \vfalies\tmdb\Tmdb $tmdb
20
     */
21
22 5
    public function __construct(Tmdb $tmdb)
23
    {
24 5
        $this->tmdb   = $tmdb;
25 5
        $this->logger = $tmdb->logger;
26 5
    }
27
28
    /**
29
     * Get movie details
30
     * @param int $movie_id
31
     * @param array $options
32
     * @return \vfalies\tmdb\Items\Movie
33
     */
34 1
    public function getMovie($movie_id, array $options = array())
35
    {
36 1
        $this->logger->debug('Starting getting movie');
37 1
        $movie = new Movie($this->tmdb, $movie_id, $options);
38
39 1
        return $movie;
40
    }
41
42
    /**
43
     * Get collection details
44
     * @param int $collection_id
45
     * @param array $options
46
     * @return \vfalies\tmdb\Items\Collection
47
     */
48 1
    public function getCollection($collection_id, array $options = array())
49
    {
50 1
        $this->logger->debug('Starting getting collection');
51 1
        $collection = new Collection($this->tmdb, $collection_id, $options);
52
53 1
        return $collection;
54
    }
55
56
    /**
57
     * Get TV Show details
58
     * @param int $tv_id
59
     * @param array $options
60
     * @return \vfalies\tmdb\Items\TVShow
61
     */
62 1
    public function getTVShow($tv_id, array $options = array())
63
    {
64 1
        $this->logger->debug('Starting getting tvshow');
65 1
        $tv = new TVShow($this->tmdb, $tv_id, $options);
66
67 1
        return $tv;
68
    }
69
70
    /**
71
     * Get People details
72
     * @param int $people_id
73
     * @param array $options
74
     * @return \vfalies\tmdb\Items\People
75
     */
76 1
    public function getPeople($people_id, array $options = array())
77
    {
78 1
        $this->logger->debug('Starting getting people');
79 1
        $people = new People($this->tmdb, $people_id, $options);
80
81 1
        return $people;
82
    }
83
84
    /**
85
     * Get Company details
86
     * @param int $company_id
87
     * @param array $options
88
     * @return \vfalies\tmdb\Items\Company
89
     */
90 1
    public function getCompany($company_id, array $options = array())
91
    {
92 1
        $this->logger->debug('Starting getting company');
93 1
        $company = new Company($this->tmdb, $company_id, $options);
94
95 1
        return $company;
96
    }
97
}
98