Completed
Pull Request — master (#30)
by vincent
03:53
created

Crew   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 119
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 119
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getId() 0 4 1
A getCreditId() 0 4 1
A getDepartment() 0 4 1
A getGender() 0 4 1
A getJob() 0 4 1
A getName() 0 4 1
A getProfilePath() 0 4 1
1
<?php declare(strict_types = 1);
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017
12
 */
13
14
15
namespace VfacTmdb\Results;
16
17
use VfacTmdb\Abstracts\Results;
18
use VfacTmdb\Interfaces\Results\CrewResultsInterface;
19
use VfacTmdb\Interfaces\TmdbInterface;
20
21
/**
22
 * Class to manipulate a crew result
23
 * @package Tmdb
24
 * @author Vincent Faliès <[email protected]>
25
 * @copyright Copyright (c) 2017
26
 */
27
class Crew extends Results implements CrewResultsInterface
28
{
29
    /**
30
     * Department
31
     * @var string
32
     */
33
    protected $department = null;
34
    /**
35
     * Gender
36
     * @var string
37
     */
38
    protected $gender = null;
39
    /**
40
     * Credit id
41
     * @var string
42
     */
43
    protected $credit_id = null;
44
    /**
45
     * Job
46
     * @var string
47
     */
48
    protected $job = null;
49
    /**
50
     * Name
51
     * @var string
52
     */
53
    protected $name = null;
54
    /**
55
     * Image profile path
56
     * @var string
57
     */
58
    protected $profile_path = null;
59
    /**
60
     * Id
61
     * @var int
62
     */
63
    protected $id = null;
64
65
    /**
66
     * Constructor
67
     * @param TmdbInterface $tmdb
68
     * @param \stdClass $result
69
     */
70 10
    public function __construct(TmdbInterface $tmdb, \stdClass $result)
71
    {
72 10
        parent::__construct($tmdb, $result);
73
74 10
        $this->id           = $this->data->id;
75 10
        $this->department   = $this->data->department;
76 10
        $this->gender       = $this->data->gender;
77 10
        $this->credit_id    = $this->data->credit_id;
78 10
        $this->job          = $this->data->job;
79 10
        $this->name         = $this->data->name;
80 10
        $this->profile_path = $this->data->profile_path;
81 10
    }
82
83
    /**
84
     * Id
85
     * @return int
86
     */
87 1
    public function getId() : int
88
    {
89 1
        return (int) $this->id;
90
    }
91
92
    /**
93
     * Credit Id
94
     * @return string
95
     */
96 1
    public function getCreditId() : string
97
    {
98 1
        return $this->credit_id;
99
    }
100
101
    /**
102
     * Department
103
     * @return string
104
     */
105 1
    public function getDepartment() : string
106
    {
107 1
        return $this->department;
108
    }
109
110
    /**
111
     * Gender
112
     * @return string|null
113
     */
114 1
    public function getGender() : ?string
115
    {
116 1
        return $this->gender;
117
    }
118
119
    /**
120
     * Job
121
     * @return string
122
     */
123 1
    public function getJob() : string
124
    {
125 1
        return $this->job;
126
    }
127
128
    /**
129
     * Name
130
     * @return string
131
     */
132 1
    public function getName() : string
133
    {
134 1
        return $this->name;
135
    }
136
137
    /**
138
     * Image profile path
139
     * @return string
140
     */
141 1
    public function getProfilePath() : string
142
    {
143 1
        return $this->profile_path;
144
    }
145
}
146