@@ -31,7 +31,7 @@ |
||
31 | 31 | ->addField('friends', new ListType([ |
32 | 32 | 'item' => new CharacterInterface() |
33 | 33 | ]), [ |
34 | - 'resolve' => function ($droid) { |
|
34 | + 'resolve' => function($droid) { |
|
35 | 35 | return StarWarsData::getFriends($droid); |
36 | 36 | }, |
37 | 37 | ]) |
@@ -98,21 +98,21 @@ discard block |
||
98 | 98 | 'friends' => [ |
99 | 99 | [ |
100 | 100 | 'name' => 'Luke Skywalker', |
101 | - 'appearsIn' => ['NEWHOPE', 'EMPIRE', 'JEDI',], |
|
101 | + 'appearsIn' => ['NEWHOPE', 'EMPIRE', 'JEDI', ], |
|
102 | 102 | 'friends' => [ |
103 | - ['name' => 'Han Solo',], |
|
104 | - ['name' => 'Leia Organa',], |
|
105 | - ['name' => 'C-3PO',], |
|
106 | - ['name' => 'R2-D2',], |
|
103 | + ['name' => 'Han Solo', ], |
|
104 | + ['name' => 'Leia Organa', ], |
|
105 | + ['name' => 'C-3PO', ], |
|
106 | + ['name' => 'R2-D2', ], |
|
107 | 107 | ], |
108 | 108 | ], |
109 | 109 | [ |
110 | 110 | 'name' => 'Han Solo', |
111 | 111 | 'appearsIn' => ['NEWHOPE', 'EMPIRE', 'JEDI'], |
112 | 112 | 'friends' => [ |
113 | - ['name' => 'Luke Skywalker',], |
|
113 | + ['name' => 'Luke Skywalker', ], |
|
114 | 114 | ['name' => 'Leia Organa'], |
115 | - ['name' => 'R2-D2',], |
|
115 | + ['name' => 'R2-D2', ], |
|
116 | 116 | ] |
117 | 117 | ], |
118 | 118 | [ |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | 'appearsIn' => ['NEWHOPE', 'EMPIRE', 'JEDI'], |
121 | 121 | 'friends' => |
122 | 122 | [ |
123 | - ['name' => 'Luke Skywalker',], |
|
124 | - ['name' => 'Han Solo',], |
|
125 | - ['name' => 'C-3PO',], |
|
126 | - ['name' => 'R2-D2',], |
|
123 | + ['name' => 'Luke Skywalker', ], |
|
124 | + ['name' => 'Han Solo', ], |
|
125 | + ['name' => 'C-3PO', ], |
|
126 | + ['name' => 'R2-D2', ], |
|
127 | 127 | ], |
128 | 128 | ], |
129 | 129 | ], |
@@ -29,9 +29,9 @@ |
||
29 | 29 | |
30 | 30 | public function getDescription() |
31 | 31 | { |
32 | - return 'The `Int` scalar type represents non-fractional signed whole numeric ' . |
|
33 | - 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since ' . |
|
34 | - 'represented in JSON as double-precision floating point numbers specified' . |
|
32 | + return 'The `Int` scalar type represents non-fractional signed whole numeric '. |
|
33 | + 'values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since '. |
|
34 | + 'represented in JSON as double-precision floating point numbers specified'. |
|
35 | 35 | 'by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
36 | 36 | } |
37 | 37 |
@@ -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 | } |
@@ -23,8 +23,8 @@ |
||
23 | 23 | |
24 | 24 | public function getDescription() |
25 | 25 | { |
26 | - return 'The `Float` scalar type represents signed double-precision fractional ' . |
|
27 | - 'values as specified by ' . |
|
26 | + return 'The `Float` scalar type represents signed double-precision fractional '. |
|
27 | + 'values as specified by '. |
|
28 | 28 | '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).'; |
29 | 29 | } |
30 | 30 |
@@ -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 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | use Youshido\GraphQL\Processor; |
12 | 12 | use Youshido\GraphQL\Schema; |
13 | 13 | |
14 | -require_once __DIR__ . '/schema-bootstrap.php'; |
|
14 | +require_once __DIR__.'/schema-bootstrap.php'; |
|
15 | 15 | /** @var Schema $schema */ |
16 | 16 | $schema = new BlogSchema(); |
17 | 17 |
@@ -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 | } |
@@ -27,7 +27,9 @@ |
||
27 | 27 | if (!$type) { |
28 | 28 | return; |
29 | 29 | } |
30 | - if (is_object($type) && array_key_exists($type->getName(), $this->types)) return; |
|
30 | + if (is_object($type) && array_key_exists($type->getName(), $this->types)) { |
|
31 | + return; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | switch ($type->getKind()) { |
33 | 35 | case TypeMap::KIND_INTERFACE: |
@@ -21,7 +21,7 @@ |
||
21 | 21 | ->addField('id', TypeMap::TYPE_ID, ['required' => true]) |
22 | 22 | ->addField('name', TypeMap::TYPE_STRING, ['required' => true]) |
23 | 23 | ->addField('friends', new ListType(new CharacterInterface()), [ |
24 | - 'resolve' => function ($value) { |
|
24 | + 'resolve' => function($value) { |
|
25 | 25 | return $value['friends']; |
26 | 26 | } |
27 | 27 | ]) |