Conditions | 3 |
Paths | 1 |
Total Lines | 46 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function build(SchemaConfig $config) |
||
13 | { |
||
14 | $config->setQuery( |
||
15 | new ObjectType([ |
||
16 | 'name' => 'QueryType', |
||
17 | 'fields' => [ |
||
18 | 'echo' => [ |
||
19 | 'type' => new DateTimeType('Y-m-d H:ia'), |
||
20 | 'args' => [ |
||
21 | 'date' => new DateTimeType('Y-m-d H:ia') |
||
22 | ], |
||
23 | 'resolve' => function ($value, $args, $info) { |
||
|
|||
24 | |||
25 | if (isset($args['date'])) { |
||
26 | return $args['date']; |
||
27 | } |
||
28 | |||
29 | return null; |
||
30 | } |
||
31 | ] |
||
32 | ] |
||
33 | ]) |
||
34 | ); |
||
35 | |||
36 | $config->setMutation( |
||
37 | new ObjectType([ |
||
38 | 'name' => 'MutationType', |
||
39 | 'fields' => [ |
||
40 | 'echo' => [ |
||
41 | 'type' => new DateTimeType('Y-m-d H:ia'), |
||
42 | 'args' => [ |
||
43 | 'date' => new DateTimeType('Y-m-d H:ia') |
||
44 | ], |
||
45 | 'resolve' => function ($value, $args, $info) { |
||
46 | |||
47 | if (isset($args['date'])) { |
||
48 | return $args['date']; |
||
49 | } |
||
50 | |||
51 | return null; |
||
52 | } |
||
53 | ] |
||
54 | ] |
||
55 | ]) |
||
56 | ); |
||
57 | } |
||
58 | |||
59 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.