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

TVEpisodeTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCrew() 0 13 3
1
<?php
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 vfalies\tmdb\Traits;
16
17
use vfalies\tmdb\Results\Crew;
18
19
/**
20
 * TV Episode trait
21
 * @package Tmdb
22
 * @author Vincent Faliès <[email protected]>
23
 * @copyright Copyright (c) 2017
24
 */
25
trait TVEpisodeTrait
26
{
27
    /**
28
     * Get crew of TV Episode
29
     */
30 9
    public function getCrew()
31
    {
32 9
        if (!empty($this->data->crew))
33
        {
34 9
            foreach ($this->data->crew as $crew)
35
            {
36 9
                $crew->gender = null;
37
38 9
                $return = new Crew($this->tmdb, $crew);
39 9
                yield $return;
40
            }
41
        }
42 2
    }
43
44
}
45