Passed
Pull Request — master (#190)
by Sebastian
03:03
created
src/Validation/Rule/FieldOnCorrectTypeRule.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
                 $schema = $this->context->getSchema();
41 41
                 $fieldName = $node->getNameValue();
42 42
                 $suggestedTypeNames = $this->getSuggestedTypeNames($schema,
43
-                  $type, $fieldName);
43
+                    $type, $fieldName);
44 44
                 $suggestedFieldNames = \count($suggestedTypeNames) !== 0
45 45
                   ? []
46 46
                   : $this->getSuggestedFieldNames($type, $fieldName);
47 47
 
48 48
                 $this->context->reportError(
49
-                  new ValidationException(
49
+                    new ValidationException(
50 50
                     undefinedFieldMessage(
51
-                      $fieldName,
52
-                      (string)$type,
53
-                      $suggestedTypeNames,
54
-                      $suggestedFieldNames
51
+                        $fieldName,
52
+                        (string)$type,
53
+                        $suggestedTypeNames,
54
+                        $suggestedFieldNames
55 55
                     ),
56 56
                     [$node]
57
-                  )
57
+                    )
58 58
                 );
59 59
             }
60 60
         }
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
      * @return array
76 76
      */
77 77
     protected function getSuggestedTypeNames(
78
-      SchemaInterface $schema,
79
-      TypeInterface $type,
80
-      string $fieldName
78
+        SchemaInterface $schema,
79
+        TypeInterface $type,
80
+        string $fieldName
81 81
     ): array {
82 82
         if (!$type instanceof AbstractTypeInterface) {
83 83
             // Otherwise, must be an Object type, which does not have possible fields.
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         $suggestedInterfaceTypes = \array_keys($interfaceUsageCount);
112 112
 
113 113
         \uasort($suggestedInterfaceTypes,
114
-          function ($a, $b) use ($interfaceUsageCount) {
115
-              return $interfaceUsageCount[$b] - $interfaceUsageCount[$a];
116
-          });
114
+            function ($a, $b) use ($interfaceUsageCount) {
115
+                return $interfaceUsageCount[$b] - $interfaceUsageCount[$a];
116
+            });
117 117
 
118 118
         return \array_merge($suggestedInterfaceTypes, $suggestedObjectTypes);
119 119
     }
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
      * @throws \Exception
130 130
      */
131 131
     protected function getSuggestedFieldNames(
132
-      OutputTypeInterface $type,
133
-      string $fieldName
132
+        OutputTypeInterface $type,
133
+        string $fieldName
134 134
     ): array {
135 135
         if (!($type instanceof ObjectType || $type instanceof InterfaceType)) {
136 136
             // Otherwise, must be a Union type, which does not define fields.
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
         $suggestedInterfaceTypes = \array_keys($interfaceUsageCount);
112 112
 
113 113
         \uasort($suggestedInterfaceTypes,
114
-          function ($a, $b) use ($interfaceUsageCount) {
114
+          function($a, $b) use ($interfaceUsageCount) {
115 115
               return $interfaceUsageCount[$b] - $interfaceUsageCount[$a];
116 116
           });
117 117
 
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueDirectivesPerLocationRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 
31 31
                 if (isset($knownDirectives[$directiveName])) {
32 32
                     $this->context->reportError(
33
-                      new ValidationException(
33
+                        new ValidationException(
34 34
                         duplicateDirectiveMessage($directiveName),
35 35
                         [$knownDirectives[$directiveName], $directive]
36
-                      )
36
+                        )
37 37
                     );
38 38
                 } else {
39 39
                     $knownDirectives[$directiveName] = $directive;
Please login to merge, or discard this patch.
src/Validation/Rule/ScalarLeafsRule.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,19 +31,19 @@
 block discarded – undo
31 31
             if (getNamedType($type) instanceof LeafTypeInterface) {
32 32
                 if (null !== $selectionSet) {
33 33
                     $this->context->reportError(
34
-                      new ValidationException(
34
+                        new ValidationException(
35 35
                         noSubselectionAllowedMessage((string)$node,
36
-                          (string)$type),
36
+                            (string)$type),
37 37
                         [$selectionSet]
38
-                      )
38
+                        )
39 39
                     );
40 40
                 }
41 41
             } elseif (null === $selectionSet) {
42 42
                 $this->context->reportError(
43
-                  new ValidationException(
43
+                    new ValidationException(
44 44
                     requiresSubselectionMessage((string)$node, (string)$type),
45 45
                     [$node]
46
-                  )
46
+                    )
47 47
                 );
48 48
             }
49 49
         }
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueVariableNamesRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@
 block discarded – undo
43 43
 
44 44
         if (isset($this->knownVariableNames[$variableName])) {
45 45
             $this->context->reportError(
46
-              new ValidationException(
46
+                new ValidationException(
47 47
                 duplicateVariableMessage($variableName),
48 48
                 [$this->knownVariableNames[$variableName], $variable->getName()]
49
-              )
49
+                )
50 50
             );
51 51
         } else {
52 52
             $this->knownVariableNames[$variableName] = $variable->getName();
Please login to merge, or discard this patch.
src/Validation/Rule/KnownFragmentNamesRule.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
         if (null === $fragment) {
29 29
             $this->context->reportError(
30
-              new ValidationException(unknownFragmentMessage($fragmentName),
30
+                new ValidationException(unknownFragmentMessage($fragmentName),
31 31
                 [$node->getName()])
32 32
             );
33 33
         }
Please login to merge, or discard this patch.
src/Validation/Rule/NoUndefinedVariablesRule.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     ): ?NodeInterface
42 42
     {
43 43
         $this->definedVariableNames[$node->getVariable()
44
-          ->getNameValue()] = true;
44
+            ->getNameValue()] = true;
45 45
 
46 46
         return $node;
47 47
     }
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
             if (!isset($this->definedVariableNames[$variableName])) {
62 62
                 $operationName = $node->getName();
63 63
                 $this->context->reportError(
64
-                  new ValidationException(
64
+                    new ValidationException(
65 65
                     undefinedVariableMessage($variableName,
66
-                      $operationName ? $operationName->getValue() : null),
66
+                        $operationName ? $operationName->getValue() : null),
67 67
                     [$variableNode, $node]
68
-                  )
68
+                    )
69 69
                 );
70 70
             }
71 71
         }
