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

TVEpisodeTrait::getCrew()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 9.4285
cc 3
eloc 6
nc 3
nop 0
crap 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