Completed
Pull Request — master (#270)
by Christoffer
04:04
created
src/Error/GraphQLException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function getLocationsAsArray(): ?array
154 154
     {
155
-        return !empty($this->locations) ? \array_map(function (SourceLocation $location) {
155
+        return !empty($this->locations) ? \array_map(function(SourceLocation $location) {
156 156
             return $location->toArray();
157 157
         }, $this->locations) : null;
158 158
     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             $nodes = [$nodes];
194 194
         }
195 195
 
196
-        $this->nodes = \array_filter($nodes, function ($node) {
196
+        $this->nodes = \array_filter($nodes, function($node) {
197 197
             return null !== $node;
198 198
         });
199 199
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     protected function resolvePositions(?array $positions)
225 225
     {
226 226
         if (null === $positions && !empty($this->nodes)) {
227
-            $positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) {
227
+            $positions = \array_reduce($this->nodes, function(array $list, ?NodeInterface $node) {
228 228
                 if (null !== $node) {
229 229
                     $location = $node->getLocation();
230 230
                     if (null !== $location) {
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
     protected function resolveLocations(?array $positions, ?Source $source)
253 253
     {
254 254
         if (null !== $positions && null !== $source) {
255
-            $locations = \array_map(function ($position) use ($source) {
255
+            $locations = \array_map(function($position) use ($source) {
256 256
                 return SourceLocation::fromSource($source, $position);
257 257
             }, $positions);
258 258
         } elseif (!empty($this->nodes)) {
259
-            $locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) {
259
+            $locations = \array_reduce($this->nodes, function(array $list, NodeInterface $node) {
260 260
                 $location = $node->getLocation();
261 261
                 if (null !== $location) {
262 262
                     $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart());
Please login to merge, or discard this patch.
src/Schema/DefinitionBuilder.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function buildTypes(array $nodes): array
110 110
     {
111
-        return \array_map(function (NameAwareInterface $node) {
111
+        return \array_map(function(NameAwareInterface $node) {
112 112
             return $this->buildType($node);
113 113
         }, $nodes);
114 114
     }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $directive = newDirective([
156 156
             'name'        => $node->getNameValue(),
157 157
             'description' => $node->getDescriptionValue(),
158
-            'locations'   => \array_map(function (NameNode $node) {
158
+            'locations'   => \array_map(function(NameNode $node) {
159 159
                 return $node->getValue();
160 160
             }, $node->getLocations()),
161 161
             'args'        => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [],
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $typesMap = keyMap(
224 224
             \array_merge($customTypes, specifiedScalarTypes(), introspectionTypes()),
225
-            function (NamedTypeInterface $type) {
225
+            function(NamedTypeInterface $type) {
226 226
                 return $type->getName();
227 227
             }
228 228
         );
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     {
240 240
         $directivesMap = keyMap(
241 241
             \array_merge($customDirectives, specifiedDirectives()),
242
-            function (Directive $directive) {
242
+            function(Directive $directive) {
243 243
                 return $directive->getName();
244 244
             }
245 245
         );
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
     {
259 259
         return keyValueMap(
260 260
             $nodes,
261
-            function (InputValueDefinitionNode $value) {
261
+            function(InputValueDefinitionNode $value) {
262 262
                 return $value->getNameValue();
263 263
             },
264
-            function (InputValueDefinitionNode $value): array {
264
+            function(InputValueDefinitionNode $value): array {
265 265
                 $type         = $this->buildWrappedType($value->getType());
266 266
                 $defaultValue = $value->getDefaultValue();
267 267
                 return [
@@ -314,14 +314,14 @@  discard block
 block discarded – undo
314 314
         return newObjectType([
315 315
             'name'        => $node->getNameValue(),
316 316
             'description' => $node->getDescriptionValue(),
317
-            'fields'      => $node->hasFields() ? function () use ($node) {
317
+            'fields'      => $node->hasFields() ? function() use ($node) {
318 318
                 return $this->buildFields($node);
319 319
             } : [],
320 320
             // Note: While this could make early assertions to get the correctly
321 321
             // typed values, that would throw immediately while type system
322 322
             // validation with validateSchema() will produce more actionable results.
323
-            'interfaces'  => function () use ($node) {
324
-                return $node->hasInterfaces() ? \array_map(function (NameAwareInterface $interface) {
323
+            'interfaces'  => function() use ($node) {
324
+                return $node->hasInterfaces() ? \array_map(function(NameAwareInterface $interface) {
325 325
                     return $this->buildType($interface);
326 326
                 }, $node->getInterfaces()) : [];
327 327
             },
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
     {
338 338
         return keyValueMap(
339 339
             $node->getFields(),
340
-            function ($value) {
340
+            function($value) {
341 341
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
342 342
                 return $value->getNameValue();
343 343
             },
344
-            function ($value) use ($node) {
344
+            function($value) use ($node) {
345 345
                 /** @var FieldDefinitionNode|InputValueDefinitionNode $value */
346 346
                 return $this->buildField($value,
347 347
                     $this->getFieldResolver($node->getNameValue(), $value->getNameValue()));
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         return newInterfaceType([
372 372
             'name'        => $node->getNameValue(),
373 373
             'description' => $node->getDescriptionValue(),
374
-            'fields'      => $node->hasFields() ? function () use ($node): array {
374
+            'fields'      => $node->hasFields() ? function() use ($node) : array {
375 375
                 return $this->buildFields($node);
376 376
             } : [],
377 377
             'resolveType' => $this->getTypeResolver($node->getNameValue()),
@@ -391,10 +391,10 @@  discard block
 block discarded – undo
391 391
             'description' => $node->getDescriptionValue(),
392 392
             'values'      => $node->hasValues() ? keyValueMap(
393 393
                 $node->getValues(),
394
-                function (EnumValueDefinitionNode $value): ?string {
394
+                function(EnumValueDefinitionNode $value): ?string {
395 395
                     return $value->getNameValue();
396 396
                 },
397
-                function (EnumValueDefinitionNode $value): array {
397
+                function(EnumValueDefinitionNode $value): array {
398 398
                     return [
399 399
                         'description'       => $value->getDescriptionValue(),
400 400
                         'deprecationReason' => $this->getDeprecationReason($value),
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         return newUnionType([
417 417
             'name'        => $node->getNameValue(),
418 418
             'description' => $node->getDescriptionValue(),
419
-            'types'       => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) {
419
+            'types'       => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) {
420 420
                 return $this->buildType($type);
421 421
             }, $node->getTypes()) : [],
422 422
             'resolveType' => $this->getTypeResolver($node->getNameValue()),
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         return newScalarType([
446 446
             'name'        => $node->getNameValue(),
447 447
             'description' => $node->getDescriptionValue(),
448
-            'serialize'   => function ($value) {
448
+            'serialize'   => function($value) {
449 449
                 return $value;
450 450
             },
451 451
             'astNode'     => $node,
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
         return newInputObjectType([
463 463
             'name'        => $node->getNameValue(),
464 464
             'description' => $node->getDescriptionValue(),
465
-            'fields'      => $node->hasFields() ? function () use ($node) {
465
+            'fields'      => $node->hasFields() ? function() use ($node) {
466 466
                 return keyValueMap(
467 467
                     $node->getFields(),
468
-                    function (InputValueDefinitionNode $value): ?string {
468
+                    function(InputValueDefinitionNode $value): ?string {
469 469
                         return $value->getNameValue();
470 470
                     },
471
-                    function (InputValueDefinitionNode $value): array {
471
+                    function(InputValueDefinitionNode $value): array {
472 472
                         $type         = $this->buildWrappedType($value->getType());
473 473
                         $defaultValue = $value->getDefaultValue();
474 474
                         return [
Please login to merge, or discard this patch.