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

Catalog   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 36
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMovieGenres() 0 5 1
A getTVShowGenres() 0 5 1
1
<?php
2
3
namespace vfalies\tmdb;
4
5
use vfalies\tmdb\Catalogs\Genres;
6
7
class Catalog
8
{
9
10
    private $tmdb = null;
11
12
    /**
13
     * Constructor
14
     * @param \vfalies\tmdb\Tmdb $tmdb
15
     */
16 5
    public function __construct(Tmdb $tmdb)
17
    {
18 5
        $this->tmdb = $tmdb;
19 5
    }
20
21
    /**
22
     * Get movie genres list
23
     * @param array $options
24
     * @return \Generator
25
     */
26 3
    public function getMovieGenres(array $options = array()): \Generator
27
    {
28 3
        $catalog = new Genres($this->tmdb);
29 3
        return $catalog->getMovieList($options);
30
    }
31
32
    /**
33
     * Get TVShow genres list
34
     * @param array $options
35
     * @return \Generator
36
     */
37 2
    public function getTVShowGenres(array $options = array()): \Generator
38
    {
39 2
        $catalog = new Genres($this->tmdb);
40 2
        return $catalog->getTVList($options);
41
    }
42
}
43