GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( e7bef7...3cccd4 )
by Šimon
03:07
created
src/Validator/Rules/QueryComplexity.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         return $this->invokeIfNeeded(
61 61
             $context,
62 62
             [
63
-                NodeKind::SELECTION_SET        => function (SelectionSetNode $selectionSet) use ($context) {
63
+                NodeKind::SELECTION_SET        => function(SelectionSetNode $selectionSet) use ($context) {
64 64
                     $this->fieldNodeAndDefs = $this->collectFieldASTsAndDefs(
65 65
                         $context,
66 66
                         $context->getParentType(),
@@ -69,16 +69,16 @@  discard block
 block discarded – undo
69 69
                         $this->fieldNodeAndDefs
70 70
                     );
71 71
                 },
72
-                NodeKind::VARIABLE_DEFINITION  => function ($def) {
72
+                NodeKind::VARIABLE_DEFINITION  => function($def) {
73 73
                     $this->variableDefs[] = $def;
74 74
 
75 75
                     return Visitor::skipNode();
76 76
                 },
77 77
                 NodeKind::OPERATION_DEFINITION => [
78
-                    'leave' => function (OperationDefinitionNode $operationDefinition) use ($context, &$complexity) {
78
+                    'leave' => function(OperationDefinitionNode $operationDefinition) use ($context, &$complexity) {
79 79
                         $errors = $context->getErrors();
80 80
 
81
-                        if (! empty($errors)) {
81
+                        if (!empty($errors)) {
82 82
                             return;
83 83
                         }
84 84
 
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
                 $this->variableDefs,
192 192
                 $this->getRawVariableValues()
193 193
             );
194
-            if (! empty($errors)) {
194
+            if (!empty($errors)) {
195 195
                 throw new Error(implode(
196 196
                     "\n\n",
197 197
                     array_map(
198
-                        static function ($error) {
198
+                        static function($error) {
199 199
                             return $error->getMessage();
200 200
                         },
201 201
                         $errors
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 /** @var bool $directiveArgsIf */
208 208
                 $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if'];
209 209
 
210
-                return ! $directiveArgsIf;
210
+                return !$directiveArgsIf;
211 211
             }
212 212
             if ($directiveNode->name->value === Directive::SKIP_NAME) {
213 213
                 $directive = Directive::skipDirective();
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
                 $rawVariableValues
250 250
             );
251 251
 
252
-            if (! empty($errors)) {
252
+            if (!empty($errors)) {
253 253
                 throw new Error(implode(
254 254
                     "\n\n",
255 255
                     array_map(
256
-                        static function ($error) {
256
+                        static function($error) {
257 257
                             return $error->getMessage();
258 258
                         },
259 259
                         $errors
Please login to merge, or discard this patch.
src/Validator/Rules/LoneSchemaDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         $schemaDefinitionsCount = 0;
42 42
 
43 43
         return [
44
-            NodeKind::SCHEMA_DEFINITION => static function (SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) {
44
+            NodeKind::SCHEMA_DEFINITION => static function(SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) {
45 45
                 if ($alreadyDefined !== false) {
46 46
                     $context->reportError(new Error(self::canNotDefineSchemaWithinExtensionMessage(), $node));
47 47
 
Please login to merge, or discard this patch.
src/Validator/Rules/VariablesInAllowedPosition.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
     {
33 33
         return [
34 34
             NodeKind::OPERATION_DEFINITION => [
35
-                'enter' => function () {
35
+                'enter' => function() {
36 36
                     $this->varDefMap = [];
37 37
                 },
38
-                'leave' => function (OperationDefinitionNode $operation) use ($context) {
38
+                'leave' => function(OperationDefinitionNode $operation) use ($context) {
39 39
                     $usages = $context->getRecursiveVariableUsages($operation);
40 40
 
41 41
                     foreach ($usages as $usage) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                         $schema  = $context->getSchema();
58 58
                         $varType = TypeInfo::typeFromAST($schema, $varDef->type);
59 59
 
60
-                        if (! $varType || $this->allowedVariableUsage($schema, $varType, $varDef->defaultValue, $type, $defaultValue)) {
60
+                        if (!$varType || $this->allowedVariableUsage($schema, $varType, $varDef->defaultValue, $type, $defaultValue)) {
61 61
                             continue;
62 62
                         }
63 63
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     }
69 69
                 },
70 70
             ],
71
-            NodeKind::VARIABLE_DEFINITION  => function (VariableDefinitionNode $varDefNode) {
71
+            NodeKind::VARIABLE_DEFINITION  => function(VariableDefinitionNode $varDefNode) {
72 72
                 $this->varDefMap[$varDefNode->variable->name->value] = $varDefNode;
73 73
             },
74 74
         ];
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
      */
101 101
     private function allowedVariableUsage(Schema $schema, Type $varType, $varDefaultValue, Type $locationType, $locationDefaultValue) : bool
102 102
     {
103
-        if ($locationType instanceof NonNull && ! $varType instanceof NonNull) {
104
-            $hasNonNullVariableDefaultValue = $varDefaultValue && ! $varDefaultValue instanceof NullValueNode;
105
-            $hasLocationDefaultValue        = ! Utils::isInvalid($locationDefaultValue);
106
-            if (! $hasNonNullVariableDefaultValue && ! $hasLocationDefaultValue) {
103
+        if ($locationType instanceof NonNull && !$varType instanceof NonNull) {
104
+            $hasNonNullVariableDefaultValue = $varDefaultValue && !$varDefaultValue instanceof NullValueNode;
105
+            $hasLocationDefaultValue        = !Utils::isInvalid($locationDefaultValue);
106
+            if (!$hasNonNullVariableDefaultValue && !$hasLocationDefaultValue) {
107 107
                 return false;
108 108
             }
109 109
             $nullableLocationType = $locationType->getWrappedType();
Please login to merge, or discard this patch.
src/Validator/Rules/UniqueDirectivesPerLocation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
     public function getASTVisitor(ASTValidationContext $context)
28 28
     {
29 29
         return [
30
-            'enter' => static function (Node $node) use ($context) {
31
-                if (! isset($node->directives)) {
30
+            'enter' => static function(Node $node) use ($context) {
31
+                if (!isset($node->directives)) {
32 32
                     return;
33 33
                 }
34 34
 
Please login to merge, or discard this patch.
src/Validator/Rules/ProvidedRequiredArguments.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
     {
20 20
         return [
21 21
             NodeKind::FIELD     => [
22
-                'leave' => static function (FieldNode $fieldNode) use ($context) {
22
+                'leave' => static function(FieldNode $fieldNode) use ($context) {
23 23
                     $fieldDef = $context->getFieldDef();
24 24
 
25
-                    if (! $fieldDef) {
25
+                    if (!$fieldDef) {
26 26
                         return Visitor::skipNode();
27 27
                     }
28 28
                     $argNodes = $fieldNode->arguments ?: [];
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                     }
34 34
                     foreach ($fieldDef->args as $argDef) {
35 35
                         $argNode = $argNodeMap[$argDef->name] ?? null;
36
-                        if ($argNode || (! ($argDef->getType() instanceof NonNull)) || $argDef->defaultValueExists()) {
36
+                        if ($argNode || (!($argDef->getType() instanceof NonNull)) || $argDef->defaultValueExists()) {
37 37
                             continue;
38 38
                         }
39 39
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
                 },
46 46
             ],
47 47
             NodeKind::DIRECTIVE => [
48
-                'leave' => static function (DirectiveNode $directiveNode) use ($context) {
48
+                'leave' => static function(DirectiveNode $directiveNode) use ($context) {
49 49
                     $directiveDef = $context->getDirective();
50
-                    if (! $directiveDef) {
50
+                    if (!$directiveDef) {
51 51
                         return Visitor::skipNode();
52 52
                     }
53 53
                     $argNodes   = $directiveNode->arguments ?: [];
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
                     foreach ($directiveDef->args as $argDef) {
60 60
                         $argNode = $argNodeMap[$argDef->name] ?? null;
61
-                        if ($argNode || (! ($argDef->getType() instanceof NonNull)) || $argDef->defaultValueExists()) {
61
+                        if ($argNode || (!($argDef->getType() instanceof NonNull)) || $argDef->defaultValueExists()) {
62 62
                             continue;
63 63
                         }
64 64
 
Please login to merge, or discard this patch.
src/Validator/Rules/NoFragmentCycles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
         $this->spreadPathIndexByName = [];
42 42
 
43 43
         return [
44
-            NodeKind::OPERATION_DEFINITION => static function () {
44
+            NodeKind::OPERATION_DEFINITION => static function() {
45 45
                 return Visitor::skipNode();
46 46
             },
47
-            NodeKind::FRAGMENT_DEFINITION  => function (FragmentDefinitionNode $node) use ($context) {
47
+            NodeKind::FRAGMENT_DEFINITION  => function(FragmentDefinitionNode $node) use ($context) {
48 48
                 $this->detectCycleRecursive($node, $context);
49 49
 
50 50
                 return Visitor::skipNode();
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     private function detectCycleRecursive(FragmentDefinitionNode $fragment, ValidationContext $context)
56 56
     {
57
-        if (! empty($this->visitedFrags[$fragment->name->value])) {
57
+        if (!empty($this->visitedFrags[$fragment->name->value])) {
58 58
             return;
59 59
         }
60 60
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 }
83 83
             } else {
84 84
                 $cyclePath     = array_slice($this->spreadPath, $cycleIndex);
85
-                $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function ($s) {
85
+                $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function($s) {
86 86
                     return $s->name->value;
87 87
                 });
88 88
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         return sprintf(
106 106
             'Cannot spread fragment "%s" within itself%s.',
107 107
             $fragName,
108
-            ! empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : ''
108
+            !empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : ''
109 109
         );
110 110
     }
111 111
 }
Please login to merge, or discard this patch.
src/Validator/Rules/OverlappingFieldsCanBeMerged.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $this->cachedFieldsAndFragmentNames = new SplObjectStorage();
61 61
 
62 62
         return [
63
-            NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) {
63
+            NodeKind::SELECTION_SET => function(SelectionSetNode $selectionSet) use ($context) {
64 64
                 $conflicts = $this->findConflictsWithinSelectionSet(
65 65
                     $context,
66 66
                     $context->getParentType(),
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                     }
260 260
                     $responseName = $selection->alias ? $selection->alias->value : $fieldName;
261 261
 
262
-                    if (! isset($astAndDefs[$responseName])) {
262
+                    if (!isset($astAndDefs[$responseName])) {
263 263
                         $astAndDefs[$responseName] = [];
264 264
                     }
265 265
                     $astAndDefs[$responseName][] = [$parentType, $selection, $fieldDef];
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
                         $fields[$i],
319 319
                         $fields[$j]
320 320
                     );
321
-                    if (! $conflict) {
321
+                    if (!$conflict) {
322 322
                         continue;
323 323
                     }
324 324
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         $type1 = $def1 === null ? null : $def1->getType();
370 370
         $type2 = $def2 === null ? null : $def2->getType();
371 371
 
372
-        if (! $areMutuallyExclusive) {
372
+        if (!$areMutuallyExclusive) {
373 373
             // Two aliases must refer to the same field.
374 374
             $name1 = $ast1->name->value;
375 375
             $name2 = $ast2->name->value;
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 ];
382 382
             }
383 383
 
384
-            if (! $this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) {
384
+            if (!$this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) {
385 385
                 return [
386 386
                     [$responseName, 'they have differing arguments'],
387 387
                     [$ast1],
@@ -443,11 +443,11 @@  discard block
 block discarded – undo
443 443
                     break;
444 444
                 }
445 445
             }
446
-            if (! $argument2) {
446
+            if (!$argument2) {
447 447
                 return false;
448 448
             }
449 449
 
450
-            if (! $this->sameValue($argument1->value, $argument2->value)) {
450
+            if (!$this->sameValue($argument1->value, $argument2->value)) {
451 451
                 return false;
452 452
             }
453 453
         }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
      */
461 461
     private function sameValue(Node $value1, Node $value2)
462 462
     {
463
-        return (! $value1 && ! $value2) || (Printer::doPrint($value1) === Printer::doPrint($value2));
463
+        return (!$value1 && !$value2) || (Printer::doPrint($value1) === Printer::doPrint($value2));
464 464
     }
465 465
 
466 466
     /**
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
         // maps, each field from the first field map must be compared to every field
616 616
         // in the second field map to find potential conflicts.
617 617
         foreach ($fieldMap1 as $responseName => $fields1) {
618
-            if (! isset($fieldMap2[$responseName])) {
618
+            if (!isset($fieldMap2[$responseName])) {
619 619
                 continue;
620 620
             }
621 621
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                         $fields1[$i],
632 632
                         $fields2[$j]
633 633
                     );
634
-                    if (! $conflict) {
634
+                    if (!$conflict) {
635 635
                         continue;
636 636
                     }
637 637
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         $comparedFragments[$fragmentName] = true;
666 666
 
667 667
         $fragment = $context->getFragment($fragmentName);
668
-        if (! $fragment) {
668
+        if (!$fragment) {
669 669
             return;
670 670
         }
671 671
 
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 
766 766
         $fragment1 = $context->getFragment($fragmentName1);
767 767
         $fragment2 = $context->getFragment($fragmentName2);
768
-        if (! $fragment1 || ! $fragment2) {
768
+        if (!$fragment1 || !$fragment2) {
769 769
             return;
770 770
         }
771 771
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
             [
839 839
                 $responseName,
840 840
                 array_map(
841
-                    static function ($conflict) {
841
+                    static function($conflict) {
842 842
                         return $conflict[0];
843 843
                     },
844 844
                     $conflicts
@@ -846,14 +846,14 @@  discard block
 block discarded – undo
846 846
             ],
847 847
             array_reduce(
848 848
                 $conflicts,
849
-                static function ($allFields, $conflict) {
849
+                static function($allFields, $conflict) {
850 850
                     return array_merge($allFields, $conflict[1]);
851 851
                 },
852 852
                 [$ast1]
853 853
             ),
854 854
             array_reduce(
855 855
                 $conflicts,
856
-                static function ($allFields, $conflict) {
856
+                static function($allFields, $conflict) {
857 857
                     return array_merge($allFields, $conflict[2]);
858 858
                 },
859 859
                 [$ast2]
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
     {
881 881
         if (is_array($reason)) {
882 882
             $tmp = array_map(
883
-                static function ($tmp) {
883
+                static function($tmp) {
884 884
                     [$responseName, $subReason] = $tmp;
885 885
 
886 886
                     $reasonMessage = self::reasonMessage($subReason);
Please login to merge, or discard this patch.
src/Validator/Rules/ExecutableDefinitions.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
     public function getVisitor(ValidationContext $context)
26 26
     {
27 27
         return [
28
-            NodeKind::DOCUMENT => static function (DocumentNode $node) use ($context) {
28
+            NodeKind::DOCUMENT => static function(DocumentNode $node) use ($context) {
29 29
                 /** @var FragmentDefinitionNode|OperationDefinitionNode|TypeSystemDefinitionNode $definition */
30 30
                 foreach ($node->definitions as $definition) {
31 31
                     if ($definition instanceof OperationDefinitionNode ||
Please login to merge, or discard this patch.
src/Validator/DocumentValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public static function allRules()
126 126
     {
127
-        if (! self::$initRules) {
127
+        if (!self::$initRules) {
128 128
             static::$rules     = array_merge(static::defaultRules(), self::securityRules(), self::$rules);
129 129
             static::$initRules = true;
130 130
         }
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         return is_array($value)
265 265
             ? count(array_filter(
266 266
                 $value,
267
-                static function ($item) {
267
+                static function($item) {
268 268
                     return $item instanceof Throwable;
269 269
                 }
270 270
             )) === count($value)
Please login to merge, or discard this patch.