| Conditions | 4 |
| Paths | 1 |
| Total Lines | 37 |
| Code Lines | 24 |
| Lines | 10 |
| Ratio | 27.03 % |
| Changes | 5 | ||
| Bugs | 3 | Features | 0 |
| 1 | <?php |
||
| 31 | public function build($config) |
||
| 32 | { |
||
| 33 | $config |
||
| 34 | ->addField('hero', [ |
||
| 35 | 'type' => new CharacterInterface(), |
||
| 36 | 'args' => [ |
||
| 37 | 'episode' => ['type' => new EpisodeEnum()] |
||
| 38 | ], |
||
| 39 | 'resolve' => function ($root, $args) { |
||
| 40 | return StarWarsData::getHero(isset($args['episode']) ? $args['episode'] : null); |
||
| 41 | }, |
||
| 42 | ]) |
||
| 43 | ->addField(new Field([ |
||
| 44 | 'name' => 'human', |
||
| 45 | 'type' => new HumanType(), |
||
| 46 | 'args' => [ |
||
| 47 | 'id' => new IdType() |
||
| 48 | ], |
||
| 49 | View Code Duplication | 'resolve' => function ($value = null, $args = []) { |
|
| 50 | $humans = StarWarsData::humans(); |
||
| 51 | |||
| 52 | return isset($humans[$args['id']]) ? $humans[$args['id']] : null; |
||
| 53 | } |
||
| 54 | ])) |
||
| 55 | ->addField(new Field([ |
||
| 56 | 'name' => 'droid', |
||
| 57 | 'type' => new DroidType(), |
||
| 58 | 'args' => [ |
||
| 59 | 'id' => new IdType() |
||
| 60 | ], |
||
| 61 | View Code Duplication | 'resolve' => function ($value = null, $args = []) { |
|
| 62 | $droids = StarWarsData::droids(); |
||
| 63 | |||
| 64 | return isset($droids[$args['id']]) ? $droids[$args['id']] : null; |
||
| 65 | } |
||
| 66 | ])); |
||
| 67 | } |
||
| 68 | } |
||
| 69 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.