Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Lines | 13 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
19 | View Code Duplication | public function build($config) |
|
|
|||
20 | { |
||
21 | $config |
||
22 | ->addField('id', new NonNullType(new IdType())) |
||
23 | ->addField('name', new NonNullType(new StringType())) |
||
24 | ->addField('friends', [ |
||
25 | 'type' => new ListType(new CharacterInterface()), |
||
26 | 'resolve' => function ($value) { |
||
27 | return $value['friends']; |
||
28 | } |
||
29 | ]) |
||
30 | ->addField('appearsIn', new ListType(new EpisodeEnum())); |
||
31 | } |
||
32 | |||
62 |
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.