@@ -80,12 +80,12 @@ |
||
80 | 80 | // TODO: rework with generators when PHP minimum required version is changed to 5.5+ |
81 | 81 | $promisesOrValues = Utils::map( |
82 | 82 | $promisesOrValues, |
83 | - static function ($item) { |
|
83 | + static function($item) { |
|
84 | 84 | return $item instanceof Promise ? $item->adoptedPromise : $item; |
85 | 85 | } |
86 | 86 | ); |
87 | 87 | |
88 | - $promise = all($promisesOrValues)->then(static function ($values) use ($promisesOrValues) : array { |
|
88 | + $promise = all($promisesOrValues)->then(static function($values) use ($promisesOrValues) : array { |
|
89 | 89 | $orderedResults = []; |
90 | 90 | |
91 | 91 | foreach ($promisesOrValues as $key => $value) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function convertThenable($thenable) |
34 | 34 | { |
35 | - if (! $thenable instanceof Deferred) { |
|
35 | + if (!$thenable instanceof Deferred) { |
|
36 | 36 | throw new InvariantViolation('Expected instance of GraphQL\Deferred, got ' . Utils::printSafe($thenable)); |
37 | 37 | } |
38 | 38 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if ($promiseOrValue instanceof Promise) { |
111 | 111 | $result[$index] = null; |
112 | 112 | $promiseOrValue->then( |
113 | - static function ($value) use ($index, &$count, $total, &$result, $all) : void { |
|
113 | + static function($value) use ($index, &$count, $total, &$result, $all) : void { |
|
114 | 114 | $result[$index] = $value; |
115 | 115 | $count++; |
116 | 116 | if ($count < $total) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $promiseQueue = SyncPromise::getQueue(); |
146 | 146 | |
147 | 147 | while ($promise->adoptedPromise->state === SyncPromise::PENDING && |
148 | - ! ($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
148 | + !($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
149 | 149 | ) { |
150 | 150 | Deferred::runQueue(); |
151 | 151 | SyncPromise::runQueue(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | private function __construct(ExecutionContext $context) |
63 | 63 | { |
64 | - if (! self::$UNDEFINED) { |
|
64 | + if (!self::$UNDEFINED) { |
|
65 | 65 | self::$UNDEFINED = Utils::undefined(); |
66 | 66 | } |
67 | 67 | $this->exeContext = $context; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $errors = array_merge($errors, $coercionErrors); |
177 | 177 | } |
178 | 178 | } |
179 | - if (! empty($errors)) { |
|
179 | + if (!empty($errors)) { |
|
180 | 180 | return $errors; |
181 | 181 | } |
182 | 182 | Utils::invariant($operation, 'Has operation if no errors.'); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | private function buildResponse($data) |
223 | 223 | { |
224 | 224 | if ($this->isPromise($data)) { |
225 | - return $data->then(function ($resolved) { |
|
225 | + return $data->then(function($resolved) { |
|
226 | 226 | return $this->buildResponse($resolved); |
227 | 227 | }); |
228 | 228 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ($this->isPromise($result)) { |
258 | 258 | return $result->then( |
259 | 259 | null, |
260 | - function ($error) : ?Promise { |
|
260 | + function($error) : ?Promise { |
|
261 | 261 | if ($error instanceof Error) { |
262 | 262 | $this->exeContext->addError($error); |
263 | 263 | |
@@ -348,18 +348,18 @@ discard block |
||
348 | 348 | foreach ($selectionSet->selections as $selection) { |
349 | 349 | switch (true) { |
350 | 350 | case $selection instanceof FieldNode: |
351 | - if (! $this->shouldIncludeNode($selection)) { |
|
351 | + if (!$this->shouldIncludeNode($selection)) { |
|
352 | 352 | break; |
353 | 353 | } |
354 | 354 | $name = self::getFieldEntryKey($selection); |
355 | - if (! isset($fields[$name])) { |
|
355 | + if (!isset($fields[$name])) { |
|
356 | 356 | $fields[$name] = new ArrayObject(); |
357 | 357 | } |
358 | 358 | $fields[$name][] = $selection; |
359 | 359 | break; |
360 | 360 | case $selection instanceof InlineFragmentNode: |
361 | - if (! $this->shouldIncludeNode($selection) || |
|
362 | - ! $this->doesFragmentConditionMatch($selection, $runtimeType) |
|
361 | + if (!$this->shouldIncludeNode($selection) || |
|
362 | + !$this->doesFragmentConditionMatch($selection, $runtimeType) |
|
363 | 363 | ) { |
364 | 364 | break; |
365 | 365 | } |
@@ -372,13 +372,13 @@ discard block |
||
372 | 372 | break; |
373 | 373 | case $selection instanceof FragmentSpreadNode: |
374 | 374 | $fragName = $selection->name->value; |
375 | - if (! empty($visitedFragmentNames[$fragName]) || ! $this->shouldIncludeNode($selection)) { |
|
375 | + if (!empty($visitedFragmentNames[$fragName]) || !$this->shouldIncludeNode($selection)) { |
|
376 | 376 | break; |
377 | 377 | } |
378 | 378 | $visitedFragmentNames[$fragName] = true; |
379 | 379 | /** @var FragmentDefinitionNode|null $fragment */ |
380 | 380 | $fragment = $exeContext->fragments[$fragName] ?? null; |
381 | - if ($fragment === null || ! $this->doesFragmentConditionMatch($fragment, $runtimeType)) { |
|
381 | + if ($fragment === null || !$this->doesFragmentConditionMatch($fragment, $runtimeType)) { |
|
382 | 382 | break; |
383 | 383 | } |
384 | 384 | $this->collectFields( |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | $variableValues |
420 | 420 | ); |
421 | 421 | |
422 | - return ! isset($include['if']) || $include['if'] !== false; |
|
422 | + return !isset($include['if']) || $include['if'] !== false; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | { |
471 | 471 | $result = $this->promiseReduce( |
472 | 472 | array_keys($fields->getArrayCopy()), |
473 | - function ($results, $responseName) use ($path, $parentType, $rootValue, $fields) { |
|
473 | + function($results, $responseName) use ($path, $parentType, $rootValue, $fields) { |
|
474 | 474 | $fieldNodes = $fields[$responseName]; |
475 | 475 | $fieldPath = $path; |
476 | 476 | $fieldPath[] = $responseName; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | } |
481 | 481 | $promise = $this->getPromise($result); |
482 | 482 | if ($promise !== null) { |
483 | - return $promise->then(static function ($resolvedResult) use ($responseName, $results) { |
|
483 | + return $promise->then(static function($resolvedResult) use ($responseName, $results) { |
|
484 | 484 | $results[$responseName] = $resolvedResult; |
485 | 485 | |
486 | 486 | return $results; |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | ); |
495 | 495 | |
496 | 496 | if ($this->isPromise($result)) { |
497 | - return $result->then(static function ($resolvedResults) { |
|
497 | + return $result->then(static function($resolvedResults) { |
|
498 | 498 | return self::fixResultsIfEmptyArray($resolvedResults); |
499 | 499 | }); |
500 | 500 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | try { |
619 | 619 | // Build a map of arguments from the field.arguments AST, using the |
620 | 620 | // variables scope to fulfill any variable references. |
621 | - $args = Values::getArgumentValues( |
|
621 | + $args = Values::getArgumentValues( |
|
622 | 622 | $fieldDef, |
623 | 623 | $fieldNode, |
624 | 624 | $this->exeContext->variableValues |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | try { |
654 | 654 | $promise = $this->getPromise($result); |
655 | 655 | if ($promise !== null) { |
656 | - $completed = $promise->then(function (&$resolved) use ($returnType, $fieldNodes, $info, $path) { |
|
656 | + $completed = $promise->then(function(&$resolved) use ($returnType, $fieldNodes, $info, $path) { |
|
657 | 657 | return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolved); |
658 | 658 | }); |
659 | 659 | } else { |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | |
663 | 663 | $promise = $this->getPromise($completed); |
664 | 664 | if ($promise !== null) { |
665 | - return $promise->then(null, function ($error) use ($fieldNodes, $path, $returnType) { |
|
665 | + return $promise->then(null, function($error) use ($fieldNodes, $path, $returnType) { |
|
666 | 666 | return $this->handleFieldError($error, $fieldNodes, $path, $returnType); |
667 | 667 | }); |
668 | 668 | } |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | } |
822 | 822 | if ($this->exeContext->promiseAdapter->isThenable($value)) { |
823 | 823 | $promise = $this->exeContext->promiseAdapter->convertThenable($value); |
824 | - if (! $promise instanceof Promise) { |
|
824 | + if (!$promise instanceof Promise) { |
|
825 | 825 | throw new InvariantViolation(sprintf( |
826 | 826 | '%s::convertThenable is expected to return instance of GraphQL\Executor\Promise\Promise, got: %s', |
827 | 827 | get_class($this->exeContext->promiseAdapter), |
@@ -851,10 +851,10 @@ discard block |
||
851 | 851 | { |
852 | 852 | return array_reduce( |
853 | 853 | $values, |
854 | - function ($previous, $value) use ($callback) { |
|
854 | + function($previous, $value) use ($callback) { |
|
855 | 855 | $promise = $this->getPromise($previous); |
856 | 856 | if ($promise !== null) { |
857 | - return $promise->then(static function ($resolved) use ($callback, $value) { |
|
857 | + return $promise->then(static function($resolved) use ($callback, $value) { |
|
858 | 858 | return $callback($resolved, $value); |
859 | 859 | }); |
860 | 860 | } |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | $fieldPath[] = $i++; |
892 | 892 | $info->path = $fieldPath; |
893 | 893 | $completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item); |
894 | - if (! $containsPromise && $this->getPromise($completedItem) !== null) { |
|
894 | + if (!$containsPromise && $this->getPromise($completedItem) !== null) { |
|
895 | 895 | $containsPromise = true; |
896 | 896 | } |
897 | 897 | $completedItems[] = $completedItem; |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | } |
946 | 946 | $promise = $this->getPromise($runtimeType); |
947 | 947 | if ($promise !== null) { |
948 | - return $promise->then(function ($resolvedRuntimeType) use ( |
|
948 | + return $promise->then(function($resolvedRuntimeType) use ( |
|
949 | 949 | $returnType, |
950 | 950 | $fieldNodes, |
951 | 951 | $info, |
@@ -1036,9 +1036,9 @@ discard block |
||
1036 | 1036 | return $type; |
1037 | 1037 | } |
1038 | 1038 | } |
1039 | - if (! empty($promisedIsTypeOfResults)) { |
|
1039 | + if (!empty($promisedIsTypeOfResults)) { |
|
1040 | 1040 | return $this->exeContext->promiseAdapter->all($promisedIsTypeOfResults) |
1041 | - ->then(static function ($isTypeOfResults) use ($possibleTypes) { |
|
1041 | + ->then(static function($isTypeOfResults) use ($possibleTypes) { |
|
1042 | 1042 | foreach ($isTypeOfResults as $index => $result) { |
1043 | 1043 | if ($result) { |
1044 | 1044 | return $possibleTypes[$index]; |
@@ -1072,13 +1072,13 @@ discard block |
||
1072 | 1072 | if ($isTypeOf !== null) { |
1073 | 1073 | $promise = $this->getPromise($isTypeOf); |
1074 | 1074 | if ($promise !== null) { |
1075 | - return $promise->then(function ($isTypeOfResult) use ( |
|
1075 | + return $promise->then(function($isTypeOfResult) use ( |
|
1076 | 1076 | $returnType, |
1077 | 1077 | $fieldNodes, |
1078 | 1078 | $path, |
1079 | 1079 | &$result |
1080 | 1080 | ) { |
1081 | - if (! $isTypeOfResult) { |
|
1081 | + if (!$isTypeOfResult) { |
|
1082 | 1082 | throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); |
1083 | 1083 | } |
1084 | 1084 | |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | ); |
1091 | 1091 | }); |
1092 | 1092 | } |
1093 | - if (! $isTypeOf) { |
|
1093 | + if (!$isTypeOf) { |
|
1094 | 1094 | throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); |
1095 | 1095 | } |
1096 | 1096 | } |
@@ -1149,15 +1149,15 @@ discard block |
||
1149 | 1149 | */ |
1150 | 1150 | private function collectSubFields(ObjectType $returnType, $fieldNodes) : ArrayObject |
1151 | 1151 | { |
1152 | - if (! isset($this->subFieldCache[$returnType])) { |
|
1152 | + if (!isset($this->subFieldCache[$returnType])) { |
|
1153 | 1153 | $this->subFieldCache[$returnType] = new SplObjectStorage(); |
1154 | 1154 | } |
1155 | - if (! isset($this->subFieldCache[$returnType][$fieldNodes])) { |
|
1155 | + if (!isset($this->subFieldCache[$returnType][$fieldNodes])) { |
|
1156 | 1156 | // Collect sub-fields to execute to complete this value. |
1157 | 1157 | $subFieldNodes = new ArrayObject(); |
1158 | 1158 | $visitedFragmentNames = new ArrayObject(); |
1159 | 1159 | foreach ($fieldNodes as $fieldNode) { |
1160 | - if (! isset($fieldNode->selectionSet)) { |
|
1160 | + if (!isset($fieldNode->selectionSet)) { |
|
1161 | 1161 | continue; |
1162 | 1162 | } |
1163 | 1163 | $subFieldNodes = $this->collectFields( |
@@ -1194,13 +1194,13 @@ discard block |
||
1194 | 1194 | if ($result === self::$UNDEFINED) { |
1195 | 1195 | continue; |
1196 | 1196 | } |
1197 | - if (! $containsPromise && $this->isPromise($result)) { |
|
1197 | + if (!$containsPromise && $this->isPromise($result)) { |
|
1198 | 1198 | $containsPromise = true; |
1199 | 1199 | } |
1200 | 1200 | $results[$responseName] = $result; |
1201 | 1201 | } |
1202 | 1202 | // If there are no promises, we can just return the object |
1203 | - if (! $containsPromise) { |
|
1203 | + if (!$containsPromise) { |
|
1204 | 1204 | return self::fixResultsIfEmptyArray($results); |
1205 | 1205 | } |
1206 | 1206 | |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | $valuesAndPromises = array_values($assoc); |
1244 | 1244 | $promise = $this->exeContext->promiseAdapter->all($valuesAndPromises); |
1245 | 1245 | |
1246 | - return $promise->then(static function ($values) use ($keys) { |
|
1246 | + return $promise->then(static function($values) use ($keys) { |
|
1247 | 1247 | $resolvedResults = []; |
1248 | 1248 | foreach ($values as $i => $value) { |
1249 | 1249 | $resolvedResults[$keys[$i]] = $value; |
@@ -1269,7 +1269,7 @@ discard block |
||
1269 | 1269 | $runtimeType = is_string($runtimeTypeOrName) |
1270 | 1270 | ? $this->exeContext->schema->getType($runtimeTypeOrName) |
1271 | 1271 | : $runtimeTypeOrName; |
1272 | - if (! $runtimeType instanceof ObjectType) { |
|
1272 | + if (!$runtimeType instanceof ObjectType) { |
|
1273 | 1273 | throw new InvariantViolation( |
1274 | 1274 | sprintf( |
1275 | 1275 | 'Abstract type %s must resolve to an Object type at ' . |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | ) |
1286 | 1286 | ); |
1287 | 1287 | } |
1288 | - if (! $this->exeContext->schema->isPossibleType($returnType, $runtimeType)) { |
|
1288 | + if (!$this->exeContext->schema->isPossibleType($returnType, $runtimeType)) { |
|
1289 | 1289 | throw new InvariantViolation( |
1290 | 1290 | sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeType, $returnType) |
1291 | 1291 | ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ); |
63 | 63 | $descriptions = $options; |
64 | 64 | } else { |
65 | - $descriptions = ! array_key_exists('descriptions', $options) || $options['descriptions'] === true; |
|
65 | + $descriptions = !array_key_exists('descriptions', $options) || $options['descriptions'] === true; |
|
66 | 66 | } |
67 | 67 | $descriptionField = $descriptions ? 'description' : ''; |
68 | 68 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | public static function _schema() |
217 | 217 | { |
218 | - if (! isset(self::$map['__Schema'])) { |
|
218 | + if (!isset(self::$map['__Schema'])) { |
|
219 | 219 | self::$map['__Schema'] = new ObjectType([ |
220 | 220 | 'name' => '__Schema', |
221 | 221 | 'isIntrospection' => true, |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | 'types' => [ |
229 | 229 | 'description' => 'A list of all types supported by this server.', |
230 | 230 | 'type' => new NonNull(new ListOfType(new NonNull(self::_type()))), |
231 | - 'resolve' => static function (Schema $schema) { |
|
231 | + 'resolve' => static function(Schema $schema) { |
|
232 | 232 | return array_values($schema->getTypeMap()); |
233 | 233 | }, |
234 | 234 | ], |
235 | 235 | 'queryType' => [ |
236 | 236 | 'description' => 'The type that query operations will be rooted at.', |
237 | 237 | 'type' => new NonNull(self::_type()), |
238 | - 'resolve' => static function (Schema $schema) { |
|
238 | + 'resolve' => static function(Schema $schema) { |
|
239 | 239 | return $schema->getQueryType(); |
240 | 240 | }, |
241 | 241 | ], |
@@ -244,21 +244,21 @@ discard block |
||
244 | 244 | 'If this server supports mutation, the type that ' . |
245 | 245 | 'mutation operations will be rooted at.', |
246 | 246 | 'type' => self::_type(), |
247 | - 'resolve' => static function (Schema $schema) { |
|
247 | + 'resolve' => static function(Schema $schema) { |
|
248 | 248 | return $schema->getMutationType(); |
249 | 249 | }, |
250 | 250 | ], |
251 | 251 | 'subscriptionType' => [ |
252 | 252 | 'description' => 'If this server support subscription, the type that subscription operations will be rooted at.', |
253 | 253 | 'type' => self::_type(), |
254 | - 'resolve' => static function (Schema $schema) { |
|
254 | + 'resolve' => static function(Schema $schema) { |
|
255 | 255 | return $schema->getSubscriptionType(); |
256 | 256 | }, |
257 | 257 | ], |
258 | 258 | 'directives' => [ |
259 | 259 | 'description' => 'A list of all directives supported by this server.', |
260 | 260 | 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directive()))), |
261 | - 'resolve' => static function (Schema $schema) { |
|
261 | + 'resolve' => static function(Schema $schema) { |
|
262 | 262 | return $schema->getDirectives(); |
263 | 263 | }, |
264 | 264 | ], |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | public static function _type() |
273 | 273 | { |
274 | - if (! isset(self::$map['__Type'])) { |
|
274 | + if (!isset(self::$map['__Type'])) { |
|
275 | 275 | self::$map['__Type'] = new ObjectType([ |
276 | 276 | 'name' => '__Type', |
277 | 277 | 'isIntrospection' => true, |
@@ -285,11 +285,11 @@ discard block |
||
285 | 285 | 'Object and Interface types provide the fields they describe. Abstract ' . |
286 | 286 | 'types, Union and Interface, provide the Object types possible ' . |
287 | 287 | 'at runtime. List and NonNull types compose other types.', |
288 | - 'fields' => static function () { |
|
288 | + 'fields' => static function() { |
|
289 | 289 | return [ |
290 | 290 | 'kind' => [ |
291 | 291 | 'type' => Type::nonNull(self::_typeKind()), |
292 | - 'resolve' => static function (Type $type) { |
|
292 | + 'resolve' => static function(Type $type) { |
|
293 | 293 | switch (true) { |
294 | 294 | case $type instanceof ListOfType: |
295 | 295 | return TypeKind::LIST; |
@@ -314,13 +314,13 @@ discard block |
||
314 | 314 | ], |
315 | 315 | 'name' => [ |
316 | 316 | 'type' => Type::string(), |
317 | - 'resolve' => static function ($obj) { |
|
317 | + 'resolve' => static function($obj) { |
|
318 | 318 | return $obj->name; |
319 | 319 | }, |
320 | 320 | ], |
321 | 321 | 'description' => [ |
322 | 322 | 'type' => Type::string(), |
323 | - 'resolve' => static function ($obj) { |
|
323 | + 'resolve' => static function($obj) { |
|
324 | 324 | return $obj->description; |
325 | 325 | }, |
326 | 326 | ], |
@@ -329,15 +329,15 @@ discard block |
||
329 | 329 | 'args' => [ |
330 | 330 | 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], |
331 | 331 | ], |
332 | - 'resolve' => static function (Type $type, $args) { |
|
332 | + 'resolve' => static function(Type $type, $args) { |
|
333 | 333 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
334 | 334 | $fields = $type->getFields(); |
335 | 335 | |
336 | 336 | if (empty($args['includeDeprecated'])) { |
337 | 337 | $fields = array_filter( |
338 | 338 | $fields, |
339 | - static function (FieldDefinition $field) { |
|
340 | - return ! $field->deprecationReason; |
|
339 | + static function(FieldDefinition $field) { |
|
340 | + return !$field->deprecationReason; |
|
341 | 341 | } |
342 | 342 | ); |
343 | 343 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | ], |
351 | 351 | 'interfaces' => [ |
352 | 352 | 'type' => Type::listOf(Type::nonNull(self::_type())), |
353 | - 'resolve' => static function ($type) { |
|
353 | + 'resolve' => static function($type) { |
|
354 | 354 | if ($type instanceof ObjectType) { |
355 | 355 | return $type->getInterfaces(); |
356 | 356 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | ], |
361 | 361 | 'possibleTypes' => [ |
362 | 362 | 'type' => Type::listOf(Type::nonNull(self::_type())), |
363 | - 'resolve' => static function ($type, $args, $context, ResolveInfo $info) { |
|
363 | + 'resolve' => static function($type, $args, $context, ResolveInfo $info) { |
|
364 | 364 | if ($type instanceof InterfaceType || $type instanceof UnionType) { |
365 | 365 | return $info->schema->getPossibleTypes($type); |
366 | 366 | } |
@@ -373,15 +373,15 @@ discard block |
||
373 | 373 | 'args' => [ |
374 | 374 | 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], |
375 | 375 | ], |
376 | - 'resolve' => static function ($type, $args) { |
|
376 | + 'resolve' => static function($type, $args) { |
|
377 | 377 | if ($type instanceof EnumType) { |
378 | 378 | $values = array_values($type->getValues()); |
379 | 379 | |
380 | 380 | if (empty($args['includeDeprecated'])) { |
381 | 381 | $values = array_filter( |
382 | 382 | $values, |
383 | - static function ($value) { |
|
384 | - return ! $value->deprecationReason; |
|
383 | + static function($value) { |
|
384 | + return !$value->deprecationReason; |
|
385 | 385 | } |
386 | 386 | ); |
387 | 387 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | ], |
395 | 395 | 'inputFields' => [ |
396 | 396 | 'type' => Type::listOf(Type::nonNull(self::_inputValue())), |
397 | - 'resolve' => static function ($type) { |
|
397 | + 'resolve' => static function($type) { |
|
398 | 398 | if ($type instanceof InputObjectType) { |
399 | 399 | return array_values($type->getFields()); |
400 | 400 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | ], |
405 | 405 | 'ofType' => [ |
406 | 406 | 'type' => self::_type(), |
407 | - 'resolve' => static function ($type) { |
|
407 | + 'resolve' => static function($type) { |
|
408 | 408 | if ($type instanceof WrappingType) { |
409 | 409 | return $type->getWrappedType(); |
410 | 410 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | |
423 | 423 | public static function _typeKind() |
424 | 424 | { |
425 | - if (! isset(self::$map['__TypeKind'])) { |
|
425 | + if (!isset(self::$map['__TypeKind'])) { |
|
426 | 426 | self::$map['__TypeKind'] = new EnumType([ |
427 | 427 | 'name' => '__TypeKind', |
428 | 428 | 'isIntrospection' => true, |
@@ -469,48 +469,48 @@ discard block |
||
469 | 469 | |
470 | 470 | public static function _field() |
471 | 471 | { |
472 | - if (! isset(self::$map['__Field'])) { |
|
472 | + if (!isset(self::$map['__Field'])) { |
|
473 | 473 | self::$map['__Field'] = new ObjectType([ |
474 | 474 | 'name' => '__Field', |
475 | 475 | 'isIntrospection' => true, |
476 | 476 | 'description' => |
477 | 477 | 'Object and Interface types are described by a list of Fields, each of ' . |
478 | 478 | 'which has a name, potentially a list of arguments, and a return type.', |
479 | - 'fields' => static function () { |
|
479 | + 'fields' => static function() { |
|
480 | 480 | return [ |
481 | 481 | 'name' => [ |
482 | 482 | 'type' => Type::nonNull(Type::string()), |
483 | - 'resolve' => static function (FieldDefinition $field) { |
|
483 | + 'resolve' => static function(FieldDefinition $field) { |
|
484 | 484 | return $field->name; |
485 | 485 | }, |
486 | 486 | ], |
487 | 487 | 'description' => [ |
488 | 488 | 'type' => Type::string(), |
489 | - 'resolve' => static function (FieldDefinition $field) { |
|
489 | + 'resolve' => static function(FieldDefinition $field) { |
|
490 | 490 | return $field->description; |
491 | 491 | }, |
492 | 492 | ], |
493 | 493 | 'args' => [ |
494 | 494 | 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), |
495 | - 'resolve' => static function (FieldDefinition $field) { |
|
495 | + 'resolve' => static function(FieldDefinition $field) { |
|
496 | 496 | return empty($field->args) ? [] : $field->args; |
497 | 497 | }, |
498 | 498 | ], |
499 | 499 | 'type' => [ |
500 | 500 | 'type' => Type::nonNull(self::_type()), |
501 | - 'resolve' => static function (FieldDefinition $field) { |
|
501 | + 'resolve' => static function(FieldDefinition $field) { |
|
502 | 502 | return $field->getType(); |
503 | 503 | }, |
504 | 504 | ], |
505 | 505 | 'isDeprecated' => [ |
506 | 506 | 'type' => Type::nonNull(Type::boolean()), |
507 | - 'resolve' => static function (FieldDefinition $field) { |
|
507 | + 'resolve' => static function(FieldDefinition $field) { |
|
508 | 508 | return (bool) $field->deprecationReason; |
509 | 509 | }, |
510 | 510 | ], |
511 | 511 | 'deprecationReason' => [ |
512 | 512 | 'type' => Type::string(), |
513 | - 'resolve' => static function (FieldDefinition $field) { |
|
513 | + 'resolve' => static function(FieldDefinition $field) { |
|
514 | 514 | return $field->deprecationReason; |
515 | 515 | }, |
516 | 516 | ], |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | |
525 | 525 | public static function _inputValue() |
526 | 526 | { |
527 | - if (! isset(self::$map['__InputValue'])) { |
|
527 | + if (!isset(self::$map['__InputValue'])) { |
|
528 | 528 | self::$map['__InputValue'] = new ObjectType([ |
529 | 529 | 'name' => '__InputValue', |
530 | 530 | 'isIntrospection' => true, |
@@ -532,11 +532,11 @@ discard block |
||
532 | 532 | 'Arguments provided to Fields or Directives and the input fields of an ' . |
533 | 533 | 'InputObject are represented as Input Values which describe their type ' . |
534 | 534 | 'and optionally a default value.', |
535 | - 'fields' => static function () { |
|
535 | + 'fields' => static function() { |
|
536 | 536 | return [ |
537 | 537 | 'name' => [ |
538 | 538 | 'type' => Type::nonNull(Type::string()), |
539 | - 'resolve' => static function ($inputValue) { |
|
539 | + 'resolve' => static function($inputValue) { |
|
540 | 540 | /** @var FieldArgument|InputObjectField $inputValue */ |
541 | 541 | $inputValue = $inputValue; |
542 | 542 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | ], |
546 | 546 | 'description' => [ |
547 | 547 | 'type' => Type::string(), |
548 | - 'resolve' => static function ($inputValue) { |
|
548 | + 'resolve' => static function($inputValue) { |
|
549 | 549 | /** @var FieldArgument|InputObjectField $inputValue */ |
550 | 550 | $inputValue = $inputValue; |
551 | 551 | |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | ], |
555 | 555 | 'type' => [ |
556 | 556 | 'type' => Type::nonNull(self::_type()), |
557 | - 'resolve' => static function ($value) { |
|
557 | + 'resolve' => static function($value) { |
|
558 | 558 | return method_exists($value, 'getType') |
559 | 559 | ? $value->getType() |
560 | 560 | : $value->type; |
@@ -564,11 +564,11 @@ discard block |
||
564 | 564 | 'type' => Type::string(), |
565 | 565 | 'description' => |
566 | 566 | 'A GraphQL-formatted string representing the default value for this input value.', |
567 | - 'resolve' => static function ($inputValue) { |
|
567 | + 'resolve' => static function($inputValue) { |
|
568 | 568 | /** @var FieldArgument|InputObjectField $inputValue */ |
569 | 569 | $inputValue = $inputValue; |
570 | 570 | |
571 | - return ! $inputValue->defaultValueExists() |
|
571 | + return !$inputValue->defaultValueExists() |
|
572 | 572 | ? null |
573 | 573 | : Printer::doPrint(AST::astFromValue( |
574 | 574 | $inputValue->defaultValue, |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | |
587 | 587 | public static function _enumValue() |
588 | 588 | { |
589 | - if (! isset(self::$map['__EnumValue'])) { |
|
589 | + if (!isset(self::$map['__EnumValue'])) { |
|
590 | 590 | self::$map['__EnumValue'] = new ObjectType([ |
591 | 591 | 'name' => '__EnumValue', |
592 | 592 | 'isIntrospection' => true, |
@@ -597,25 +597,25 @@ discard block |
||
597 | 597 | 'fields' => [ |
598 | 598 | 'name' => [ |
599 | 599 | 'type' => Type::nonNull(Type::string()), |
600 | - 'resolve' => static function ($enumValue) { |
|
600 | + 'resolve' => static function($enumValue) { |
|
601 | 601 | return $enumValue->name; |
602 | 602 | }, |
603 | 603 | ], |
604 | 604 | 'description' => [ |
605 | 605 | 'type' => Type::string(), |
606 | - 'resolve' => static function ($enumValue) { |
|
606 | + 'resolve' => static function($enumValue) { |
|
607 | 607 | return $enumValue->description; |
608 | 608 | }, |
609 | 609 | ], |
610 | 610 | 'isDeprecated' => [ |
611 | 611 | 'type' => Type::nonNull(Type::boolean()), |
612 | - 'resolve' => static function ($enumValue) { |
|
612 | + 'resolve' => static function($enumValue) { |
|
613 | 613 | return (bool) $enumValue->deprecationReason; |
614 | 614 | }, |
615 | 615 | ], |
616 | 616 | 'deprecationReason' => [ |
617 | 617 | 'type' => Type::string(), |
618 | - 'resolve' => static function ($enumValue) { |
|
618 | + 'resolve' => static function($enumValue) { |
|
619 | 619 | return $enumValue->deprecationReason; |
620 | 620 | }, |
621 | 621 | ], |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | |
629 | 629 | public static function _directive() |
630 | 630 | { |
631 | - if (! isset(self::$map['__Directive'])) { |
|
631 | + if (!isset(self::$map['__Directive'])) { |
|
632 | 632 | self::$map['__Directive'] = new ObjectType([ |
633 | 633 | 'name' => '__Directive', |
634 | 634 | 'isIntrospection' => true, |
@@ -641,13 +641,13 @@ discard block |
||
641 | 641 | 'fields' => [ |
642 | 642 | 'name' => [ |
643 | 643 | 'type' => Type::nonNull(Type::string()), |
644 | - 'resolve' => static function ($obj) { |
|
644 | + 'resolve' => static function($obj) { |
|
645 | 645 | return $obj->name; |
646 | 646 | }, |
647 | 647 | ], |
648 | 648 | 'description' => [ |
649 | 649 | 'type' => Type::string(), |
650 | - 'resolve' => static function ($obj) { |
|
650 | + 'resolve' => static function($obj) { |
|
651 | 651 | return $obj->description; |
652 | 652 | }, |
653 | 653 | ], |
@@ -655,13 +655,13 @@ discard block |
||
655 | 655 | 'type' => Type::nonNull(Type::listOf(Type::nonNull( |
656 | 656 | self::_directiveLocation() |
657 | 657 | ))), |
658 | - 'resolve' => static function ($obj) { |
|
658 | + 'resolve' => static function($obj) { |
|
659 | 659 | return $obj->locations; |
660 | 660 | }, |
661 | 661 | ], |
662 | 662 | 'args' => [ |
663 | 663 | 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), |
664 | - 'resolve' => static function (Directive $directive) { |
|
664 | + 'resolve' => static function(Directive $directive) { |
|
665 | 665 | return $directive->args ?: []; |
666 | 666 | }, |
667 | 667 | ], |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | |
675 | 675 | public static function _directiveLocation() |
676 | 676 | { |
677 | - if (! isset(self::$map['__DirectiveLocation'])) { |
|
677 | + if (!isset(self::$map['__DirectiveLocation'])) { |
|
678 | 678 | self::$map['__DirectiveLocation'] = new EnumType([ |
679 | 679 | 'name' => '__DirectiveLocation', |
680 | 680 | 'isIntrospection' => true, |
@@ -768,13 +768,13 @@ discard block |
||
768 | 768 | |
769 | 769 | public static function schemaMetaFieldDef() : FieldDefinition |
770 | 770 | { |
771 | - if (! isset(self::$map[self::SCHEMA_FIELD_NAME])) { |
|
771 | + if (!isset(self::$map[self::SCHEMA_FIELD_NAME])) { |
|
772 | 772 | self::$map[self::SCHEMA_FIELD_NAME] = FieldDefinition::create([ |
773 | 773 | 'name' => self::SCHEMA_FIELD_NAME, |
774 | 774 | 'type' => Type::nonNull(self::_schema()), |
775 | 775 | 'description' => 'Access the current type schema of this server.', |
776 | 776 | 'args' => [], |
777 | - 'resolve' => static function ( |
|
777 | + 'resolve' => static function( |
|
778 | 778 | $source, |
779 | 779 | $args, |
780 | 780 | $context, |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | |
791 | 791 | public static function typeMetaFieldDef() : FieldDefinition |
792 | 792 | { |
793 | - if (! isset(self::$map[self::TYPE_FIELD_NAME])) { |
|
793 | + if (!isset(self::$map[self::TYPE_FIELD_NAME])) { |
|
794 | 794 | self::$map[self::TYPE_FIELD_NAME] = FieldDefinition::create([ |
795 | 795 | 'name' => self::TYPE_FIELD_NAME, |
796 | 796 | 'type' => self::_type(), |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | 'args' => [ |
799 | 799 | ['name' => 'name', 'type' => Type::nonNull(Type::string())], |
800 | 800 | ], |
801 | - 'resolve' => static function ($source, $args, $context, ResolveInfo $info) { |
|
801 | + 'resolve' => static function($source, $args, $context, ResolveInfo $info) { |
|
802 | 802 | return $info->schema->getType($args['name']); |
803 | 803 | }, |
804 | 804 | ]); |
@@ -809,13 +809,13 @@ discard block |
||
809 | 809 | |
810 | 810 | public static function typeNameMetaFieldDef() : FieldDefinition |
811 | 811 | { |
812 | - if (! isset(self::$map[self::TYPE_NAME_FIELD_NAME])) { |
|
812 | + if (!isset(self::$map[self::TYPE_NAME_FIELD_NAME])) { |
|
813 | 813 | self::$map[self::TYPE_NAME_FIELD_NAME] = FieldDefinition::create([ |
814 | 814 | 'name' => self::TYPE_NAME_FIELD_NAME, |
815 | 815 | 'type' => Type::nonNull(Type::string()), |
816 | 816 | 'description' => 'The name of the current Object type at runtime.', |
817 | 817 | 'args' => [], |
818 | - 'resolve' => static function ( |
|
818 | + 'resolve' => static function( |
|
819 | 819 | $source, |
820 | 820 | $args, |
821 | 821 | $context, |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | public function buildSchema() : Schema |
88 | 88 | { |
89 | - if (! array_key_exists('__schema', $this->introspection)) { |
|
89 | + if (!array_key_exists('__schema', $this->introspection)) { |
|
90 | 90 | throw new InvariantViolation('Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' . json_encode($this->introspection) . '.'); |
91 | 91 | } |
92 | 92 | |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->typeMap = Utils::keyValMap( |
96 | 96 | $schemaIntrospection['types'], |
97 | - static function (array $typeIntrospection) { |
|
97 | + static function(array $typeIntrospection) { |
|
98 | 98 | return $typeIntrospection['name']; |
99 | 99 | }, |
100 | - function (array $typeIntrospection) { |
|
100 | + function(array $typeIntrospection) { |
|
101 | 101 | return $this->buildType($typeIntrospection); |
102 | 102 | } |
103 | 103 | ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | Introspection::getTypes() |
108 | 108 | ); |
109 | 109 | foreach ($builtInTypes as $name => $type) { |
110 | - if (! isset($this->typeMap[$name])) { |
|
110 | + if (!isset($this->typeMap[$name])) { |
|
111 | 111 | continue; |
112 | 112 | } |
113 | 113 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | if (isset($typeRef['kind'])) { |
157 | 157 | if ($typeRef['kind'] === TypeKind::LIST) { |
158 | - if (! isset($typeRef['ofType'])) { |
|
158 | + if (!isset($typeRef['ofType'])) { |
|
159 | 159 | throw new InvariantViolation('Decorated type deeper than introspection query.'); |
160 | 160 | } |
161 | 161 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | if ($typeRef['kind'] === TypeKind::NON_NULL) { |
166 | - if (! isset($typeRef['ofType'])) { |
|
166 | + if (!isset($typeRef['ofType'])) { |
|
167 | 167 | throw new InvariantViolation('Decorated type deeper than introspection query.'); |
168 | 168 | } |
169 | 169 | /** @var NullableType $nullableType */ |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - if (! isset($typeRef['name'])) { |
|
176 | + if (!isset($typeRef['name'])) { |
|
177 | 177 | throw new InvariantViolation('Unknown type reference: ' . json_encode($typeRef) . '.'); |
178 | 178 | } |
179 | 179 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | private function getNamedType(string $typeName) : NamedType |
187 | 187 | { |
188 | - if (! isset($this->typeMap[$typeName])) { |
|
188 | + if (!isset($this->typeMap[$typeName])) { |
|
189 | 189 | throw new InvariantViolation( |
190 | 190 | "Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema." |
191 | 191 | ); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | return new CustomScalarType([ |
278 | 278 | 'name' => $scalar['name'], |
279 | 279 | 'description' => $scalar['description'], |
280 | - 'serialize' => static function ($value) : string { |
|
280 | + 'serialize' => static function($value) : string { |
|
281 | 281 | return (string) $value; |
282 | 282 | }, |
283 | 283 | ]); |
@@ -288,21 +288,21 @@ discard block |
||
288 | 288 | */ |
289 | 289 | private function buildObjectDef(array $object) : ObjectType |
290 | 290 | { |
291 | - if (! array_key_exists('interfaces', $object)) { |
|
291 | + if (!array_key_exists('interfaces', $object)) { |
|
292 | 292 | throw new InvariantViolation('Introspection result missing interfaces: ' . json_encode($object) . '.'); |
293 | 293 | } |
294 | 294 | |
295 | 295 | return new ObjectType([ |
296 | 296 | 'name' => $object['name'], |
297 | 297 | 'description' => $object['description'], |
298 | - 'interfaces' => function () use ($object) { |
|
298 | + 'interfaces' => function() use ($object) { |
|
299 | 299 | return array_map( |
300 | 300 | [$this, 'getInterfaceType'], |
301 | 301 | // Legacy support for interfaces with null as interfaces field |
302 | 302 | $object['interfaces'] ?? [] |
303 | 303 | ); |
304 | 304 | }, |
305 | - 'fields' => function () use ($object) { |
|
305 | + 'fields' => function() use ($object) { |
|
306 | 306 | return $this->buildFieldDefMap($object); |
307 | 307 | }, |
308 | 308 | ]); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | return new InterfaceType([ |
317 | 317 | 'name' => $interface['name'], |
318 | 318 | 'description' => $interface['description'], |
319 | - 'fields' => function () use ($interface) { |
|
319 | + 'fields' => function() use ($interface) { |
|
320 | 320 | return $this->buildFieldDefMap($interface); |
321 | 321 | }, |
322 | 322 | ]); |
@@ -327,14 +327,14 @@ discard block |
||
327 | 327 | */ |
328 | 328 | private function buildUnionDef(array $union) : UnionType |
329 | 329 | { |
330 | - if (! array_key_exists('possibleTypes', $union)) { |
|
330 | + if (!array_key_exists('possibleTypes', $union)) { |
|
331 | 331 | throw new InvariantViolation('Introspection result missing possibleTypes: ' . json_encode($union) . '.'); |
332 | 332 | } |
333 | 333 | |
334 | 334 | return new UnionType([ |
335 | 335 | 'name' => $union['name'], |
336 | 336 | 'description' => $union['description'], |
337 | - 'types' => function () use ($union) { |
|
337 | + 'types' => function() use ($union) { |
|
338 | 338 | return array_map( |
339 | 339 | [$this, 'getObjectType'], |
340 | 340 | $union['possibleTypes'] |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | private function buildEnumDef(array $enum) : EnumType |
350 | 350 | { |
351 | - if (! array_key_exists('enumValues', $enum)) { |
|
351 | + if (!array_key_exists('enumValues', $enum)) { |
|
352 | 352 | throw new InvariantViolation('Introspection result missing enumValues: ' . json_encode($enum) . '.'); |
353 | 353 | } |
354 | 354 | |
@@ -357,10 +357,10 @@ discard block |
||
357 | 357 | 'description' => $enum['description'], |
358 | 358 | 'values' => Utils::keyValMap( |
359 | 359 | $enum['enumValues'], |
360 | - static function (array $enumValue) : string { |
|
360 | + static function(array $enumValue) : string { |
|
361 | 361 | return $enumValue['name']; |
362 | 362 | }, |
363 | - static function (array $enumValue) { |
|
363 | + static function(array $enumValue) { |
|
364 | 364 | return [ |
365 | 365 | 'description' => $enumValue['description'], |
366 | 366 | 'deprecationReason' => $enumValue['deprecationReason'], |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | */ |
376 | 376 | private function buildInputObjectDef(array $inputObject) : InputObjectType |
377 | 377 | { |
378 | - if (! array_key_exists('inputFields', $inputObject)) { |
|
378 | + if (!array_key_exists('inputFields', $inputObject)) { |
|
379 | 379 | throw new InvariantViolation('Introspection result missing inputFields: ' . json_encode($inputObject) . '.'); |
380 | 380 | } |
381 | 381 | |
382 | 382 | return new InputObjectType([ |
383 | 383 | 'name' => $inputObject['name'], |
384 | 384 | 'description' => $inputObject['description'], |
385 | - 'fields' => function () use ($inputObject) { |
|
385 | + 'fields' => function() use ($inputObject) { |
|
386 | 386 | return $this->buildInputValueDefMap($inputObject['inputFields']); |
387 | 387 | }, |
388 | 388 | ]); |
@@ -393,17 +393,17 @@ discard block |
||
393 | 393 | */ |
394 | 394 | private function buildFieldDefMap(array $typeIntrospection) |
395 | 395 | { |
396 | - if (! array_key_exists('fields', $typeIntrospection)) { |
|
396 | + if (!array_key_exists('fields', $typeIntrospection)) { |
|
397 | 397 | throw new InvariantViolation('Introspection result missing fields: ' . json_encode($typeIntrospection) . '.'); |
398 | 398 | } |
399 | 399 | |
400 | 400 | return Utils::keyValMap( |
401 | 401 | $typeIntrospection['fields'], |
402 | - static function (array $fieldIntrospection) : string { |
|
402 | + static function(array $fieldIntrospection) : string { |
|
403 | 403 | return $fieldIntrospection['name']; |
404 | 404 | }, |
405 | - function (array $fieldIntrospection) { |
|
406 | - if (! array_key_exists('args', $fieldIntrospection)) { |
|
405 | + function(array $fieldIntrospection) { |
|
406 | + if (!array_key_exists('args', $fieldIntrospection)) { |
|
407 | 407 | throw new InvariantViolation('Introspection result missing field args: ' . json_encode($fieldIntrospection) . '.'); |
408 | 408 | } |
409 | 409 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | { |
427 | 427 | return Utils::keyValMap( |
428 | 428 | $inputValueIntrospections, |
429 | - static function (array $inputValue) : string { |
|
429 | + static function(array $inputValue) : string { |
|
430 | 430 | return $inputValue['name']; |
431 | 431 | }, |
432 | 432 | [$this, 'buildInputValue'] |
@@ -462,10 +462,10 @@ discard block |
||
462 | 462 | */ |
463 | 463 | public function buildDirective(array $directive) : Directive |
464 | 464 | { |
465 | - if (! array_key_exists('args', $directive)) { |
|
465 | + if (!array_key_exists('args', $directive)) { |
|
466 | 466 | throw new InvariantViolation('Introspection result missing directive args: ' . json_encode($directive) . '.'); |
467 | 467 | } |
468 | - if (! array_key_exists('locations', $directive)) { |
|
468 | + if (!array_key_exists('locations', $directive)) { |
|
469 | 469 | throw new InvariantViolation('Introspection result missing directive locations: ' . json_encode($directive) . '.'); |
470 | 470 | } |
471 | 471 |