Test Failed
Branch release/1.5.0 (5e38ec)
by vincent
02:28
created

TVEpisode::getCrew()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 6

Duplication

Lines 11
Ratio 84.62 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 0
Metric Value
dl 11
loc 13
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 0
crap 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A TVEpisode::getEpisodeNumber() 0 4 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\TVEpisodeResultsInterface;
8
use vfalies\tmdb\Exceptions\NotYetImplementedException;
9
use vfalies\tmdb\Traits\ElementTrait;
10
use vfalies\tmdb\Traits\TVEpisodeTrait;
11
12
class TVEpisode extends Results implements TVEpisodeResultsInterface
0 ignored issues
show
Bug introduced by
There is one abstract method getCrew in this class; you could implement it, or declare this class as abstract.
Loading history...
13
{
14
15
    use ElementTrait;
16
    use TVEpisodeTrait;
17
18
    protected $episode_number  = 0;
19
    protected $name            = '';
20
    protected $air_date        = null;
21
    protected $season_number   = 0;
22
    protected $vote_average    = 0;
23
    protected $vote_count      = 0;
24
    protected $overview        = '';
25
    protected $production_code = '';
26
    protected $still_path      = '';
27
    protected $id              = null;
28
29
    /**
30
     * Constructor
31
     * @param \vfalies\tmdb\Tmdb $tmdb
32
     * @param \stdClass $result
33
     * @throws \Exception
34 19
     */
35
    public function __construct(Tmdb $tmdb, \stdClass $result)
36 19
    {
37
        parent::__construct($tmdb, $result);
38
39 19
        // Populate data
40 19
        $this->id              = $this->data->id;
41 19
        $this->air_date        = $this->data->air_date;
42 19
        $this->season_number   = $this->data->season_number;
43 19
        $this->episode_number  = $this->data->episode_number;
44 19
        $this->name            = $this->data->name;
45 19
        $this->vote_average    = $this->data->vote_average;
46 19
        $this->vote_count      = $this->data->vote_count;
47 19
        $this->overview        = $this->data->overview;
48 19
        $this->production_code = $this->data->production_code;
49 19
        $this->still_path      = $this->data->still_path;
50
    }
51 1
52
    public function getAirDate()
53 1
    {
54
        return $this->air_date;
55
    }
56 8
57
    public function getEpisodeNumber()
58 8
    {
59
        return (int) $this->episode_number;
60 8
    }
61
62 8
    /**
63
     * @codeCoverageIgnore
64 8
     * @throws NotYetImplementedException
65 8
     */
66
    public function getGuestStars()
67
    {
68 1
        throw new NotYetImplementedException;
69
    }
70 1
71
    public function getId()
72 1
    {
73
        return (int) $this->id;
74
    }
75
76
    public function getName()
77
    {
78
        return $this->name;
79
    }
80
81
    public function getNote()
82
    {
83
        return $this->vote_average;
84 1
    }
85
86 1
    public function getNoteCount()
87
    {
88
        return (int) $this->vote_count;
89 1
    }
90
91 1
    public function getOverview()
92
    {
93
        return $this->overview;
94 1
    }
95
96 1
    public function getProductionCode()
97
    {
98
        return $this->production_code;
99 1
    }
100
101 1
    public function getSeasonNumber()
102
    {
103
        return (int) $this->season_number;
104 1
    }
105
106 1
    public function getStillPath()
107
    {
108
        return $this->still_path;
109 1
    }
110
111
}
112