Passed
Pull Request — master (#190)
by Sebastian
03:03
created
src/Validation/Rule/NoUnusedVariablesRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,10 +66,10 @@
 block discarded – undo
66 66
 
67 67
             if (!isset($variableNamesUsed[$variableName])) {
68 68
                 $this->context->reportError(
69
-                  new ValidationException(
69
+                    new ValidationException(
70 70
                     unusedVariableMessage($variableName, $operationName),
71 71
                     [$variableDefinition]
72
-                  )
72
+                    )
73 73
                 );
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
src/Validation/Rule/VariablesInAllowedPositionRule.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,18 +63,18 @@  discard block
 block discarded – undo
63 63
                 // than the expected item type (contravariant).
64 64
                 $schema = $this->context->getSchema();
65 65
                 $variableType = typeFromAST($schema,
66
-                  $variableDefinition->getType());
66
+                    $variableDefinition->getType());
67 67
 
68 68
                 if (null !== $variableType &&
69 69
                   !isTypeSubTypeOf($schema,
70 70
                     $this->getEffectiveType($variableType, $variableDefinition),
71 71
                     $type)) {
72 72
                     $this->context->reportError(
73
-                      new ValidationException(
73
+                        new ValidationException(
74 74
                         badVariablePositionMessage($variableName, $variableType,
75
-                          $type),
75
+                            $type),
76 76
                         [$variableDefinition, $variableNode]
77
-                      )
77
+                        )
78 78
                     );
79 79
                 }
80 80
             }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     ): ?NodeInterface
91 91
     {
92 92
         $this->variableDefinitionMap[$node->getVariable()
93
-          ->getNameValue()] = $node;
93
+            ->getNameValue()] = $node;
94 94
 
95 95
         return $node;
96 96
     }
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
      * @throws InvalidTypeException
106 106
      */
107 107
     protected function getEffectiveType(
108
-      TypeInterface $variableType,
109
-      VariableDefinitionNode $variableDefinition
108
+        TypeInterface $variableType,
109
+        VariableDefinitionNode $variableDefinition
110 110
     ): TypeInterface {
111 111
         return (!$variableDefinition->hasDefaultValue() || $variableType instanceof NonNullType)
112 112
           ? $variableType
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueArgumentNamesRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@
 block discarded – undo
52 52
 
53 53
         if (isset($this->knownArgumentNames[$argumentName])) {
54 54
             $this->context->reportError(
55
-              new ValidationException(
55
+                new ValidationException(
56 56
                 duplicateArgumentMessage($argumentName),
57 57
                 [$this->knownArgumentNames[$argumentName], $node->getName()]
58
-              )
58
+                )
59 59
             );
60 60
         } else {
61 61
             $this->knownArgumentNames[$argumentName] = $node->getName();
Please login to merge, or discard this patch.
src/Validation/Rule/VariablesAreInputTypesRule.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@
 block discarded – undo
31 31
             $variableName = $node->getVariable()->getNameValue();
32 32
 
33 33
             $this->context->reportError(
34
-              new ValidationException(
34
+                new ValidationException(
35 35
                 nonInputTypeOnVariableMessage($variableName,
36
-                  printNode($node->getType())),
36
+                    printNode($node->getType())),
37 37
                 [$node->getType()]
38
-              )
38
+                )
39 39
             );
40 40
         }
