Passed
Pull Request — master (#190)
by Sebastian
03:03
created
src/Validation/Rule/ExecutableDefinitionsRule.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
             if (!$definition instanceof ExecutableDefinitionNodeInterface) {
28 28
                 /** @noinspection PhpUndefinedMethodInspection */
29 29
                 $this->context->reportError(
30
-                  new ValidationException(
30
+                    new ValidationException(
31 31
                     nonExecutableDefinitionMessage(
32
-                      $definition instanceof SchemaDefinitionNode ? 'schema' : $definition->getNameValue()
32
+                        $definition instanceof SchemaDefinitionNode ? 'schema' : $definition->getNameValue()
33 33
                     ),
34 34
                     [$definition]
35
-                  )
35
+                    )
36 36
                 );
37 37
             }
38 38
         }
Please login to merge, or discard this patch.
src/Validation/Rule/KnownTypeNamesRule.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 
33 33
         if (null === $type) {
34 34
             $this->context->reportError(
35
-              new ValidationException(
35
+                new ValidationException(
36 36
                 unknownTypeMessage($typeName, suggestionList($typeName,
37
-                  \array_keys($schema->getTypeMap()))),
37
+                    \array_keys($schema->getTypeMap()))),
38 38
                 [$node]
39
-              )
39
+                )
40 40
             );
41 41
         }
42 42
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @inheritdoc
59 59
      */
60 60
     protected function enterInterfaceTypeDefinition(
61
-      InterfaceTypeDefinitionNode $node
61
+        InterfaceTypeDefinitionNode $node
62 62
     ): ?NodeInterface
63 63
     {
64 64
         return null;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @inheritdoc
78 78
      */
79 79
     protected function enterInputObjectTypeDefinition(
80
-      InputObjectTypeDefinitionNode $node
80
+        InputObjectTypeDefinitionNode $node
81 81
     ): ?NodeInterface
82 82
     {
83 83
         return null;
Please login to merge, or discard this patch.
src/Validation/Rule/VariablesDefaultValueAllowedRule.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@
 block discarded – undo
49 49
 
50 50
         if (null !== $defaultValue && $type instanceof NonNullType) {
51 51
             $this->context->reportError(
52
-              new ValidationException(
52
+                new ValidationException(
53 53
                 variableDefaultValueNotAllowedMessage($variableName, $type,
54
-                  $type->getOfType()),
54
+                    $type->getOfType()),
55 55
                 [$defaultValue]
56
-              )
56
+                )
57 57
             );
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueInputFieldNamesRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@
 block discarded – undo
44 44
 
45 45
         if (isset($this->knownInputNames[$fieldName])) {
46 46
             $this->context->reportError(
47
-              new ValidationException(
47
+                new ValidationException(
48 48
                 duplicateInputFieldMessage($fieldName),
49 49
                 [$this->knownInputNames[$fieldName], $node->getName()]
50
-              )
50
+                )
51 51
             );
52 52
         } else {
53 53
             $this->knownInputNames[$fieldName] = $node->getName();
Please login to merge, or discard this patch.
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.