@@ -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: |
@@ -47,7 +47,9 @@ |
||
47 | 47 | // code for creating a new post goes here |
48 | 48 | // we simple use our DataProvider for now |
49 | 49 | $post = DataProvider::getPost(10); |
50 | - if (!empty($args['post']['title'])) $post['title'] = $args['post']['title']; |
|
50 | + if (!empty($args['post']['title'])) { |
|
51 | + $post['title'] = $args['post']['title']; |
|
52 | + } |
|
51 | 53 | return $post; |
52 | 54 | } |
53 | 55 | ] |
@@ -164,19 +164,19 @@ |
||
164 | 164 | $this->assertEquals(['data' => ['me' => ['firstName' => 'JOHN']]], $processor->getResponseData()); |
165 | 165 | |
166 | 166 | $schema->getMutationType() |
167 | - ->addField(new Field([ |
|
168 | - 'name' => 'increaseCounter', |
|
169 | - 'type' => new IntType(), |
|
170 | - 'resolve' => function ($value, $args, ResolveInfo $info) { |
|
171 | - return $this->_counter += $args['amount']; |
|
172 | - }, |
|
173 | - 'args' => [ |
|
174 | - 'amount' => [ |
|
175 | - 'type' => new IntType(), |
|
176 | - 'default' => 1 |
|
177 | - ] |
|
178 | - ] |
|
179 | - ]))->addField(new Field([ |
|
167 | + ->addField(new Field([ |
|
168 | + 'name' => 'increaseCounter', |
|
169 | + 'type' => new IntType(), |
|
170 | + 'resolve' => function ($value, $args, ResolveInfo $info) { |
|
171 | + return $this->_counter += $args['amount']; |
|
172 | + }, |
|
173 | + 'args' => [ |
|
174 | + 'amount' => [ |
|
175 | + 'type' => new IntType(), |
|
176 | + 'default' => 1 |
|
177 | + ] |
|
178 | + ] |
|
179 | + ]))->addField(new Field([ |
|
180 | 180 | 'name' => 'invalidResolveTypeMutation', |
181 | 181 | 'type' => new NonNullType(new IntType()), |
182 | 182 | 'resolve' => function () { |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -59,7 +59,9 @@ |
||
59 | 59 | { |
60 | 60 | if ($value instanceof AbstractObjectType) { |
61 | 61 | foreach($value->getInterfaces() as $interface) { |
62 | - if ($interface instanceof $this) return true; |
|
62 | + if ($interface instanceof $this) { |
|
63 | + return true; |
|
64 | + } |
|
63 | 65 | } |
64 | 66 | } |
65 | 67 | return false; |
@@ -18,7 +18,9 @@ |
||
18 | 18 | |
19 | 19 | public function buildArguments() |
20 | 20 | { |
21 | - if ($this->_isArgumentsBuilt) return true; |
|
21 | + if ($this->_isArgumentsBuilt) { |
|
22 | + return true; |
|
23 | + } |
|
22 | 24 | |
23 | 25 | if (!empty($this->data['args'])) { |
24 | 26 | $this->addArguments($this->data['args']); |