41 41
 
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueOperationNamesRule.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
         if (null !== $operationName) {
32 32
             if (isset($this->knownOperationNames[$operationName])) {
33 33
                 $this->context->reportError(
34
-                  new ValidationException(
34
+                    new ValidationException(
35 35
                     duplicateOperationMessage($operationName),
36 36
                     [
37
-                      $this->knownOperationNames[$operationName],
38
-                      $node->getName(),
37
+                        $this->knownOperationNames[$operationName],
38
+                        $node->getName(),
39 39
                     ]
40
-                  )
40
+                    )
41 41
                 );
42 42
             } else {
43 43
                 $this->knownOperationNames[$operationName] = $node->getName();
Please login to merge, or discard this patch.
src/Validation/Rule/UniqueFragmentNamesRule.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 
41 41
         if (isset($this->knownFragmentNames[$fragmentName])) {
42 42
             $this->context->reportError(
43
-              new ValidationException(
43
+                new ValidationException(
44 44
                 duplicateFragmentMessage($fragmentName),
45 45
                 [$this->knownFragmentNames[$fragmentName], $node->getName()]
46
-              )
46
+                )
47 47
             );
48 48
         } else {
49 49
             $this->knownFragmentNames[$fragmentName] = $node->getName();
Please login to merge, or discard this patch.
src/Validation/Rule/ProvidedNonNullArgumentsRule.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 
37 37
         $argumentNodes = $node->getArguments();
38 38
         $argumentNodeMap = keyMap($argumentNodes,
39
-          function (ArgumentNode $argument) {
40
-              return $argument->getNameValue();
41
-          });
39
+            function (ArgumentNode $argument) {
40
+                return $argument->getNameValue();
41
+            });
42 42
 
43 43
         foreach ($fieldDefinition->getArguments() as $argumentDefinition) {
44 44
             $argumentNode = $argumentNodeMap[$argumentDefinition->getName()] ?? null;
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
             if (null === $argumentNode && $argumentType instanceof NonNullType) {
48 48
                 $this->context->reportError(
49
-                  new ValidationException(
49
+                    new ValidationException(
50 50
                     missingFieldArgumentMessage(
51
-                      (string)$node,
52
-                      (string)$argumentDefinition,
53
-                      (string)$argumentType
51
+                        (string)$node,
52
+                        (string)$argumentDefinition,
53
+                        (string)$argumentType
54 54
                     ),
55 55
                     [$node]
56
-                  )
56
+                    )
57 57
                 );
58 58
             }
59 59
         }
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 
75 75
         $argumentNodes = $node->getArguments();
76 76
         $argumentNodeMap = keyMap($argumentNodes,
77
-          function (ArgumentNode $argument) {
78
-              return $argument->getNameValue();
79
-          });
77
+            function (ArgumentNode $argument) {
78
+                return $argument->getNameValue();
79
+            });
80 80
 
81 81
         foreach ($directiveDefinition->getArguments() as $argumentDefinition) {
82 82
             $argumentNode = $argumentNodeMap[$argumentDefinition->getName()] ?? null;
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 
85 85
             if (null === $argumentNode && $argumentType instanceof NonNullType) {
86 86
                 $this->context->reportError(
87
-                  new ValidationException(
87
+                    new ValidationException(
88 88
                     missingDirectiveArgumentMessage(
89
-                      (string)$node,
90
-                      (string)$argumentDefinition,
91
-                      (string)$argumentType
89
+                        (string)$node,
90
+                        (string)$argumentDefinition,
91
+                        (string)$argumentType
92 92
                     ),
93 93
                     [$node]
94
-                  )
94
+                    )
95 95
                 );
96 96
             }
97 97
         }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         $argumentNodes = $node->getArguments();
38 38
         $argumentNodeMap = keyMap($argumentNodes,
39
-          function (ArgumentNode $argument) {
39
+          function(ArgumentNode $argument) {
40 40
               return $argument->getNameValue();
41 41
           });
42 42
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         $argumentNodes = $node->getArguments();
76 76
         $argumentNodeMap = keyMap($argumentNodes,
77
-          function (ArgumentNode $argument) {
77
+          function(ArgumentNode $argument) {
78 78
               return $argument->getNameValue();
79 79
           });
80 80
 
Please login to merge, or discard this patch.
src/Validation/Rule/PossibleFragmentSpreadsRule.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
           !doTypesOverlap($this->context->getSchema(),
39 39
             $fragmentType, $parentType)) {
40 40
             $this->context->reportError(
41
-              new ValidationException(
41
+                new ValidationException(
42 42
                 typeIncompatibleAnonymousSpreadMessage($parentType,
43
-                  $fragmentType),
43
+                    $fragmentType),
44 44
                 [$node]
45
-              )
45
+                )
46 46
             );
47 47
         }
48 48
 
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
           !doTypesOverlap($this->context->getSchema(),
65 65
             $fragmentType, $parentType)) {
66 66
             $this->context->reportError(
67
-              new ValidationException(
67
+                new ValidationException(
68 68
                 typeIncompatibleSpreadMessage($fragmentName, $parentType,
69
-                  $fragmentType),
69
+                    $fragmentType),
70 70
                 [$node]
71
-              )
71
+                )
72 72
             );
73 73
         }
74 74
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
 
92 92
         $type = typeFromAST($this->context->getSchema(),
93
-          $fragment->getTypeCondition());
93
+            $fragment->getTypeCondition());
94 94
 
95 95
         return $type instanceof CompositeTypeInterface ? $type : null;
96 96
     }
Please login to merge, or discard this patch.
src/Validation/Rule/KnownDirectivesRule.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     {
50 50
         /** @var Directive $directiveDefinition */
51 51
         $directiveDefinition = find(
52
-          $this->context->getSchema()->getDirectives(),
53
-          function (Directive $definition) use ($node) {
54
-              return $definition->getName() === $node->getNameValue();
55
-          }
52
+            $this->context->getSchema()->getDirectives(),
53
+            function (Directive $definition) use ($node) {
54
+                return $definition->getName() === $node->getNameValue();
55
+            }
56 56
         );
57 57
 
58 58
         if (null == $directiveDefinition) {
59 59
             $this->context->reportError(
60
-              new ValidationException(unknownDirectiveMessage((string)$node),
60
+                new ValidationException(unknownDirectiveMessage((string)$node),
61 61
                 [$node])
62 62
             );
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         if (null !== $location && !\in_array($location,
70 70
             $directiveDefinition->getLocations())) {
71 71
             $this->context->reportError(
72
-              new ValidationException(misplacedDirectiveMessage((string)$node,
72
+                new ValidationException(misplacedDirectiveMessage((string)$node,
73 73
                 $location), [$node])
74 74
             );
75 75
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         /** @var Directive $directiveDefinition */
51 51
         $directiveDefinition = find(
52 52
           $this->context->getSchema()->getDirectives(),
53
-          function (Directive $definition) use ($node) {
53
+          function(Directive $definition) use ($node) {
54 54
               return $definition->getName() === $node->getNameValue();
55 55
           }
56 56
         );
Please login to merge, or discard this patch.