Please login to merge, or discard this patch.
src/Validation/Rule/KnownArgumentNamesRule.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
             $suggestions = suggestionList($node->getNameValue(), $options);
63 63
 
64 64
             $this->context->reportError(
65
-              new ValidationException(
65
+                new ValidationException(
66 66
                 unknownArgumentMessage((string)$node, (string)$fieldDefinition,
67
-                  (string)$parentType, $suggestions),
67
+                    (string)$parentType, $suggestions),
68 68
                 [$node]
69
-              )
69
+                )
70 70
             );
71 71
         }
72 72
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
             $suggestions = suggestionList((string)$node, $options);
91 91
 
92 92
             $this->context->reportError(
93
-              new ValidationException(
93
+                new ValidationException(
94 94
                 unknownDirectiveArgumentMessage((string)$node,
95
-                  (string)$directive, $suggestions),
95
+                    (string)$directive, $suggestions),
96 96
                 [$node]
97
-              )
97
+                )
98 98
             );
99 99
         }
100 100
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $parentType = $this->context->getParentType();
55 55
 
56 56
         if (null !== $fieldDefinition && null !== $parentType) {
57
-            $options = array_map(function (Argument $argument) {
57
+            $options = array_map(function(Argument $argument) {
58 58
                 return $argument->getName();
59 59
             }, $fieldDefinition->getArguments());
60 60
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $directive = $this->context->getDirective();
84 84
 
85 85
         if (null !== $directive) {
86
-            $options = array_map(function (Argument $argument) {
86
+            $options = array_map(function(Argument $argument) {
87 87
                 return $argument->getName();
88 88
             }, $directive->getArguments());
89 89
 
Please login to merge, or discard this patch.
src/Validation/Rule/NoFragmentCyclesRule.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -104,13 +104,13 @@
 block discarded – undo
104 104
                 $cyclePath = \array_slice($this->spreadPath, $cycleIndex);
105 105
 
106 106
                 $this->context->reportError(
107
-                  new ValidationException(
107
+                    new ValidationException(
108 108
                     fragmentCycleMessage($spreadName,
109
-                      \array_map(function (FragmentSpreadNode $spread) {
110
-                          return $spread->getNameValue();
111
-                      }, $cyclePath)),
109
+                        \array_map(function (FragmentSpreadNode $spread) {
110
+                            return $spread->getNameValue();
111
+                        }, $cyclePath)),
112 112
                     \array_merge($cyclePath, [$spreadNode])
113
-                  )
113
+                    )
114 114
                 );
115 115
             }
116 116
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
                 $this->context->reportError(
107 107
                   new ValidationException(
108 108
                     fragmentCycleMessage($spreadName,
109
-                      \array_map(function (FragmentSpreadNode $spread) {
109
+                      \array_map(function(FragmentSpreadNode $spread) {
110 110
                           return $spread->getNameValue();
111 111
                       }, $cyclePath)),
112 112
                     \array_merge($cyclePath, [$spreadNode])
Please login to merge, or discard this patch.
src/Validation/Rule/OverlappingFieldsCanBeMergedRule.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@
 block discarded – undo
47 47
     {
48 48
         $parentType = $this->context->getParentType();
49 49
         $conflicts = $this->findConflictsWithinSelectionSet(
50
-          $this->cachedFieldsAndFragmentNames,
51
-          $this->comparedFragmentPairs,
52
-          $node,
53
-          $parentType
50
+            $this->cachedFieldsAndFragmentNames,
51
+            $this->comparedFragmentPairs,
52
+            $node,
53
+            $parentType
54 54
         );
55 55
 
56 56
         foreach ($conflicts as $conflict) {
57 57
             $this->context->reportError(
58
-              new ValidationException(
58
+                new ValidationException(
59 59
                 fieldsConflictMessage($conflict->getResponseName(),
60
-                  $conflict->getReason()),
60
+                    $conflict->getReason()),
61 61
                 $conflict->getAllFields()
62
-              )
62
+                )
63 63
             );
64 64
         }
65 65
 
Please login to merge, or discard this patch.