Passed
Pull Request — master (#69)
by Christoffer
02:03
created
src/Util/orList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
  */
26 26
 function quotedOrList(array $items): string
27 27
 {
28
-    return orList(array_map(function ($item) {
28
+    return orList(array_map(function($item) {
29 29
         return '"' . $item . '"';
30 30
     }, $items));
31 31
 }
Please login to merge, or discard this patch.
src/Util/suggestionList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     $result = array_keys($optionsByDistance);
26 26
 
27
-    usort($result, function ($a, $b) use ($optionsByDistance) {
27
+    usort($result, function($a, $b) use ($optionsByDistance) {
28 28
         return $optionsByDistance[$a] - $optionsByDistance[$b];
29 29
     });
30 30
 
Please login to merge, or discard this patch.
src/Provider/SchemaBuilderProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         $this->container->add(DefinitionBuilderInterface::class, DefinitionBuilder::class, true/* $shared */)
31 31
             ->withArguments([
32
-                function (NamedTypeNode $node) {
32
+                function(NamedTypeNode $node) {
33 33
                     throw new InvalidTypeException(sprintf('Type "%s" not found in document.', $node->getNameValue()));
34 34
                 },
35 35
                 CacheInterface::class,
Please login to merge, or discard this patch.
src/Language/Parser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
          * @return mixed
435 435
          * @throws SyntaxErrorException
436 436
          */
437
-        $parseType = function (LexerInterface $lexer) {
437
+        $parseType = function(LexerInterface $lexer) {
438 438
             $this->expect($lexer, TokenKindEnum::COLON);
439 439
             return $this->parseTypeReference($lexer);
440 440
         };
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
          * @return mixed
565 565
          * @throws SyntaxErrorException
566 566
          */
567
-        $parseValue = function (LexerInterface $lexer) {
567
+        $parseValue = function(LexerInterface $lexer) {
568 568
             $this->expect($lexer, TokenKindEnum::COLON);
569 569
             return $this->parseValueLiteral($lexer, false);
570 570
         };
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
          * @return mixed
592 592
          * @throws SyntaxErrorException
593 593
          */
594
-        $parseValue = function (LexerInterface $lexer) {
594
+        $parseValue = function(LexerInterface $lexer) {
595 595
             $this->expect($lexer, TokenKindEnum::COLON);
596 596
             return $this->parseConstValue($lexer);
597 597
         };
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 
653 653
         $this->expectKeyword($lexer, KeywordEnum::FRAGMENT);
654 654
 
655
-        $parseTypeCondition = function (LexerInterface $lexer) {
655
+        $parseTypeCondition = function(LexerInterface $lexer) {
656 656
             $this->expectKeyword($lexer, 'on');
657 657
             return $this->parseNamedType($lexer);
658 658
         };
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
     {
849 849
         $start = $lexer->getToken();
850 850
 
851
-        $parseValue = function (LexerInterface $lexer, bool $isConst) {
851
+        $parseValue = function(LexerInterface $lexer, bool $isConst) {
852 852
             $this->expect($lexer, TokenKindEnum::COLON);
853 853
             return $this->parseValueLiteral($lexer, $isConst);
854 854
         };
Please login to merge, or discard this patch.
src/Error/GraphQLException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function getLocationsAsArray(): ?array
152 152
     {
153
-        return !empty($this->locations) ? array_map(function (SourceLocation $location) {
153
+        return !empty($this->locations) ? array_map(function(SourceLocation $location) {
154 154
             return $location->toArray();
155 155
         }, $this->locations) : null;
156 156
     }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     protected function resolvePositions(?array $positions)
209 209
     {
210 210
         if (null === $positions && !empty($this->nodes)) {
211
-            $positions = array_reduce($this->nodes, function (array $list, NodeInterface $node) {
211
+            $positions = array_reduce($this->nodes, function(array $list, NodeInterface $node) {
212 212
                 $location = $node->getLocation();
213 213
                 if (null !== $location) {
214 214
                     $list[] = $location->getStart();
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
     protected function resolveLocations(?array $positions, ?Source $source)
235 235
     {
236 236
         if (null !== $positions && null !== $source) {
237
-            $locations = array_map(function ($position) use ($source) {
237
+            $locations = array_map(function($position) use ($source) {
238 238
                 return SourceLocation::fromSource($source, $position);
239 239
             }, $positions);
240 240
         } elseif (!empty($this->nodes)) {
241
-            $locations = array_reduce($this->nodes, function (array $list, NodeInterface $node) {
241
+            $locations = array_reduce($this->nodes, function(array $list, NodeInterface $node) {
242 242
                 $location = $node->getLocation();
243 243
                 if (null !== $location) {
244 244
                     $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart());
Please login to merge, or discard this patch.
src/Error/printError.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $line < \count($lines) ? leftPad($padLen, $nextLineNum) . ': ' . $lines[$line] : null,
63 63
     ];
64 64
 
65
-    return implode("\n", array_filter($outputLines, function ($line) {
65
+    return implode("\n", array_filter($outputLines, function($line) {
66 66
         return null !== $line;
67 67
     }));
68 68
 }
Please login to merge, or discard this patch.
src/Language/SourceLocation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         preg_match_all("/\r\n|[\n\r]/", mb_substr($source->getBody(), 0, $position), $matches, PREG_OFFSET_CAPTURE);
60 60
 
61 61
         foreach ($matches[0] as $index => $match) {
62
-            $line   += 1;
62
+            $line += 1;
63 63
             $column = $position + 1 - ($match[1] + mb_strlen($match[0]));
64 64
         }
65 65
 
Please login to merge, or discard this patch.
src/Validation/ValidationContext.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     public function getFragment(string $name): ?FragmentDefinitionNode
144 144
     {
145 145
         if (empty($this->fragments)) {
146
-            $this->fragments = array_reduce($this->document->getDefinitions(), function ($fragments, $definition) {
146
+            $this->fragments = array_reduce($this->document->getDefinitions(), function($fragments, $definition) {
147 147
                 if ($definition instanceof FragmentDefinitionNode) {
148 148
                     $fragments[$definition->getNameValue()] = $definition;
149 149
                 }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $usages   = [];
222 222
             $typeInfo = new TypeInfo($this->schema);
223 223
             $visitor  = new TypeInfoVisitor($typeInfo, new Visitor(
224
-                function (NodeInterface $node) use (&$usages, $typeInfo): ?NodeInterface {
224
+                function(NodeInterface $node) use (&$usages, $typeInfo): ?NodeInterface {
225 225
                     if ($node instanceof VariableDefinitionNode) {
226 226
                         return null;
227 227
                     }
Please login to merge, or discard this patch.
src/Util/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 function arrayEvery(array $array, callable $fn): bool
11 11
 {
12
-    return array_reduce($array, function ($result, $value) use ($fn) {
12
+    return array_reduce($array, function($result, $value) use ($fn) {
13 13
         return $result && $fn($value);
14 14
     }, true);
15 15
 }
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function arraySome(array $array, callable $fn)
23 23
 {
24
-    return array_reduce($array, function ($result, $value) use ($fn) {
24
+    return array_reduce($array, function($result, $value) use ($fn) {
25 25
         return $result || $fn($value);
26 26
     });
27 27
 }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function keyMap(array $array, callable $keyFn): array
51 51
 {
52
-    return array_reduce($array, function ($map, $item) use ($keyFn) {
52
+    return array_reduce($array, function($map, $item) use ($keyFn) {
53 53
         $map[$keyFn($item)] = $item;
54 54
         return $map;
55 55
     }, []);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  */
64 64
 function keyValMap(array $array, callable $keyFn, callable $valFn): array
65 65
 {
66
-    return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) {
66
+    return array_reduce($array, function($map, $item) use ($keyFn, $valFn) {
67 67
         $map[$keyFn($item)] = $valFn($item);
68 68
         return $map;
69 69
     }, []);
Please login to merge, or discard this patch.