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 ( 3cccd4...21c599 )
by Šimon
10:52
created
src/Utils/TypeInfo.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         if (Type::isCompositeType($initialType)) {
95 95
             $this->parentTypeStack[] = $initialType;
96 96
         }
97
-        if (! Type::isOutputType($initialType)) {
97
+        if (!Type::isOutputType($initialType)) {
98 98
             return;
99 99
         }
100 100
 
@@ -149,17 +149,17 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public static function extractTypes($type, ?array $typeMap = null)
151 151
     {
152
-        if (! $typeMap) {
152
+        if (!$typeMap) {
153 153
             $typeMap = [];
154 154
         }
155
-        if (! $type) {
155
+        if (!$type) {
156 156
             return $typeMap;
157 157
         }
158 158
 
159 159
         if ($type instanceof WrappingType) {
160 160
             return self::extractTypes($type->getWrappedType(true), $typeMap);
161 161
         }
162
-        if (! $type instanceof Type) {
162
+        if (!$type instanceof Type) {
163 163
             // Preserve these invalid types in map (at numeric index) to make them
164 164
             // detectable during $schema->validate()
165 165
             $i            = 0;
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
                 $alreadyInMap = $alreadyInMap || $typeMap[$i] === $type;
169 169
                 $i++;
170 170
             }
171
-            if (! $alreadyInMap) {
171
+            if (!$alreadyInMap) {
172 172
                 $typeMap[$i] = $type;
173 173
             }
174 174
 
175 175
             return $typeMap;
176 176
         }
177 177
 
178
-        if (! empty($typeMap[$type->name])) {
178
+        if (!empty($typeMap[$type->name])) {
179 179
             Utils::invariant(
180 180
                 $typeMap[$type->name] === $type,
181 181
                 sprintf('Schema must contain unique named types but contains multiple types named "%s" ', $type) .
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
         }
197 197
         if ($type instanceof ObjectType || $type instanceof InterfaceType) {
198 198
             foreach ($type->getFields() as $fieldName => $field) {
199
-                if (! empty($field->args)) {
199
+                if (!empty($field->args)) {
200 200
                     $fieldArgTypes = array_map(
201
-                        static function (FieldArgument $arg) {
201
+                        static function(FieldArgument $arg) {
202 202
                             return $arg->getType();
203 203
                         },
204 204
                         $field->args
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                     /** @var FieldArgument $argDef */
324 324
                     $argDef = Utils::find(
325 325
                         $fieldOrDirective->args,
326
-                        static function ($arg) use ($node) {
326
+                        static function($arg) use ($node) {
327 327
                             return $arg->name === $node->name->value;
328 328
                         }
329 329
                     );
Please login to merge, or discard this patch.
src/Validator/Rules/KnownArgumentNames.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function getVisitor(ValidationContext $context)
29 29
     {
30 30
         return [
31
-            NodeKind::ARGUMENT => static function (ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) {
31
+            NodeKind::ARGUMENT => static function(ArgumentNode $node, $key, $parent, $path, $ancestors) use ($context) {
32 32
                 $argDef = $context->getArgument();
33 33
                 if ($argDef !== null) {
34 34
                     return null;
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                                 Utils::suggestionList(
49 49
                                     $node->name->value,
50 50
                                     array_map(
51
-                                        static function ($arg) {
51
+                                        static function($arg) {
52 52
                                             return $arg->name;
53 53
                                         },
54 54
                                         $fieldDef->args
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                                 Utils::suggestionList(
69 69
                                     $node->name->value,
70 70
                                     array_map(
71
-                                        static function ($arg) {
71
+                                        static function($arg) {
72 72
                                             return $arg->name;
73 73
                                         },
74 74
                                         $directive->args
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs)
90 90
     {
91 91
         $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName);
92
-        if (! empty($suggestedArgs)) {
92
+        if (!empty($suggestedArgs)) {
93 93
             $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs));
94 94
         }
95 95
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     public static function unknownDirectiveArgMessage($argName, $directiveName, array $suggestedArgs)
103 103
     {
104 104
         $message = sprintf('Unknown argument "%s" on directive "@%s".', $argName, $directiveName);
105
-        if (! empty($suggestedArgs)) {
105
+        if (!empty($suggestedArgs)) {
106 106
             $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs));
107 107
         }
108 108
 
Please login to merge, or discard this patch.
src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 
46 46
         foreach ($definedDirectives as $directive) {
47 47
             $requiredArgsMap[$directive->name] = Utils::keyMap(
48
-                array_filter($directive->args, static function (FieldArgument $arg) : bool {
49
-                    return $arg->getType() instanceof NonNull && ! isset($arg->defaultValue);
48
+                array_filter($directive->args, static function(FieldArgument $arg) : bool {
49
+                    return $arg->getType() instanceof NonNull && !isset($arg->defaultValue);
50 50
                 }),
51
-                static function (FieldArgument $arg) : string {
51
+                static function(FieldArgument $arg) : string {
52 52
                     return $arg->name;
53 53
                 }
54 54
             );
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         $astDefinition = $context->getDocument()->definitions;
58 58
         foreach ($astDefinition as $def) {
59
-            if (! ($def instanceof DirectiveDefinitionNode)) {
59
+            if (!($def instanceof DirectiveDefinitionNode)) {
60 60
                 continue;
61 61
             }
62 62
 
@@ -70,32 +70,32 @@  discard block
 block discarded – undo
70 70
 
71 71
             $requiredArgsMap[$def->name->value] = Utils::keyMap(
72 72
                 $arguments
73
-                    ? array_filter($arguments, static function (Node $argument) : bool {
73
+                    ? array_filter($arguments, static function(Node $argument) : bool {
74 74
                         return $argument instanceof NonNullTypeNode &&
75 75
                             (
76
-                                ! isset($argument->defaultValue) ||
76
+                                !isset($argument->defaultValue) ||
77 77
                                 $argument->defaultValue === null
78 78
                             );
79 79
                     })
80 80
                     : [],
81
-                static function (NamedTypeNode $argument) : string {
81
+                static function(NamedTypeNode $argument) : string {
82 82
                     return $argument->name->value;
83 83
                 }
84 84
             );
85 85
         }
86 86
 
87 87
         return [
88
-            NodeKind::DIRECTIVE => static function (DirectiveNode $directiveNode) use ($requiredArgsMap, $context) {
88
+            NodeKind::DIRECTIVE => static function(DirectiveNode $directiveNode) use ($requiredArgsMap, $context) {
89 89
                 $directiveName = $directiveNode->name->value;
90 90
                 $requiredArgs  = $requiredArgsMap[$directiveName] ?? null;
91
-                if (! $requiredArgs) {
91
+                if (!$requiredArgs) {
92 92
                     return null;
93 93
                 }
94 94
 
95 95
                 $argNodes   = $directiveNode->arguments ?: [];
96 96
                 $argNodeMap = Utils::keyMap(
97 97
                     $argNodes,
98
-                    static function (ArgumentNode $arg) : string {
98
+                    static function(ArgumentNode $arg) : string {
99 99
                         return $arg->name->value;
100 100
                     }
101 101
                 );
Please login to merge, or discard this patch.
examples/03-server/graphql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
                 'args' => [
20 20
                     'message' => ['type' => Type::string()],
21 21
                 ],
22
-                'resolve' => function ($rootValue, $args) {
22
+                'resolve' => function($rootValue, $args) {
23 23
                     return $rootValue['prefix'] . $args['message'];
24 24
                 }
25 25
             ],
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                     'x' => ['type' => Type::int()],
36 36
                     'y' => ['type' => Type::int()],
37 37
                 ],
38
-                'resolve' => function ($calc, $args) {
38
+                'resolve' => function($calc, $args) {
39 39
                     return $args['x'] + $args['y'];
40 40
                 },
41 41
             ],
Please login to merge, or discard this patch.
src/Validator/Rules/KnownDirectives.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
         $astDefinition = $context->getDocument()->definitions;
73 73
 
74 74
         foreach ($astDefinition as $def) {
75
-            if (! ($def instanceof DirectiveDefinitionNode)) {
75
+            if (!($def instanceof DirectiveDefinitionNode)) {
76 76
                 continue;
77 77
             }
78 78
 
79 79
             $locationsMap[$def->name->value] = array_map(
80
-                static function ($name) : string {
80
+                static function($name) : string {
81 81
                     return $name->value;
82 82
                 },
83 83
                 $def->locations
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         return [
88
-            NodeKind::DIRECTIVE => function (
88
+            NodeKind::DIRECTIVE => function(
89 89
                 DirectiveNode $node,
90 90
                 $key,
91 91
                 $parent,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 $name      = $node->name->value;
99 99
                 $locations = $locationsMap[$name] ?? null;
100 100
 
101
-                if (! $locations) {
101
+                if (!$locations) {
102 102
                     $context->reportError(new Error(
103 103
                         self::unknownDirectiveMessage($name),
104 104
                         [$node]
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
                 $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors);
111 111
 
112
-                if (! $candidateLocation || in_array($candidateLocation, $locations, true)) {
112
+                if (!$candidateLocation || in_array($candidateLocation, $locations, true)) {
113 113
                     return;
114 114
                 }
115 115
                 $context->reportError(
Please login to merge, or discard this patch.
src/Validator/Rules/DisableIntrospection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         return $this->invokeIfNeeded(
32 32
             $context,
33 33
             [
34
-                NodeKind::FIELD => static function (FieldNode $node) use ($context) : void {
34
+                NodeKind::FIELD => static function(FieldNode $node) use ($context) : void {
35 35
                     if ($node->name->value !== '__type' && $node->name->value !== '__schema') {
36 36
                         return;
37 37
                     }
Please login to merge, or discard this patch.
src/Error/Error.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         // Compute list of blame nodes.
107 107
         if ($nodes instanceof Traversable) {
108 108
             $nodes = iterator_to_array($nodes);
109
-        } elseif ($nodes && ! is_array($nodes)) {
109
+        } elseif ($nodes && !is_array($nodes)) {
110 110
             $nodes = [$nodes];
111 111
         }
112 112
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     public function getSource()
213 213
     {
214 214
         if ($this->source === null) {
215
-            if (! empty($this->nodes[0]) && ! empty($this->nodes[0]->loc)) {
215
+            if (!empty($this->nodes[0]) && !empty($this->nodes[0]->loc)) {
216 216
                 $this->source = $this->nodes[0]->loc->source;
217 217
             }
218 218
         }
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function getPositions()
227 227
     {
228
-        if ($this->positions === null && ! empty($this->nodes)) {
228
+        if ($this->positions === null && !empty($this->nodes)) {
229 229
             $positions = array_map(
230
-                static function ($node) : ?int {
230
+                static function($node) : ?int {
231 231
                     return isset($node->loc) ? $node->loc->start : null;
232 232
                 },
233 233
                 $this->nodes
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
             $positions = array_filter(
237 237
                 $positions,
238
-                static function ($p) : bool {
238
+                static function($p) : bool {
239 239
                     return $p !== null;
240 240
                 }
241 241
             );
@@ -270,15 +270,15 @@  discard block
 block discarded – undo
270 270
 
271 271
             if ($positions && $source) {
272 272
                 $this->locations = array_map(
273
-                    static function ($pos) use ($source) : SourceLocation {
273
+                    static function($pos) use ($source) : SourceLocation {
274 274
                         return $source->getLocation($pos);
275 275
                     },
276 276
                     $positions
277 277
                 );
278 278
             } elseif ($nodes) {
279
-                $locations       = array_filter(
279
+                $locations = array_filter(
280 280
                     array_map(
281
-                        static function ($node) {
281
+                        static function($node) {
282 282
                             if ($node->loc && $node->loc->source) {
283 283
                                 return $node->loc->source->getLocation($node->loc->start);
284 284
                             }
@@ -343,18 +343,18 @@  discard block
 block discarded – undo
343 343
 
344 344
         $locations = Utils::map(
345 345
             $this->getLocations(),
346
-            static function (SourceLocation $loc) : array {
346
+            static function(SourceLocation $loc) : array {
347 347
                 return $loc->toSerializableArray();
348 348
             }
349 349
         );
350 350
 
351
-        if (! empty($locations)) {
351
+        if (!empty($locations)) {
352 352
             $arr['locations'] = $locations;
353 353
         }
354
-        if (! empty($this->path)) {
354
+        if (!empty($this->path)) {
355 355
             $arr['path'] = $this->path;
356 356
         }
357
-        if (! empty($this->extensions)) {
357
+        if (!empty($this->extensions)) {
358 358
             $arr['extensions'] = $this->extensions;
359 359
         }
360 360
 
Please login to merge, or discard this patch.
src/Error/FormattedError.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         if ($error->nodes) {
70 70
             /** @var Node $node */
71 71
             foreach ($error->nodes as $node) {
72
-                if (! $node->loc) {
72
+                if (!$node->loc) {
73 73
                     continue;
74 74
                 }
75 75
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             }
90 90
         }
91 91
 
92
-        return ! $printedLocations
92
+        return !$printedLocations
93 93
             ? $error->getMessage()
94 94
             : implode("\n\n", array_merge([$error->getMessage()], $printedLocations)) . "\n";
95 95
     }
@@ -202,17 +202,17 @@  discard block
 block discarded – undo
202 202
         if ($e instanceof Error) {
203 203
             $locations = Utils::map(
204 204
                 $e->getLocations(),
205
-                static function (SourceLocation $loc) : array {
205
+                static function(SourceLocation $loc) : array {
206 206
                     return $loc->toSerializableArray();
207 207
                 }
208 208
             );
209
-            if (! empty($locations)) {
209
+            if (!empty($locations)) {
210 210
                 $formattedError['locations'] = $locations;
211 211
             }
212
-            if (! empty($e->path)) {
212
+            if (!empty($e->path)) {
213 213
                 $formattedError['path'] = $e->path;
214 214
             }
215
-            if (! empty($e->getExtensions())) {
215
+            if (!empty($e->getExtensions())) {
216 216
                 $formattedError['extensions'] = $e->getExtensions() + $formattedError['extensions'];
217 217
             }
218 218
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public static function addDebugEntries(array $formattedError, $e, $debug)
240 240
     {
241
-        if (! $debug) {
241
+        if (!$debug) {
242 242
             return $formattedError;
243 243
         }
244 244
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $debug = (int) $debug;
252 252
 
253 253
         if ($debug & Debug::RETHROW_INTERNAL_EXCEPTIONS) {
254
-            if (! $e instanceof Error) {
254
+            if (!$e instanceof Error) {
255 255
                 throw $e;
256 256
             }
257 257
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             }
261 261
         }
262 262
 
263
-        $isUnsafe = ! $e instanceof ClientAware || ! $e->isClientSafe();
263
+        $isUnsafe = !$e instanceof ClientAware || !$e->isClientSafe();
264 264
 
265 265
         if (($debug & Debug::RETHROW_UNSAFE_EXCEPTIONS) && $isUnsafe) {
266 266
             if ($e->getPrevious()) {
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
                 ];
282 282
             }
283 283
 
284
-            $isTrivial = $e instanceof Error && ! $e->getPrevious();
284
+            $isTrivial = $e instanceof Error && !$e->getPrevious();
285 285
 
286
-            if (! $isTrivial) {
286
+            if (!$isTrivial) {
287 287
                 $debugging               = $e->getPrevious() ?: $e;
288 288
                 $formattedError['trace'] = static::toSafeTrace($debugging);
289 289
             }
@@ -302,11 +302,11 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public static function prepareFormatter(?callable $formatter = null, $debug)
304 304
     {
305
-        $formatter = $formatter ?: static function ($e) : array {
305
+        $formatter = $formatter ?: static function($e) : array {
306 306
             return FormattedError::createFromException($e);
307 307
         };
308 308
         if ($debug) {
309
-            $formatter = static function ($e) use ($formatter, $debug) : array {
309
+            $formatter = static function($e) use ($formatter, $debug) : array {
310 310
                 return FormattedError::addDebugEntries($formatter($e), $e, $debug);
311 311
             };
312 312
         }
@@ -331,18 +331,18 @@  discard block
 block discarded – undo
331 331
             // Remove invariant entries as they don't provide much value:
332 332
             ($trace[0]['class'] . '::' . $trace[0]['function'] === 'GraphQL\Utils\Utils::invariant')) {
333 333
             array_shift($trace);
334
-        } elseif (! isset($trace[0]['file'])) {
334
+        } elseif (!isset($trace[0]['file'])) {
335 335
             // Remove root call as it's likely error handler trace:
336 336
             array_shift($trace);
337 337
         }
338 338
 
339 339
         return array_map(
340
-            static function ($err) : array {
340
+            static function($err) : array {
341 341
                 $safeErr = array_intersect_key($err, ['file' => true, 'line' => true]);
342 342
 
343 343
                 if (isset($err['function'])) {
344 344
                     $func    = $err['function'];
345
-                    $args    = ! empty($err['args']) ? array_map([self::class, 'printVar'], $err['args']) : [];
345
+                    $args    = !empty($err['args']) ? array_map([self::class, 'printVar'], $err['args']) : [];
346 346
                     $funcStr = $func . '(' . implode(', ', $args) . ')';
347 347
 
348 348
                     if (isset($err['class'])) {
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
     {
412 412
         $formatted = ['message' => $error];
413 413
 
414
-        if (! empty($locations)) {
414
+        if (!empty($locations)) {
415 415
             $formatted['locations'] = array_map(
416
-                static function ($loc) : array {
416
+                static function($loc) : array {
417 417
                     return $loc->toArray();
418 418
                 },
419 419
                 $locations
Please login to merge, or discard this patch.
src/Executor/ExecutionResult.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $result = [];
140 140
 
141
-        if (! empty($this->errors)) {
142
-            $errorsHandler = $this->errorsHandler ?: static function (array $errors, callable $formatter) : array {
141
+        if (!empty($this->errors)) {
142
+            $errorsHandler = $this->errorsHandler ?: static function(array $errors, callable $formatter) : array {
143 143
                 return array_map($formatter, $errors);
144 144
             };
145 145
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $result['data'] = $this->data;
154 154
         }
155 155
 
156
-        if (! empty($this->extensions)) {
156
+        if (!empty($this->extensions)) {
157 157
             $result['extensions'] = $this->extensions;
158 158
         }
159 159
 
Please login to merge, or discard this patch.