Passed
Branch release/1.5.0 (5f009d)
by vincent
05:05
created

PeopleTVShowCrew   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 160
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 1
dl 0
loc 160
ccs 31
cts 31
cp 1
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 2
A getId() 0 4 1
A getCreditId() 0 4 1
A getDepartment() 0 4 1
A getJob() 0 4 1
A getName() 0 4 1
A getOriginalName() 0 4 1
A getPosterPath() 0 4 1
A getFirstAirDate() 0 4 1
A getEpisodeCount() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Tmdb package.
5
 *
6
 * (c) Vincent Faliès <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @author Vincent Faliès <[email protected]>
12
 * @copyright Copyright (c) 2017
13
 */
14
15
namespace vfalies\tmdb\Results;
16
17
use vfalies\tmdb\Abstracts\Results;
18
use vfalies\tmdb\Interfaces\TmdbInterface;
19
20
/**
21
 * Class to manipulate a people tvshow crew result
22
 * @package Tmdb
23
 * @author Vincent Faliès <[email protected]>
24
 * @copyright Copyright (c) 2017
25
 */
26
class PeopleTVShowCrew extends Results
27
{
28
29
    /**
30
     * Credit Id
31
     * @var string
32
     */
33
    protected $credit_id = null;
34
35
    /**
36
     * name
37
     * @var string
38
     */
39
    protected $name = null;
40
41
    /**
42
     * Image poster path
43
     * @var string
44
     */
45
    protected $poster_path = null;
46
47
    /**
48
     * original name
49
     * @var string
50
     */
51
    protected $original_name = null;
52
53
    /**
54
     * First air date
55
     * @var string
56
     */
57
    protected $first_air_date = null;
58
59
    /**
60
     * Id
61
     * @var int
62
     */
63
    protected $id = null;
64
65
    /**
66
     * Department
67
     * @var string
68
     */
69
    protected $department = null;
70
71
    /**
72
     * Job
73
     * @var string
74
     */
75
    protected $job = null;
76
77
    /**
78
     * Episode count
79
     * @var int
80
     */
81
    protected $episode_count = null;
82
83
    /**
84
     * Constructor
85
     * @param \vfalies\tmdb\Interfaces\TmdbInterface $tmdb
86
     * @param \stdClass $result
87
     */
88 10
    public function __construct(TmdbInterface $tmdb, \stdClass $result)
89
    {
90 10
        if (!isset($result->episode_count)) { $result->episode_count = null; }
91 10
        parent::__construct($tmdb, $result);
92
93 10
        $this->id             = $this->data->id;
94 10
        $this->episode_count  = $this->data->episode_count;
95 10
        $this->department     = $this->data->department;
96 10
        $this->job            = $this->data->job;
97 10
        $this->credit_id      = $this->data->credit_id;
98 10
        $this->original_name  = $this->data->original_name;
99 10
        $this->name           = $this->data->name;
100 10
        $this->poster_path    = $this->data->poster_path;
101 10
        $this->first_air_date = $this->data->first_air_date;
102 10
    }
103
104
    /**
105
     * Get Id
106
     * @return int
107
     */
108 1
    public function getId()
109
    {
110 1
        return (int) $this->id;
111
    }
112
113
    /**
114
     * Get credit Id
115
     * @return string
116
     */
117 1
    public function getCreditId()
118
    {
119 1
        return $this->credit_id;
120
    }
121
122
    /**
123
     * Get department name
124
     * @return string
125
     */
126 1
    public function getDepartment()
127
    {
128 1
        return $this->department;
129
    }
130
131
    /**
132
     * Get job
133
     * @return string
134
     */
135 1
    public function getJob()
136
    {
137 1
        return $this->job;
138
    }
139
140
    /**
141
     * Get name
142
     * @return string
143
     */
144 1
    public function getName()
145
    {
146 1
        return $this->name;
147
    }
148
149
    /**
150
     * Get original ,name
151
     * @return string
152
     */
153 1
    public function getOriginalName()
154
    {
155 1
        return $this->original_name;
156
    }
157
158
    /**
159
     * Get poster path
160
     * @return string
161
     */
162 1
    public function getPosterPath()
163
    {
164 1
        return $this->poster_path;
165
    }
166
167
    /**
168
     * Get first air date
169
     * @return string
170
     */
171 1
    public function getFirstAirDate()
172
    {
173 1
        return $this->first_air_date;
174
    }
175
176
    /**
177
     * Episode count
178
     * @return int
179
     */
180 1
    public function getEpisodeCount()
181
    {
182 1
        return $this->episode_count;
183
    }
184
185
}
186