@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function getVisitor(ValidationContext $context) |
24 | 24 | { |
25 | 25 | return [ |
26 | - NodeKind::DIRECTIVE => function (DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
26 | + NodeKind::DIRECTIVE => function(DirectiveNode $node, $key, $parent, $path, $ancestors) use ($context) { |
|
27 | 27 | $directiveDef = null; |
28 | 28 | foreach ($context->getSchema()->getDirectives() as $def) { |
29 | 29 | if ($def->name === $node->name->value) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else if (!in_array($candidateLocation, $directiveDef->locations)) { |
50 | 50 | $context->reportError(new Error( |
51 | 51 | self::misplacedDirectiveMessage($node->name->value, $candidateLocation), |
52 | - [ $node ] |
|
52 | + [$node] |
|
53 | 53 | )); |
54 | 54 | } |
55 | 55 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | if (!empty($this->knownVariableNames[$variableName])) { |
29 | 29 | $context->reportError(new Error( |
30 | 30 | self::duplicateVariableMessage($variableName), |
31 | - [ $this->knownVariableNames[$variableName], $node->variable->name ] |
|
31 | + [$this->knownVariableNames[$variableName], $node->variable->name] |
|
32 | 32 | )); |
33 | 33 | } else { |
34 | 34 | $this->knownVariableNames[$variableName] = $node->variable->name; |
@@ -21,15 +21,15 @@ |
||
21 | 21 | $this->knownFragmentNames = []; |
22 | 22 | |
23 | 23 | return [ |
24 | - NodeKind::OPERATION_DEFINITION => function () { |
|
24 | + NodeKind::OPERATION_DEFINITION => function() { |
|
25 | 25 | return Visitor::skipNode(); |
26 | 26 | }, |
27 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
27 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
28 | 28 | $fragmentName = $node->name->value; |
29 | 29 | if (!empty($this->knownFragmentNames[$fragmentName])) { |
30 | 30 | $context->reportError(new Error( |
31 | 31 | self::duplicateFragmentNameMessage($fragmentName), |
32 | - [ $this->knownFragmentNames[$fragmentName], $node->name ] |
|
32 | + [$this->knownFragmentNames[$fragmentName], $node->name] |
|
33 | 33 | )); |
34 | 34 | } else { |
35 | 35 | $this->knownFragmentNames[$fragmentName] = $node->name; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | static function badValueMessage($typeName, $valueName, $message = null) |
37 | 37 | { |
38 | - return "Expected type {$typeName}, found {$valueName}" . |
|
38 | + return "Expected type {$typeName}, found {$valueName}" . |
|
39 | 39 | ($message ? "; ${message}" : '.'); |
40 | 40 | } |
41 | 41 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $inputFields = $type->getFields(); |
89 | 89 | $nodeFields = iterator_to_array($node->fields); |
90 | 90 | $fieldNodeMap = array_combine( |
91 | - array_map(function ($field) { return $field->name->value; }, $nodeFields), |
|
91 | + array_map(function($field) { return $field->name->value; }, $nodeFields), |
|
92 | 92 | array_values($nodeFields) |
93 | 93 | ); |
94 | 94 | foreach ($inputFields as $fieldName => $fieldDef) { |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | ); |
141 | 141 | } |
142 | 142 | }, |
143 | - NodeKind::INT => function (IntValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
144 | - NodeKind::FLOAT => function (FloatValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
145 | - NodeKind::STRING => function (StringValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
146 | - NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
143 | + NodeKind::INT => function(IntValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
144 | + NodeKind::FLOAT => function(FloatValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
145 | + NodeKind::STRING => function(StringValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
146 | + NodeKind::BOOLEAN => function(BooleanValueNode $node) use ($context) { $this->isValidScalar($context, $node); }, |
|
147 | 147 | ]; |
148 | 148 | } |
149 | 149 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if ($type instanceof EnumType) { |
217 | 217 | $suggestions = Utils::suggestionList( |
218 | 218 | Printer::doPrint($node), |
219 | - array_map(function (EnumValueDefinition $value) { |
|
219 | + array_map(function(EnumValueDefinition $value) { |
|
220 | 220 | return $value->name; |
221 | 221 | }, $type->getValues()) |
222 | 222 | ); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | $name = "GraphQL\\Validator\\Rules\\$name"; |
191 | - return isset($rules[$name]) ? $rules[$name] : null ; |
|
191 | + return isset($rules[$name]) ? $rules[$name] : null; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public static function isError($value) |
206 | 206 | { |
207 | 207 | return is_array($value) |
208 | - ? count(array_filter($value, function($item) { return $item instanceof \Exception || $item instanceof \Throwable;})) === count($value) |
|
208 | + ? count(array_filter($value, function($item) { return $item instanceof \Exception || $item instanceof \Throwable; })) === count($value) |
|
209 | 209 | : ($value instanceof \Exception || $value instanceof \Throwable); |
210 | 210 | } |
211 | 211 |
@@ -212,10 +212,10 @@ |
||
212 | 212 | $newUsages = []; |
213 | 213 | $typeInfo = new TypeInfo($this->schema); |
214 | 214 | Visitor::visit($node, Visitor::visitWithTypeInfo($typeInfo, [ |
215 | - NodeKind::VARIABLE_DEFINITION => function () { |
|
215 | + NodeKind::VARIABLE_DEFINITION => function() { |
|
216 | 216 | return false; |
217 | 217 | }, |
218 | - NodeKind::VARIABLE => function (VariableNode $variable) use (&$newUsages, $typeInfo) { |
|
218 | + NodeKind::VARIABLE => function(VariableNode $variable) use (&$newUsages, $typeInfo) { |
|
219 | 219 | $newUsages[] = ['node' => $variable, 'type' => $typeInfo->getInputType()]; |
220 | 220 | } |
221 | 221 | ])); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $commentReplies = isset(self::$commentReplies[$commentId]) ? self::$commentReplies[$commentId] : []; |
180 | 180 | |
181 | - $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1: 0; |
|
181 | + $start = isset($after) ? (int) array_search($afterId, $commentReplies) + 1 : 0; |
|
182 | 182 | $commentReplies = array_slice($commentReplies, $start, $limit); |
183 | 183 | |
184 | 184 | return array_map( |
@@ -201,6 +201,6 @@ discard block |
||
201 | 201 | |
202 | 202 | public static function findStoryMentions($storyId) |
203 | 203 | { |
204 | - return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] :[]; |
|
204 | + return isset(self::$storyMentions[$storyId]) ? self::$storyMentions[$storyId] : []; |
|
205 | 205 | } |
206 | 206 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | 'args' => [ |
20 | 20 | 'message' => ['type' => Type::string()], |
21 | 21 | ], |
22 | - 'resolve' => function ($root, $args) { |
|
22 | + 'resolve' => function($root, $args) { |
|
23 | 23 | return $root['prefix'] . $args['message']; |
24 | 24 | } |
25 | 25 | ], |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'x' => ['type' => Type::int()], |
36 | 36 | 'y' => ['type' => Type::int()], |
37 | 37 | ], |
38 | - 'resolve' => function ($root, $args) { |
|
38 | + 'resolve' => function($root, $args) { |
|
39 | 39 | return $args['x'] + $args['y']; |
40 | 40 | }, |
41 | 41 | ], |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function resolve($root, $args, $context) |
18 | 18 | { |
19 | - return $root['prefix'].$args['message']; |
|
19 | + return $root['prefix'] . $args['message']; |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 |