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
Branch query-batch (6bd0d3)
by Šimon
03:56
created
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.
src/Error/Warning.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
         if (self::$warningHandler !== null) {
102 102
             $fn = self::$warningHandler;
103 103
             $fn($errorMessage, $warningId, $messageLevel);
104
-        } elseif ((self::$enableWarnings & $warningId) > 0 && ! isset(self::$warned[$warningId])) {
104
+        } elseif ((self::$enableWarnings & $warningId) > 0 && !isset(self::$warned[$warningId])) {
105 105
             self::$warned[$warningId] = true;
106 106
             trigger_error($errorMessage, $messageLevel);
107 107
         }
Please login to merge, or discard this patch.
src/Server/Helper.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                     throw new RequestError('Could not parse JSON: ' . json_last_error_msg());
88 88
                 }
89 89
 
90
-                if (! is_array($bodyParams)) {
90
+                if (!is_array($bodyParams)) {
91 91
                     throw new RequestError(
92 92
                         'GraphQL Server expects JSON object or array, but got ' .
93 93
                         Utils::printSafeJson($bodyParams)
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     public function validateOperationParams(OperationParams $params)
154 154
     {
155 155
         $errors = [];
156
-        if (! $params->query && ! $params->queryId) {
156
+        if (!$params->query && !$params->queryId) {
157 157
             $errors[] = new RequestError('GraphQL Request must include at least one of those two parameters: "query" or "queryId"');
158 158
         }
159 159
 
@@ -161,28 +161,28 @@  discard block
 block discarded – undo
161 161
             $errors[] = new RequestError('GraphQL Request parameters "query" and "queryId" are mutually exclusive');
162 162
         }
163 163
 
164
-        if ($params->query !== null && (! is_string($params->query) || empty($params->query))) {
164
+        if ($params->query !== null && (!is_string($params->query) || empty($params->query))) {
165 165
             $errors[] = new RequestError(
166 166
                 'GraphQL Request parameter "query" must be string, but got ' .
167 167
                 Utils::printSafeJson($params->query)
168 168
             );
169 169
         }
170 170
 
171
-        if ($params->queryId !== null && (! is_string($params->queryId) || empty($params->queryId))) {
171
+        if ($params->queryId !== null && (!is_string($params->queryId) || empty($params->queryId))) {
172 172
             $errors[] = new RequestError(
173 173
                 'GraphQL Request parameter "queryId" must be string, but got ' .
174 174
                 Utils::printSafeJson($params->queryId)
175 175
             );
176 176
         }
177 177
 
178
-        if ($params->operation !== null && (! is_string($params->operation) || empty($params->operation))) {
178
+        if ($params->operation !== null && (!is_string($params->operation) || empty($params->operation))) {
179 179
             $errors[] = new RequestError(
180 180
                 'GraphQL Request parameter "operation" must be string, but got ' .
181 181
                 Utils::printSafeJson($params->operation)
182 182
             );
183 183
         }
184 184
 
185
-        if ($params->variables !== null && (! is_array($params->variables) || isset($params->variables[0]))) {
185
+        if ($params->variables !== null && (!is_array($params->variables) || isset($params->variables[0]))) {
186 186
             $errors[] = new RequestError(
187 187
                 'GraphQL Request parameter "variables" must be object or JSON string parsed to object, but got ' .
188 188
                 Utils::printSafeJson($params->getOriginalInput('variables'))
@@ -244,16 +244,16 @@  discard block
 block discarded – undo
244 244
     private function promiseToExecuteOperation(PromiseAdapter $promiseAdapter, ServerConfig $config, OperationParams $op) : Promise
245 245
     {
246 246
         try {
247
-            if (! $config->getSchema()) {
247
+            if (!$config->getSchema()) {
248 248
                 throw new InvariantViolation('Schema is required for the server');
249 249
             }
250 250
 
251 251
             $errors = $this->validateOperationParams($op);
252 252
 
253
-            if (! empty($errors)) {
253
+            if (!empty($errors)) {
254 254
                 $errors = Utils::map(
255 255
                     $errors,
256
-                    static function (RequestError $err) {
256
+                    static function(RequestError $err) {
257 257
                         return Error::createLocatedError($err, null, null);
258 258
                     }
259 259
                 );
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                 ? $this->loadPersistedQuery($config, $op)
268 268
                 : $op->query;
269 269
 
270
-            if (! $doc instanceof DocumentNode) {
270
+            if (!$doc instanceof DocumentNode) {
271 271
                 $doc = Parser::parse($doc);
272 272
             }
273 273
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
             );
303 303
         }
304 304
 
305
-        $applyErrorHandling = static function (ExecutionResult $result) use ($config) {
305
+        $applyErrorHandling = static function(ExecutionResult $result) use ($config) {
306 306
             if ($config->getErrorsHandler()) {
307 307
                 $result->setErrorsHandler($config->getErrorsHandler());
308 308
             }
@@ -331,13 +331,13 @@  discard block
 block discarded – undo
331 331
         // Load query if we got persisted query id:
332 332
         $loader = $config->getPersistentQueryLoader();
333 333
 
334
-        if (! $loader) {
334
+        if (!$loader) {
335 335
             throw new RequestError('Persisted queries are not supported by this server');
336 336
         }
337 337
 
338 338
         $source = $loader($operationParams->queryId, $operationParams);
339 339
 
340
-        if (! is_string($source) && ! $source instanceof DocumentNode) {
340
+        if (!is_string($source) && !$source instanceof DocumentNode) {
341 341
             throw new InvariantViolation(sprintf(
342 342
                 'Persistent query loader must return query string or instance of %s but got: %s',
343 343
                 DocumentNode::class,
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         if (is_callable($validationRules)) {
366 366
             $validationRules = $validationRules($params, $doc, $operationType);
367 367
 
368
-            if (! is_array($validationRules)) {
368
+            if (!is_array($validationRules)) {
369 369
                 throw new InvariantViolation(sprintf(
370 370
                     'Expecting validation rules to be array or callable returning array, but got: %s',
371 371
                     Utils::printSafe($validationRules)
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
     public function sendResponse($result, $exitWhenDone = false)
422 422
     {
423 423
         if ($result instanceof Promise) {
424
-            $result->then(function ($actualResult) use ($exitWhenDone) {
424
+            $result->then(function($actualResult) use ($exitWhenDone) {
425 425
                 $this->doSendResponse($actualResult, $exitWhenDone);
426 426
             });
427 427
         } else {
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
         if (is_array($result) && isset($result[0])) {
470 470
             Utils::each(
471 471
                 $result,
472
-                static function ($executionResult, $index) {
473
-                    if (! $executionResult instanceof ExecutionResult) {
472
+                static function($executionResult, $index) {
473
+                    if (!$executionResult instanceof ExecutionResult) {
474 474
                         throw new InvariantViolation(sprintf(
475 475
                             'Expecting every entry of batched query result to be instance of %s but entry at position %d is %s',
476 476
                             ExecutionResult::class,
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
             );
483 483
             $httpStatus = 200;
484 484
         } else {
485
-            if (! $result instanceof ExecutionResult) {
485
+            if (!$result instanceof ExecutionResult) {
486 486
                 throw new InvariantViolation(sprintf(
487 487
                     'Expecting query result to be instance of %s but got %s',
488 488
                     ExecutionResult::class,
489 489
                     Utils::printSafe($result)
490 490
                 ));
491 491
             }
492
-            if ($result->data === null && ! empty($result->errors)) {
492
+            if ($result->data === null && !empty($result->errors)) {
493 493
                 $httpStatus = 400;
494 494
             } else {
495 495
                 $httpStatus = 200;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
         } else {
516 516
             $contentType = $request->getHeader('content-type');
517 517
 
518
-            if (! isset($contentType[0])) {
518
+            if (!isset($contentType[0])) {
519 519
                 throw new RequestError('Missing "Content-Type" header');
520 520
             }
521 521
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                     );
531 531
                 }
532 532
 
533
-                if (! is_array($bodyParams)) {
533
+                if (!is_array($bodyParams)) {
534 534
                     throw new RequestError(
535 535
                         'GraphQL Server expects JSON object or array, but got ' .
536 536
                         Utils::printSafeJson($bodyParams)
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
             } else {
540 540
                 $bodyParams = $request->getParsedBody();
541 541
 
542
-                if (! is_array($bodyParams)) {
542
+                if (!is_array($bodyParams)) {
543 543
                     throw new RequestError('Unexpected content type: ' . Utils::printSafeJson($contentType[0]));
544 544
                 }
545 545
             }
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     public function toPsrResponse($result, ResponseInterface $response, StreamInterface $writableBodyStream)
565 565
     {
566 566
         if ($result instanceof Promise) {
567
-            return $result->then(function ($actualResult) use ($response, $writableBodyStream) {
567
+            return $result->then(function($actualResult) use ($response, $writableBodyStream) {
568 568
                 return $this->doConvertToPsrResponse($actualResult, $response, $writableBodyStream);
569 569
             });
570 570
         }
Please login to merge, or discard this patch.
src/Executor/Promise/Adapter/SyncPromise.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public static function runQueue() : void
42 42
     {
43 43
         $q = self::$queue;
44
-        while ($q !== null && ! $q->isEmpty()) {
44
+        while ($q !== null && !$q->isEmpty()) {
45 45
             $task = $q->dequeue();
46 46
             $task();
47 47
         }
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
                 }
57 57
                 if (is_object($value) && method_exists($value, 'then')) {
58 58
                     $value->then(
59
-                        function ($resolvedValue) {
59
+                        function($resolvedValue) {
60 60
                             $this->resolve($resolvedValue);
61 61
                         },
62
-                        function ($reason) {
62
+                        function($reason) {
63 63
                             $this->reject($reason);
64 64
                         }
65 65
                     );
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
     public function reject($reason) : self
87 87
     {
88
-        if (! $reason instanceof Throwable) {
88
+        if (!$reason instanceof Throwable) {
89 89
             throw new Exception('SyncPromise::reject() has to be called with an instance of \Throwable');
90 90
         }
91 91
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         );
116 116
 
117 117
         foreach ($this->waiting as $descriptor) {
118
-            self::getQueue()->enqueue(function () use ($descriptor) {
118
+            self::getQueue()->enqueue(function() use ($descriptor) {
119 119
                 /** @var self $promise */
120 120
                 [$promise, $onFulfilled, $onRejected] = $descriptor;
121 121
 
Please login to merge, or discard this patch.
src/Executor/Values.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -265,23 +265,23 @@
 block discarded – undo
265 265
                 );
266 266
             } elseif ($hasValue) {
267 267
                 if ($argumentValueNode instanceof NullValueNode) {
268
-                  // If the explicit value `null` was provided, an entry in the coerced
269
-                  // values must exist as the value `null`.
268
+                    // If the explicit value `null` was provided, an entry in the coerced
269
+                    // values must exist as the value `null`.
270 270
                     $coercedValues[$name] = null;
271 271
                 } elseif ($argumentValueNode instanceof VariableNode) {
272 272
                     $variableName = $argumentValueNode->name->value;
273 273
                     Utils::invariant($variableValues !== null, 'Must exist for hasValue to be true.');
274
-                  // Note: This does no further checking that this variable is correct.
275
-                  // This assumes that this query has been validated and the variable
276
-                  // usage here is of the correct type.
274
+                    // Note: This does no further checking that this variable is correct.
275
+                    // This assumes that this query has been validated and the variable
276
+                    // usage here is of the correct type.
277 277
                     $coercedValues[$name] = $variableValues[$variableName] ?? null;
278 278
                 } else {
279 279
                     $valueNode    = $argumentValueNode;
280 280
                     $coercedValue = AST::valueFromAST($valueNode, $argType, $variableValues);
281 281
                     if (Utils::isInvalid($coercedValue)) {
282
-                      // Note: ValuesOfCorrectType validation should catch this before
283
-                      // execution. This is a runtime check to ensure execution does not
284
-                      // continue with an invalid argument value.
282
+                        // Note: ValuesOfCorrectType validation should catch this before
283
+                        // execution. This is a runtime check to ensure execution does not
284
+                        // continue with an invalid argument value.
285 285
                         throw new Error(
286 286
                             'Argument "' . $name . '" has invalid value ' . Printer::doPrint($valueNode) . '.',
287 287
                             [$argumentValueNode]
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             /** @var InputType|Type $varType */
68 68
             $varType = TypeInfo::typeFromAST($schema, $varDefNode->type);
69 69
 
70
-            if (! Type::isInputType($varType)) {
70
+            if (!Type::isInputType($varType)) {
71 71
                 // Must use input types for variables. This should be caught during
72 72
                 // validation, however is checked again here for safety.
73 73
                 $errors[] = new Error(
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
                 $hasValue = array_key_exists($varName, $inputs);
83 83
                 $value    = $hasValue ? $inputs[$varName] : Utils::undefined();
84 84
 
85
-                if (! $hasValue && $varDefNode->defaultValue) {
85
+                if (!$hasValue && $varDefNode->defaultValue) {
86 86
                     // If no value was provided to a variable with a default value,
87 87
                     // use the default value.
88 88
                     $coercedValues[$varName] = AST::valueFromAST($varDefNode->defaultValue, $varType);
89
-                } elseif ((! $hasValue || $value === null) && ($varType instanceof NonNull)) {
89
+                } elseif ((!$hasValue || $value === null) && ($varType instanceof NonNull)) {
90 90
                     // If no value or a nullish value was provided to a variable with a
91 91
                     // non-null type (required), produce an error.
92 92
                     $errors[] = new Error(
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             }
137 137
         }
138 138
 
139
-        if (! empty($errors)) {
139
+        if (!empty($errors)) {
140 140
             return [$errors, null];
141 141
         }
142 142
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         if (isset($node->directives) && $node->directives instanceof NodeList) {
161 161
             $directiveNode = Utils::find(
162 162
                 $node->directives,
163
-                static function (DirectiveNode $directive) use ($directiveDef) {
163
+                static function(DirectiveNode $directive) use ($directiveDef) {
164 164
                     return $directive->name->value === $directiveDef->name;
165 165
                 }
166 166
             );
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
                 $isNull   = $argumentValueNode instanceof NullValueNode;
234 234
             }
235 235
 
236
-            if (! $hasValue && $argumentDefinition->defaultValueExists()) {
236
+            if (!$hasValue && $argumentDefinition->defaultValueExists()) {
237 237
                 // If no argument was provided where the definition has a default value,
238 238
                 // use the default value.
239 239
                 $coercedValues[$name] = $argumentDefinition->defaultValue;
240
-            } elseif ((! $hasValue || $isNull) && ($argType instanceof NonNull)) {
240
+            } elseif ((!$hasValue || $isNull) && ($argType instanceof NonNull)) {
241 241
                 // If no argument or a null value was provided to an argument with a
242 242
                 // non-null type (required), produce a field error.
243 243
                 if ($isNull) {
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
         return $errors
329 329
             ? array_map(
330
-                static function (Throwable $error) {
330
+                static function(Throwable $error) {
331 331
                     return $error->getMessage();
332 332
                 },
333 333
                 $errors
Please login to merge, or discard this patch.
src/Executor/ReferenceExecutor.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     private function __construct(ExecutionContext $context)
63 63
     {
64
-        if (! self::$UNDEFINED) {
64
+        if (!self::$UNDEFINED) {
65 65
             self::$UNDEFINED = Utils::undefined();
66 66
         }
67 67
         $this->exeContext    = $context;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                 $errors = array_merge($errors, $coercionErrors);
177 177
             }
178 178
         }
179
-        if (! empty($errors)) {
179
+        if (!empty($errors)) {
180 180
             return $errors;
181 181
         }
182 182
         Utils::invariant($operation, 'Has operation if no errors.');
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     private function buildResponse($data)
223 223
     {
224 224
         if ($this->isPromise($data)) {
225
-            return $data->then(function ($resolved) {
225
+            return $data->then(function($resolved) {
226 226
                 return $this->buildResponse($resolved);
227 227
             });
228 228
         }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
             if ($this->isPromise($result)) {
258 258
                 return $result->then(
259 259
                     null,
260
-                    function ($error) {
260
+                    function($error) {
261 261
                         if ($error instanceof Error) {
262 262
                             $this->exeContext->addError($error);
263 263
 
@@ -346,18 +346,18 @@  discard block
 block discarded – undo
346 346
         foreach ($selectionSet->selections as $selection) {
347 347
             switch (true) {
348 348
                 case $selection instanceof FieldNode:
349
-                    if (! $this->shouldIncludeNode($selection)) {
349
+                    if (!$this->shouldIncludeNode($selection)) {
350 350
                         break;
351 351
                     }
352 352
                     $name = self::getFieldEntryKey($selection);
353
-                    if (! isset($fields[$name])) {
353
+                    if (!isset($fields[$name])) {
354 354
                         $fields[$name] = new ArrayObject();
355 355
                     }
356 356
                     $fields[$name][] = $selection;
357 357
                     break;
358 358
                 case $selection instanceof InlineFragmentNode:
359
-                    if (! $this->shouldIncludeNode($selection) ||
360
-                        ! $this->doesFragmentConditionMatch($selection, $runtimeType)
359
+                    if (!$this->shouldIncludeNode($selection) ||
360
+                        !$this->doesFragmentConditionMatch($selection, $runtimeType)
361 361
                     ) {
362 362
                         break;
363 363
                     }
@@ -370,13 +370,13 @@  discard block
 block discarded – undo
370 370
                     break;
371 371
                 case $selection instanceof FragmentSpreadNode:
372 372
                     $fragName = $selection->name->value;
373
-                    if (! empty($visitedFragmentNames[$fragName]) || ! $this->shouldIncludeNode($selection)) {
373
+                    if (!empty($visitedFragmentNames[$fragName]) || !$this->shouldIncludeNode($selection)) {
374 374
                         break;
375 375
                     }
376 376
                     $visitedFragmentNames[$fragName] = true;
377 377
                     /** @var FragmentDefinitionNode|null $fragment */
378 378
                     $fragment = $exeContext->fragments[$fragName] ?? null;
379
-                    if ($fragment === null || ! $this->doesFragmentConditionMatch($fragment, $runtimeType)) {
379
+                    if ($fragment === null || !$this->doesFragmentConditionMatch($fragment, $runtimeType)) {
380 380
                         break;
381 381
                     }
382 382
                     $this->collectFields(
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
             $variableValues
418 418
         );
419 419
 
420
-        return ! isset($include['if']) || $include['if'] !== false;
420
+        return !isset($include['if']) || $include['if'] !== false;
421 421
     }
422 422
 
423 423
     /**
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
     {
469 469
         $result = $this->promiseReduce(
470 470
             array_keys($fields->getArrayCopy()),
471
-            function ($results, $responseName) use ($path, $parentType, $rootValue, $fields) {
471
+            function($results, $responseName) use ($path, $parentType, $rootValue, $fields) {
472 472
                 $fieldNodes  = $fields[$responseName];
473 473
                 $fieldPath   = $path;
474 474
                 $fieldPath[] = $responseName;
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
                 }
479 479
                 $promise = $this->getPromise($result);
480 480
                 if ($promise !== null) {
481
-                    return $promise->then(static function ($resolvedResult) use ($responseName, $results) {
481
+                    return $promise->then(static function($resolvedResult) use ($responseName, $results) {
482 482
                         $results[$responseName] = $resolvedResult;
483 483
 
484 484
                         return $results;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
         );
493 493
 
494 494
         if ($this->isPromise($result)) {
495
-            return $result->then(static function ($resolvedResults) {
495
+            return $result->then(static function($resolvedResults) {
496 496
                 return self::fixResultsIfEmptyArray($resolvedResults);
497 497
             });
498 498
         }
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         try {
617 617
             // Build a map of arguments from the field.arguments AST, using the
618 618
             // variables scope to fulfill any variable references.
619
-            $args         = Values::getArgumentValues(
619
+            $args = Values::getArgumentValues(
620 620
                 $fieldDef,
621 621
                 $fieldNode,
622 622
                 $this->exeContext->variableValues
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
         try {
652 652
             $promise = $this->getPromise($result);
653 653
             if ($promise !== null) {
654
-                $completed = $promise->then(function (&$resolved) use ($returnType, $fieldNodes, $info, $path) {
654
+                $completed = $promise->then(function(&$resolved) use ($returnType, $fieldNodes, $info, $path) {
655 655
                     return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolved);
656 656
                 });
657 657
             } else {
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
             $promise = $this->getPromise($completed);
662 662
             if ($promise !== null) {
663
-                return $promise->then(null, function ($error) use ($fieldNodes, $path, $returnType) {
663
+                return $promise->then(null, function($error) use ($fieldNodes, $path, $returnType) {
664 664
                     return $this->handleFieldError($error, $fieldNodes, $path, $returnType);
665 665
                 });
666 666
             }
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
         }
820 820
         if ($this->exeContext->promiseAdapter->isThenable($value)) {
821 821
             $promise = $this->exeContext->promiseAdapter->convertThenable($value);
822
-            if (! $promise instanceof Promise) {
822
+            if (!$promise instanceof Promise) {
823 823
                 throw new InvariantViolation(sprintf(
824 824
                     '%s::convertThenable is expected to return instance of GraphQL\Executor\Promise\Promise, got: %s',
825 825
                     get_class($this->exeContext->promiseAdapter),
@@ -849,10 +849,10 @@  discard block
 block discarded – undo
849 849
     {
850 850
         return array_reduce(
851 851
             $values,
852
-            function ($previous, $value) use ($callback) {
852
+            function($previous, $value) use ($callback) {
853 853
                 $promise = $this->getPromise($previous);
854 854
                 if ($promise !== null) {
855
-                    return $promise->then(static function ($resolved) use ($callback, $value) {
855
+                    return $promise->then(static function($resolved) use ($callback, $value) {
856 856
                         return $callback($resolved, $value);
857 857
                     });
858 858
                 }
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
             $fieldPath[]   = $i++;
890 890
             $info->path    = $fieldPath;
891 891
             $completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item);
892
-            if (! $containsPromise && $this->getPromise($completedItem) !== null) {
892
+            if (!$containsPromise && $this->getPromise($completedItem) !== null) {
893 893
                 $containsPromise = true;
894 894
             }
895 895
             $completedItems[] = $completedItem;
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
         }
944 944
         $promise = $this->getPromise($runtimeType);
945 945
         if ($promise !== null) {
946
-            return $promise->then(function ($resolvedRuntimeType) use (
946
+            return $promise->then(function($resolvedRuntimeType) use (
947 947
                 $returnType,
948 948
                 $fieldNodes,
949 949
                 $info,
@@ -1034,9 +1034,9 @@  discard block
 block discarded – undo
1034 1034
                 return $type;
1035 1035
             }
1036 1036
         }
1037
-        if (! empty($promisedIsTypeOfResults)) {
1037
+        if (!empty($promisedIsTypeOfResults)) {
1038 1038
             return $this->exeContext->promiseAdapter->all($promisedIsTypeOfResults)
1039
-                ->then(static function ($isTypeOfResults) use ($possibleTypes) {
1039
+                ->then(static function($isTypeOfResults) use ($possibleTypes) {
1040 1040
                     foreach ($isTypeOfResults as $index => $result) {
1041 1041
                         if ($result) {
1042 1042
                             return $possibleTypes[$index];
@@ -1070,13 +1070,13 @@  discard block
 block discarded – undo
1070 1070
         if ($isTypeOf !== null) {
1071 1071
             $promise = $this->getPromise($isTypeOf);
1072 1072
             if ($promise !== null) {
1073
-                return $promise->then(function ($isTypeOfResult) use (
1073
+                return $promise->then(function($isTypeOfResult) use (
1074 1074
                     $returnType,
1075 1075
                     $fieldNodes,
1076 1076
                     $path,
1077 1077
                     &$result
1078 1078
                 ) {
1079
-                    if (! $isTypeOfResult) {
1079
+                    if (!$isTypeOfResult) {
1080 1080
                         throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes);
1081 1081
                     }
1082 1082
 
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
                     );
1089 1089
                 });
1090 1090
             }
1091
-            if (! $isTypeOf) {
1091
+            if (!$isTypeOf) {
1092 1092
                 throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes);
1093 1093
             }
1094 1094
         }
@@ -1147,15 +1147,15 @@  discard block
 block discarded – undo
1147 1147
      */
1148 1148
     private function collectSubFields(ObjectType $returnType, $fieldNodes) : ArrayObject
1149 1149
     {
1150
-        if (! isset($this->subFieldCache[$returnType])) {
1150
+        if (!isset($this->subFieldCache[$returnType])) {
1151 1151
             $this->subFieldCache[$returnType] = new SplObjectStorage();
1152 1152
         }
1153
-        if (! isset($this->subFieldCache[$returnType][$fieldNodes])) {
1153
+        if (!isset($this->subFieldCache[$returnType][$fieldNodes])) {
1154 1154
             // Collect sub-fields to execute to complete this value.
1155 1155
             $subFieldNodes        = new ArrayObject();
1156 1156
             $visitedFragmentNames = new ArrayObject();
1157 1157
             foreach ($fieldNodes as $fieldNode) {
1158
-                if (! isset($fieldNode->selectionSet)) {
1158
+                if (!isset($fieldNode->selectionSet)) {
1159 1159
                     continue;
1160 1160
                 }
1161 1161
                 $subFieldNodes = $this->collectFields(
@@ -1192,13 +1192,13 @@  discard block
 block discarded – undo
1192 1192
             if ($result === self::$UNDEFINED) {
1193 1193
                 continue;
1194 1194
             }
1195
-            if (! $containsPromise && $this->isPromise($result)) {
1195
+            if (!$containsPromise && $this->isPromise($result)) {
1196 1196
                 $containsPromise = true;
1197 1197
             }
1198 1198
             $results[$responseName] = $result;
1199 1199
         }
1200 1200
         // If there are no promises, we can just return the object
1201
-        if (! $containsPromise) {
1201
+        if (!$containsPromise) {
1202 1202
             return self::fixResultsIfEmptyArray($results);
1203 1203
         }
1204 1204
 
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
         $valuesAndPromises = array_values($assoc);
1242 1242
         $promise           = $this->exeContext->promiseAdapter->all($valuesAndPromises);
1243 1243
 
1244
-        return $promise->then(static function ($values) use ($keys) {
1244
+        return $promise->then(static function($values) use ($keys) {
1245 1245
             $resolvedResults = [];
1246 1246
             foreach ($values as $i => $value) {
1247 1247
                 $resolvedResults[$keys[$i]] = $value;
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
         $runtimeType = is_string($runtimeTypeOrName)
1268 1268
             ? $this->exeContext->schema->getType($runtimeTypeOrName)
1269 1269
             : $runtimeTypeOrName;
1270
-        if (! $runtimeType instanceof ObjectType) {
1270
+        if (!$runtimeType instanceof ObjectType) {
1271 1271
             throw new InvariantViolation(
1272 1272
                 sprintf(
1273 1273
                     'Abstract type %s must resolve to an Object type at ' .
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
                 )
1284 1284
             );
1285 1285
         }
1286
-        if (! $this->exeContext->schema->isPossibleType($returnType, $runtimeType)) {
1286
+        if (!$this->exeContext->schema->isPossibleType($returnType, $runtimeType)) {
1287 1287
             throw new InvariantViolation(
1288 1288
                 sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeType, $returnType)
1289 1289
             );
Please login to merge, or discard this patch.
src/Type/Schema.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
                 Utils::getVariableType($config)
110 110
             );
111 111
             Utils::invariant(
112
-                ! $config->types || is_array($config->types) || is_callable($config->types),
112
+                !$config->types || is_array($config->types) || is_callable($config->types),
113 113
                 '"types" must be array or callable if provided but got: ' . Utils::getVariableType($config->types)
114 114
             );
115 115
             Utils::invariant(
116
-                ! $config->directives || is_array($config->directives),
116
+                !$config->directives || is_array($config->directives),
117 117
                 '"directives" must be Array if provided but got: ' . Utils::getVariableType($config->directives)
118 118
             );
119 119
         }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             $types = $types();
166 166
         }
167 167
 
168
-        if (! is_array($types) && ! $types instanceof Traversable) {
168
+        if (!is_array($types) && !$types instanceof Traversable) {
169 169
             throw new InvariantViolation(sprintf(
170 170
                 'Schema types callable must return array or instance of Traversable but got: %s',
171 171
                 Utils::getVariableType($types)
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         }
174 174
 
175 175
         foreach ($types as $index => $type) {
176
-            if (! $type instanceof Type) {
176
+            if (!$type instanceof Type) {
177 177
                 throw new InvariantViolation(sprintf(
178 178
                     'Each entry of schema types must be instance of GraphQL\Type\Definition\Type but entry at %s is %s',
179 179
                     $index,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function getTypeMap()
198 198
     {
199
-        if (! $this->fullyLoaded) {
199
+        if (!$this->fullyLoaded) {
200 200
             $this->resolvedTypes = $this->collectAllTypes();
201 201
             $this->fullyLoaded   = true;
202 202
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             $typeMap = TypeInfo::extractTypes($type, $typeMap);
215 215
         }
216 216
         foreach ($this->getDirectives() as $directive) {
217
-            if (! ($directive instanceof Directive)) {
217
+            if (!($directive instanceof Directive)) {
218 218
                 continue;
219 219
             }
220 220
 
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
      */
315 315
     public function getType(string $name) : ?Type
316 316
     {
317
-        if (! isset($this->resolvedTypes[$name])) {
317
+        if (!isset($this->resolvedTypes[$name])) {
318 318
             $type = $this->loadType($name);
319
-            if (! $type) {
319
+            if (!$type) {
320 320
                 return null;
321 321
             }
322 322
             $this->resolvedTypes[$name] = $type;
@@ -334,13 +334,13 @@  discard block
 block discarded – undo
334 334
     {
335 335
         $typeLoader = $this->config->typeLoader;
336 336
 
337
-        if (! $typeLoader) {
337
+        if (!$typeLoader) {
338 338
             return $this->defaultTypeLoader($typeName);
339 339
         }
340 340
 
341 341
         $type = $typeLoader($typeName);
342 342
 
343
-        if (! $type instanceof Type) {
343
+        if (!$type instanceof Type) {
344 344
             throw new InvariantViolation(
345 345
                 sprintf(
346 346
                     'Type loader is expected to return valid type "%s", but it returned %s',
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             foreach ($this->getTypeMap() as $type) {
396 396
                 if ($type instanceof ObjectType) {
397 397
                     foreach ($type->getInterfaces() as $interface) {
398
-                        if (! ($interface instanceof InterfaceType)) {
398
+                        if (!($interface instanceof InterfaceType)) {
399 399
                             continue;
400 400
                         }
401 401
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             $type->assertValid();
482 482
 
483 483
             // Make sure type loader returns the same instance as registered in other places of schema
484
-            if (! $this->config->typeLoader) {
484
+            if (!$this->config->typeLoader) {
485 485
                 continue;
486 486
             }
487 487
 
Please login to merge, or discard this patch.
src/Type/Definition/IntType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
     {
78 78
         $isInt = is_int($value) || (is_float($value) && floor($value) === $value);
79 79
 
80
-        if (! $isInt) {
80
+        if (!$isInt) {
81 81
             throw new Error(
82 82
                 'Int cannot represent non-integer value: ' .
83 83
                 Utils::printSafe($value)
Please login to merge, or discard this patch.
src/Type/Definition/UnionType.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function __construct(array $config)
35 35
     {
36
-        if (! isset($config['name'])) {
36
+        if (!isset($config['name'])) {
37 37
             $config['name'] = $this->tryInferName();
38 38
         }
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function isPossibleType(Type $type) : bool
55 55
     {
56
-        if (! $type instanceof ObjectType) {
56
+        if (!$type instanceof ObjectType) {
57 57
             return false;
58 58
         }
59 59
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function getTypes()
74 74
     {
75 75
         if ($this->types === null) {
76
-            if (! isset($this->config['types'])) {
76
+            if (!isset($this->config['types'])) {
77 77
                 $types = null;
78 78
             } elseif (is_callable($this->config['types'])) {
79 79
                 $types = call_user_func($this->config['types']);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                 $types = $this->config['types'];
82 82
             }
83 83
 
84
-            if (! is_array($types)) {
84
+            if (!is_array($types)) {
85 85
                 throw new InvariantViolation(
86 86
                     sprintf(
87 87
                         'Must provide Array of types or a callable which returns such an array for Union %s',
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     {
123 123
         parent::assertValid();
124 124
 
125
-        if (! isset($this->config['resolveType'])) {
125
+        if (!isset($this->config['resolveType'])) {
126 126
             return;
127 127
         }
128 128
 
Please login to merge, or discard this patch.