@@ -84,7 +84,7 @@ |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * @return Field[]|Query[] |
|
87 | + * @return Query[] |
|
88 | 88 | */ |
89 | 89 | public function getFields() |
90 | 90 | { |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /** |
14 | 14 | * Date: 23.11.15. |
15 | 15 | */ |
@@ -28,7 +28,7 @@ |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * @return Field[]|Query[] |
|
31 | + * @return Field[] |
|
32 | 32 | */ |
33 | 33 | public function getFields() |
34 | 34 | { |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /** |
14 | 14 | * Date: 23.11.15. |
15 | 15 | */ |
@@ -25,8 +25,8 @@ |
||
25 | 25 | 'args' => [ |
26 | 26 | 'truncated' => new BooleanType() |
27 | 27 | ], |
28 | - 'resolve' => function ($value, $args) { |
|
29 | - return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value; |
|
28 | + 'resolve' => function($value, $args) { |
|
29 | + return (!empty($args['truncated'])) ? explode(' ', $value)[0].'...' : $value; |
|
30 | 30 | } |
31 | 31 | ]) |
32 | 32 | ->addField('title', new NonNullType(new StringType())) |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | public static function getPost($id) |
11 | 11 | { |
12 | 12 | return [ |
13 | - "id" => "post-" . $id, |
|
14 | - "title" => "Post " . $id . " title", |
|
13 | + "id" => "post-".$id, |
|
14 | + "title" => "Post ".$id." title", |
|
15 | 15 | "summary" => "This new GraphQL library for PHP works really well", |
16 | 16 | "status" => 1, |
17 | 17 | "likeCount" => 2 |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | public static function getBanner($id) |
22 | 22 | { |
23 | 23 | return [ |
24 | - 'id' => "banner-" . $id, |
|
25 | - 'title' => "Banner " . $id, |
|
26 | - 'imageLink' => "banner" . $id . ".jpg" |
|
24 | + 'id' => "banner-".$id, |
|
25 | + 'title' => "Banner ".$id, |
|
26 | + 'imageLink' => "banner".$id.".jpg" |
|
27 | 27 | ]; |
28 | 28 | } |
29 | 29 | } |
@@ -42,8 +42,8 @@ |
||
42 | 42 | public function getDescription() |
43 | 43 | { |
44 | 44 | return 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
45 | - 'character sequences. The String type is most often used by GraphQL to ' . |
|
46 | - 'represent free-form human-readable text.'; |
|
45 | + 'character sequences. The String type is most often used by GraphQL to ' . |
|
46 | + 'represent free-form human-readable text.'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /* |
14 | 14 | * This file is a part of graphql-youshido project. |
15 | 15 | * |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return ''; |
45 | 45 | } |
46 | 46 | |
47 | - return (string) $value; |
|
47 | + return (string)$value; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function isValidValue($value) |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | public function getDescription() |
56 | 56 | { |
57 | - return 'The `String` scalar type represents textual data, represented as UTF-8 ' . |
|
58 | - 'character sequences. The String type is most often used by GraphQL to ' . |
|
57 | + return 'The `String` scalar type represents textual data, represented as UTF-8 '. |
|
58 | + 'character sequences. The String type is most often used by GraphQL to '. |
|
59 | 59 | 'represent free-form human-readable text.'; |
60 | 60 | } |
61 | 61 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | public function getDescription() |
30 | 30 | { |
31 | 31 | return 'The `Float` scalar type represents signed double-precision fractional ' . |
32 | - 'values as specified by ' . |
|
33 | - '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
|
32 | + 'values as specified by ' . |
|
33 | + '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /* |
14 | 14 | * This file is a part of graphql-youshido project. |
15 | 15 | * |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - return (float) $value; |
|
35 | + return (float)$value; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function isValidValue($value) |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | public function getDescription() |
44 | 44 | { |
45 | - return 'The `Float` scalar type represents signed double-precision fractional ' . |
|
46 | - 'values as specified by ' . |
|
45 | + return 'The `Float` scalar type represents signed double-precision fractional '. |
|
46 | + 'values as specified by '. |
|
47 | 47 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
48 | 48 | } |
49 | 49 | } |
@@ -40,9 +40,9 @@ |
||
40 | 40 | public function getDescription() |
41 | 41 | { |
42 | 42 | return 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
43 | - 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since ' . |
|
44 | - 'represented in JSON as double-precision floating point numbers specified' . |
|
45 | - 'by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
|
43 | + 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since ' . |
|
44 | + 'represented in JSON as double-precision floating point numbers specified' . |
|
45 | + 'by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /* |
14 | 14 | * This file is a part of graphql-youshido project. |
15 | 15 | * |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | if (\is_int($value)) { |
36 | 36 | return $value; |
37 | 37 | } |
38 | - $value = (int) $value; |
|
38 | + $value = (int)$value; |
|
39 | 39 | |
40 | 40 | return 0 !== $value ? $value : null; |
41 | 41 | } |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | public function getDescription() |
49 | 49 | { |
50 | - return 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
|
51 | - 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since ' . |
|
52 | - 'represented in JSON as double-precision floating point numbers specified' . |
|
50 | + return 'The `Int` scalar type represents non-fractional signed whole numeric '. |
|
51 | + 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since '. |
|
52 | + 'represented in JSON as double-precision floating point numbers specified'. |
|
53 | 53 | 'by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
54 | 54 | } |
55 | 55 | } |
@@ -30,9 +30,9 @@ |
||
30 | 30 | public function getDescription() |
31 | 31 | { |
32 | 32 | return 'The `ID` scalar type represents a unique identifier, often used to ' . |
33 | - 'refetch an object or as key for a cache. The ID type appears in a JSON ' . |
|
34 | - 'response as a String; however, it is not intended to be human-readable. ' . |
|
35 | - 'When expected as an input type, any string (such as `"4"`) or integer ' . |
|
36 | - '(such as `4`) input value will be accepted as an ID.'; |
|
33 | + 'refetch an object or as key for a cache. The ID type appears in a JSON ' . |
|
34 | + 'response as a String; however, it is not intended to be human-readable. ' . |
|
35 | + 'When expected as an input type, any string (such as `"4"`) or integer ' . |
|
36 | + '(such as `4`) input value will be accepted as an ID.'; |
|
37 | 37 | } |
38 | 38 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * http://opensource.org/licenses/MIT |
10 | 10 | */ |
11 | 11 | |
12 | -declare(strict_types=1); |
|
12 | +declare(strict_types = 1); |
|
13 | 13 | /* |
14 | 14 | * This file is a part of GraphQL project. |
15 | 15 | * |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - return (string) $value; |
|
35 | + return (string)$value; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function getDescription() |
39 | 39 | { |
40 | - return 'The `ID` scalar type represents a unique identifier, often used to ' . |
|
41 | - 'refetch an object or as key for a cache. The ID type appears in a JSON ' . |
|
42 | - 'response as a String; however, it is not intended to be human-readable. ' . |
|
43 | - 'When expected as an input type, any string (such as `"4"`) or integer ' . |
|
40 | + return 'The `ID` scalar type represents a unique identifier, often used to '. |
|
41 | + 'refetch an object or as key for a cache. The ID type appears in a JSON '. |
|
42 | + 'response as a String; however, it is not intended to be human-readable. '. |
|
43 | + 'When expected as an input type, any string (such as `"4"`) or integer '. |
|
44 | 44 | '(such as `4`) input value will be accepted as an ID.'; |
45 | 45 | } |
46 | 46 | } |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | 'fields' => [ |
18 | 18 | // here you have a complex field with a lot of options |
19 | 19 | 'title' => [ |
20 | - 'type' => new StringType(), // string type |
|
21 | - 'description' => 'This field contains a post title', // description |
|
22 | - 'isDeprecated' => true, // marked as deprecated |
|
23 | - 'deprecationReason' => 'field title is now deprecated', // explain the reason |
|
20 | + 'type' => new StringType(), // string type |
|
21 | + 'description' => 'This field contains a post title', // description |
|
22 | + 'isDeprecated' => true, // marked as deprecated |
|
23 | + 'deprecationReason' => 'field title is now deprecated', // explain the reason |
|
24 | 24 | 'args' => [ |
25 | 25 | 'truncated' => new BooleanType() // add an optional argument |
26 | 26 | ], |
27 | - 'resolve' => function ($value, $args) { |
|
27 | + 'resolve' => function($value, $args) { |
|
28 | 28 | // used argument to modify a field value |
29 | - return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value; |
|
29 | + return (!empty($args['truncated'])) ? explode(' ', $value)[0].'...' : $value; |
|
30 | 30 | } |
31 | 31 | ], |
32 | 32 | // if field just has a type, you can use a short declaration syntax like this |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | 'id' => new IntType() |
40 | 40 | ], |
41 | 41 | // resolve function for the query |
42 | - 'resolve' => function () { |
|
42 | + 'resolve' => function() { |
|
43 | 43 | return [ |
44 | 44 | 'title' => 'Title for the latest Post', |
45 | 45 | 'summary' => 'Post summary', |