Passed
Branch master (465d67)
by vincent
02:35
created

PeopleTVShowCrew   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 162
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 162
ccs 32
cts 32
cp 1
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 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))
91
        {
92 1
$result->episode_count = null; }
93 10
        parent::__construct($tmdb, $result);
94
95 10
        $this->id             = $this->data->id;
96 10
        $this->episode_count  = $this->data->episode_count;
97 10
        $this->department     = $this->data->department;
98 10
        $this->job            = $this->data->job;
99 10
        $this->credit_id      = $this->data->credit_id;
100 10
        $this->original_name  = $this->data->original_name;
101 10
        $this->name           = $this->data->name;
102 10
        $this->poster_path    = $this->data->poster_path;
103 10
        $this->first_air_date = $this->data->first_air_date;
104 10
    }
105
106
    /**
107
     * Get Id
108
     * @return int
109
     */
110 1
    public function getId()
111
    {
112 1
        return (int) $this->id;
113
    }
114
115
    /**
116
     * Get credit Id
117
     * @return string
118
     */
119 1
    public function getCreditId()
120
    {
121 1
        return $this->credit_id;
122
    }
123
124
    /**
125
     * Get department name
126
     * @return string
127
     */
128 1
    public function getDepartment()
129
    {
130 1
        return $this->department;
131
    }
132
133
    /**
134
     * Get job
135
     * @return string
136
     */
137 1
    public function getJob()
138
    {
139 1
        return $this->job;
140
    }
141
142
    /**
143
     * Get name
144
     * @return string
145
     */
146 1
    public function getName()
147
    {
148 1
        return $this->name;
149
    }
150
151
    /**
152
     * Get original ,name
153
     * @return string
154
     */
155 1
    public function getOriginalName()
156
    {
157 1
        return $this->original_name;
158
    }
159
160
    /**
161
     * Get poster path
162
     * @return string
163
     */
164 1
    public function getPosterPath()
165
    {
166 1
        return $this->poster_path;
167
    }
168
169
    /**
170
     * Get first air date
171
     * @return string
172
     */
173 1
    public function getFirstAirDate()
174
    {
175 1
        return $this->first_air_date;
176
    }
177
178
    /**
179
     * Episode count
180
     * @return int
181
     */
182 1
    public function getEpisodeCount()
183
    {
184 1
        return $this->episode_count;
185
    }
186
187
}
188