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

PeopleTVShowCredit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 14
loc 14
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\Items;
16
17
use VfacTmdb\Abstracts\Items\PeopleItemCredit;
18
use VfacTmdb\Exceptions\TmdbException;
19
use VfacTmdb\Interfaces\TmdbInterface;
20
use VfacTmdb\Results\PeopleTVShowCast;
21
use VfacTmdb\Results\PeopleTVShowCrew;
22
23
/**
24
 * People TVShow Credit class
25
 * @package Tmdb
26
 * @author Vincent Faliès <[email protected]>
27
 * @copyright Copyright (c) 2017
28
 */
29 View Code Duplication
 class PeopleTVShowCredit extends PeopleItemCredit
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
 {
31 20
     public function __construct(TmdbInterface $tmdb, int $people_id, array $options = array())
32
     {
33
         try {
34 20
             $this->crew_class = PeopleTVShowCrew::class;
35 20
             $this->cast_class = PeopleTVShowCast::class;
36
37 20
             parent::__construct($tmdb, 'tv', $people_id, $options);
38 1
         } catch (TmdbException $ex) {
39 1
             throw $ex;
40
         }
41 19
     }
42
 }
43