@@ -80,12 +80,12 @@ |
||
80 | 80 | // TODO: rework with generators when PHP minimum required version is changed to 5.5+ |
81 | 81 | $promisesOrValues = Utils::map( |
82 | 82 | $promisesOrValues, |
83 | - function ($item) { |
|
83 | + function($item) { |
|
84 | 84 | return $item instanceof Promise ? $item->adoptedPromise : $item; |
85 | 85 | } |
86 | 86 | ); |
87 | 87 | |
88 | - $promise = all($promisesOrValues)->then(function ($values) use ($promisesOrValues) { |
|
88 | + $promise = all($promisesOrValues)->then(function($values) use ($promisesOrValues) { |
|
89 | 89 | $orderedResults = []; |
90 | 90 | |
91 | 91 | foreach ($promisesOrValues as $key => $value) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public static function runQueue() |
41 | 41 | { |
42 | 42 | $q = self::$queue; |
43 | - while ($q && ! $q->isEmpty()) { |
|
43 | + while ($q && !$q->isEmpty()) { |
|
44 | 44 | $task = $q->dequeue(); |
45 | 45 | $task(); |
46 | 46 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | } |
56 | 56 | if (is_object($value) && method_exists($value, 'then')) { |
57 | 57 | $value->then( |
58 | - function ($resolvedValue) { |
|
58 | + function($resolvedValue) { |
|
59 | 59 | $this->resolve($resolvedValue); |
60 | 60 | }, |
61 | - function ($reason) { |
|
61 | + function($reason) { |
|
62 | 62 | $this->reject($reason); |
63 | 63 | } |
64 | 64 | ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | public function reject($reason) |
86 | 86 | { |
87 | - if (! $reason instanceof \Exception && ! $reason instanceof \Throwable) { |
|
87 | + if (!$reason instanceof \Exception && !$reason instanceof \Throwable) { |
|
88 | 88 | throw new \Exception('SyncPromise::reject() has to be called with an instance of \Throwable'); |
89 | 89 | } |
90 | 90 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ); |
115 | 115 | |
116 | 116 | foreach ($this->waiting as $descriptor) { |
117 | - self::getQueue()->enqueue(function () use ($descriptor) { |
|
117 | + self::getQueue()->enqueue(function() use ($descriptor) { |
|
118 | 118 | /** @var $promise self */ |
119 | 119 | list($promise, $onFulfilled, $onRejected) = $descriptor; |
120 | 120 | |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | |
152 | 152 | public function then(?callable $onFulfilled = null, ?callable $onRejected = null) |
153 | 153 | { |
154 | - if ($this->state === self::REJECTED && ! $onRejected) { |
|
154 | + if ($this->state === self::REJECTED && !$onRejected) { |
|
155 | 155 | return $this; |
156 | 156 | } |
157 | - if ($this->state === self::FULFILLED && ! $onFulfilled) { |
|
157 | + if ($this->state === self::FULFILLED && !$onFulfilled) { |
|
158 | 158 | return $this; |
159 | 159 | } |
160 | 160 | $tmp = new self(); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function convertThenable($thenable) |
33 | 33 | { |
34 | - if (! $thenable instanceof Deferred) { |
|
34 | + if (!$thenable instanceof Deferred) { |
|
35 | 35 | throw new InvariantViolation('Expected instance of GraphQL\Deferred, got ' . Utils::printSafe($thenable)); |
36 | 36 | } |
37 | 37 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($promiseOrValue instanceof Promise) { |
112 | 112 | $result[$index] = null; |
113 | 113 | $promiseOrValue->then( |
114 | - function ($value) use ($index, &$count, $total, &$result, $all) { |
|
114 | + function($value) use ($index, &$count, $total, &$result, $all) { |
|
115 | 115 | $result[$index] = $value; |
116 | 116 | $count++; |
117 | 117 | if ($count < $total) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $promiseQueue = SyncPromise::getQueue(); |
147 | 147 | |
148 | 148 | while ($promise->adoptedPromise->state === SyncPromise::PENDING && |
149 | - ! ($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
149 | + !($dfdQueue->isEmpty() && $promiseQueue->isEmpty()) |
|
150 | 150 | ) { |
151 | 151 | Deferred::runQueue(); |
152 | 152 | SyncPromise::runQueue(); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function __construct($adoptedPromise, PromiseAdapter $adapter) |
25 | 25 | { |
26 | - Utils::invariant(! $adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . __CLASS__); |
|
26 | + Utils::invariant(!$adoptedPromise instanceof self, 'Expecting promise from adapted system, got ' . __CLASS__); |
|
27 | 27 | |
28 | 28 | $this->adapter = $adapter; |
29 | 29 | $this->adoptedPromise = $adoptedPromise; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | private function __construct(ExecutionContext $context) |
66 | 66 | { |
67 | - if (! self::$UNDEFINED) { |
|
67 | + if (!self::$UNDEFINED) { |
|
68 | 68 | self::$UNDEFINED = Utils::undefined(); |
69 | 69 | } |
70 | 70 | |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | foreach ($documentNode->definitions as $definition) { |
213 | 213 | switch ($definition->kind) { |
214 | 214 | case NodeKind::OPERATION_DEFINITION: |
215 | - if (! $operationName && $operation) { |
|
215 | + if (!$operationName && $operation) { |
|
216 | 216 | $hasMultipleAssumedOperations = true; |
217 | 217 | } |
218 | - if (! $operationName || |
|
218 | + if (!$operationName || |
|
219 | 219 | (isset($definition->name) && $definition->name->value === $operationName)) { |
220 | 220 | $operation = $definition; |
221 | 221 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
229 | - if (! $operation) { |
|
229 | + if (!$operation) { |
|
230 | 230 | if ($operationName) { |
231 | 231 | $errors[] = new Error(sprintf('Unknown operation named "%s".', $operationName)); |
232 | 232 | } else { |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | // field and its descendants will be omitted, and sibling fields will still |
286 | 286 | // be executed. An execution which encounters errors will still result in a |
287 | 287 | // resolved Promise. |
288 | - $result = $this->exeContext->promises->create(function (callable $resolve) { |
|
288 | + $result = $this->exeContext->promises->create(function(callable $resolve) { |
|
289 | 289 | return $resolve($this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue)); |
290 | 290 | }); |
291 | 291 | |
292 | 292 | return $result |
293 | 293 | ->then( |
294 | 294 | null, |
295 | - function ($error) { |
|
295 | + function($error) { |
|
296 | 296 | // Errors from sub-fields of a NonNull type may propagate to the top level, |
297 | 297 | // at which point we still log the error and null the parent field, which |
298 | 298 | // in this case is the entire response. |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | return null; |
302 | 302 | } |
303 | 303 | ) |
304 | - ->then(function ($data) { |
|
304 | + ->then(function($data) { |
|
305 | 305 | if ($data !== null) { |
306 | 306 | $data = (array) $data; |
307 | 307 | } |
@@ -330,14 +330,13 @@ discard block |
||
330 | 330 | // Similar to completeValueCatchingError. |
331 | 331 | try { |
332 | 332 | $result = $operation->operation === 'mutation' ? |
333 | - $this->executeFieldsSerially($type, $rootValue, $path, $fields) : |
|
334 | - $this->executeFields($type, $rootValue, $path, $fields); |
|
333 | + $this->executeFieldsSerially($type, $rootValue, $path, $fields) : $this->executeFields($type, $rootValue, $path, $fields); |
|
335 | 334 | |
336 | 335 | $promise = $this->getPromise($result); |
337 | 336 | if ($promise) { |
338 | 337 | return $promise->then( |
339 | 338 | null, |
340 | - function ($error) { |
|
339 | + function($error) { |
|
341 | 340 | $this->exeContext->addError($error); |
342 | 341 | |
343 | 342 | return null; |
@@ -364,7 +363,7 @@ discard block |
||
364 | 363 | switch ($operation->operation) { |
365 | 364 | case 'query': |
366 | 365 | $queryType = $schema->getQueryType(); |
367 | - if (! $queryType) { |
|
366 | + if (!$queryType) { |
|
368 | 367 | throw new Error( |
369 | 368 | 'Schema does not define the required query root type.', |
370 | 369 | [$operation] |
@@ -374,7 +373,7 @@ discard block |
||
374 | 373 | return $queryType; |
375 | 374 | case 'mutation': |
376 | 375 | $mutationType = $schema->getMutationType(); |
377 | - if (! $mutationType) { |
|
376 | + if (!$mutationType) { |
|
378 | 377 | throw new Error( |
379 | 378 | 'Schema is not configured for mutations.', |
380 | 379 | [$operation] |
@@ -384,7 +383,7 @@ discard block |
||
384 | 383 | return $mutationType; |
385 | 384 | case 'subscription': |
386 | 385 | $subscriptionType = $schema->getSubscriptionType(); |
387 | - if (! $subscriptionType) { |
|
386 | + if (!$subscriptionType) { |
|
388 | 387 | throw new Error( |
389 | 388 | 'Schema is not configured for subscriptions.', |
390 | 389 | [$operation] |
@@ -423,18 +422,18 @@ discard block |
||
423 | 422 | foreach ($selectionSet->selections as $selection) { |
424 | 423 | switch ($selection->kind) { |
425 | 424 | case NodeKind::FIELD: |
426 | - if (! $this->shouldIncludeNode($selection)) { |
|
425 | + if (!$this->shouldIncludeNode($selection)) { |
|
427 | 426 | break; |
428 | 427 | } |
429 | 428 | $name = self::getFieldEntryKey($selection); |
430 | - if (! isset($fields[$name])) { |
|
429 | + if (!isset($fields[$name])) { |
|
431 | 430 | $fields[$name] = new \ArrayObject(); |
432 | 431 | } |
433 | 432 | $fields[$name][] = $selection; |
434 | 433 | break; |
435 | 434 | case NodeKind::INLINE_FRAGMENT: |
436 | - if (! $this->shouldIncludeNode($selection) || |
|
437 | - ! $this->doesFragmentConditionMatch($selection, $runtimeType) |
|
435 | + if (!$this->shouldIncludeNode($selection) || |
|
436 | + !$this->doesFragmentConditionMatch($selection, $runtimeType) |
|
438 | 437 | ) { |
439 | 438 | break; |
440 | 439 | } |
@@ -447,14 +446,14 @@ discard block |
||
447 | 446 | break; |
448 | 447 | case NodeKind::FRAGMENT_SPREAD: |
449 | 448 | $fragName = $selection->name->value; |
450 | - if (! empty($visitedFragmentNames[$fragName]) || ! $this->shouldIncludeNode($selection)) { |
|
449 | + if (!empty($visitedFragmentNames[$fragName]) || !$this->shouldIncludeNode($selection)) { |
|
451 | 450 | break; |
452 | 451 | } |
453 | 452 | $visitedFragmentNames[$fragName] = true; |
454 | 453 | |
455 | 454 | /** @var FragmentDefinitionNode|null $fragment */ |
456 | 455 | $fragment = $exeContext->fragments[$fragName] ?? null; |
457 | - if (! $fragment || ! $this->doesFragmentConditionMatch($fragment, $runtimeType)) { |
|
456 | + if (!$fragment || !$this->doesFragmentConditionMatch($fragment, $runtimeType)) { |
|
458 | 457 | break; |
459 | 458 | } |
460 | 459 | $this->collectFields( |
@@ -557,7 +556,7 @@ discard block |
||
557 | 556 | { |
558 | 557 | $prevPromise = $this->exeContext->promises->createFulfilled([]); |
559 | 558 | |
560 | - $process = function ($results, $responseName, $path, $parentType, $sourceValue, $fieldNodes) { |
|
559 | + $process = function($results, $responseName, $path, $parentType, $sourceValue, $fieldNodes) { |
|
561 | 560 | $fieldPath = $path; |
562 | 561 | $fieldPath[] = $responseName; |
563 | 562 | $result = $this->resolveField($parentType, $sourceValue, $fieldNodes, $fieldPath); |
@@ -566,7 +565,7 @@ discard block |
||
566 | 565 | } |
567 | 566 | $promise = $this->getPromise($result); |
568 | 567 | if ($promise) { |
569 | - return $promise->then(function ($resolvedResult) use ($responseName, $results) { |
|
568 | + return $promise->then(function($resolvedResult) use ($responseName, $results) { |
|
570 | 569 | $results[$responseName] = $resolvedResult; |
571 | 570 | |
572 | 571 | return $results; |
@@ -578,7 +577,7 @@ discard block |
||
578 | 577 | }; |
579 | 578 | |
580 | 579 | foreach ($fields as $responseName => $fieldNodes) { |
581 | - $prevPromise = $prevPromise->then(function ($resolvedResults) use ( |
|
580 | + $prevPromise = $prevPromise->then(function($resolvedResults) use ( |
|
582 | 581 | $process, |
583 | 582 | $responseName, |
584 | 583 | $path, |
@@ -590,7 +589,7 @@ discard block |
||
590 | 589 | }); |
591 | 590 | } |
592 | 591 | |
593 | - return $prevPromise->then(function ($resolvedResults) { |
|
592 | + return $prevPromise->then(function($resolvedResults) { |
|
594 | 593 | return self::fixResultsIfEmptyArray($resolvedResults); |
595 | 594 | }); |
596 | 595 | } |
@@ -615,7 +614,7 @@ discard block |
||
615 | 614 | $fieldName = $fieldNode->name->value; |
616 | 615 | $fieldDef = $this->getFieldDef($exeContext->schema, $parentType, $fieldName); |
617 | 616 | |
618 | - if (! $fieldDef) { |
|
617 | + if (!$fieldDef) { |
|
619 | 618 | return self::$UNDEFINED; |
620 | 619 | } |
621 | 620 | |
@@ -781,7 +780,7 @@ discard block |
||
781 | 780 | if ($promise) { |
782 | 781 | return $promise->then( |
783 | 782 | null, |
784 | - function ($error) use ($exeContext) { |
|
783 | + function($error) use ($exeContext) { |
|
785 | 784 | $exeContext->addError($error); |
786 | 785 | |
787 | 786 | return $this->exeContext->promises->createFulfilled(null); |
@@ -824,11 +823,11 @@ discard block |
||
824 | 823 | $path, |
825 | 824 | $result |
826 | 825 | ); |
827 | - $promise = $this->getPromise($completed); |
|
826 | + $promise = $this->getPromise($completed); |
|
828 | 827 | if ($promise) { |
829 | 828 | return $promise->then( |
830 | 829 | null, |
831 | - function ($error) use ($fieldNodes, $path) { |
|
830 | + function($error) use ($fieldNodes, $path) { |
|
832 | 831 | return $this->exeContext->promises->createRejected(Error::createLocatedError( |
833 | 832 | $error, |
834 | 833 | $fieldNodes, |
@@ -885,7 +884,7 @@ discard block |
||
885 | 884 | |
886 | 885 | // If result is a Promise, apply-lift over completeValue. |
887 | 886 | if ($promise) { |
888 | - return $promise->then(function (&$resolved) use ($returnType, $fieldNodes, $info, $path) { |
|
887 | + return $promise->then(function(&$resolved) use ($returnType, $fieldNodes, $info, $path) { |
|
889 | 888 | return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolved); |
890 | 889 | }); |
891 | 890 | } |
@@ -976,7 +975,7 @@ discard block |
||
976 | 975 | } |
977 | 976 | if ($this->exeContext->promises->isThenable($value)) { |
978 | 977 | $promise = $this->exeContext->promises->convertThenable($value); |
979 | - if (! $promise instanceof Promise) { |
|
978 | + if (!$promise instanceof Promise) { |
|
980 | 979 | throw new InvariantViolation(sprintf( |
981 | 980 | '%s::convertThenable is expected to return instance of GraphQL\Executor\Promise\Promise, got: %s', |
982 | 981 | get_class($this->exeContext->promises), |
@@ -1015,7 +1014,7 @@ discard block |
||
1015 | 1014 | $fieldPath = $path; |
1016 | 1015 | $fieldPath[] = $i++; |
1017 | 1016 | $completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item); |
1018 | - if (! $containsPromise && $this->getPromise($completedItem)) { |
|
1017 | + if (!$containsPromise && $this->getPromise($completedItem)) { |
|
1019 | 1018 | $containsPromise = true; |
1020 | 1019 | } |
1021 | 1020 | $completedItems[] = $completedItem; |
@@ -1071,7 +1070,7 @@ discard block |
||
1071 | 1070 | |
1072 | 1071 | $promise = $this->getPromise($runtimeType); |
1073 | 1072 | if ($promise) { |
1074 | - return $promise->then(function ($resolvedRuntimeType) use ( |
|
1073 | + return $promise->then(function($resolvedRuntimeType) use ( |
|
1075 | 1074 | $returnType, |
1076 | 1075 | $fieldNodes, |
1077 | 1076 | $info, |
@@ -1165,9 +1164,9 @@ discard block |
||
1165 | 1164 | } |
1166 | 1165 | } |
1167 | 1166 | |
1168 | - if (! empty($promisedIsTypeOfResults)) { |
|
1167 | + if (!empty($promisedIsTypeOfResults)) { |
|
1169 | 1168 | return $this->exeContext->promises->all($promisedIsTypeOfResults) |
1170 | - ->then(function ($isTypeOfResults) use ($possibleTypes) { |
|
1169 | + ->then(function($isTypeOfResults) use ($possibleTypes) { |
|
1171 | 1170 | foreach ($isTypeOfResults as $index => $result) { |
1172 | 1171 | if ($result) { |
1173 | 1172 | return $possibleTypes[$index]; |
@@ -1200,14 +1199,14 @@ discard block |
||
1200 | 1199 | if ($isTypeOf !== null) { |
1201 | 1200 | $promise = $this->getPromise($isTypeOf); |
1202 | 1201 | if ($promise) { |
1203 | - return $promise->then(function ($isTypeOfResult) use ( |
|
1202 | + return $promise->then(function($isTypeOfResult) use ( |
|
1204 | 1203 | $returnType, |
1205 | 1204 | $fieldNodes, |
1206 | 1205 | $info, |
1207 | 1206 | $path, |
1208 | 1207 | &$result |
1209 | 1208 | ) { |
1210 | - if (! $isTypeOfResult) { |
|
1209 | + if (!$isTypeOfResult) { |
|
1211 | 1210 | throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); |
1212 | 1211 | } |
1213 | 1212 | |
@@ -1220,7 +1219,7 @@ discard block |
||
1220 | 1219 | ); |
1221 | 1220 | }); |
1222 | 1221 | } |
1223 | - if (! $isTypeOf) { |
|
1222 | + if (!$isTypeOf) { |
|
1224 | 1223 | throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); |
1225 | 1224 | } |
1226 | 1225 | } |
@@ -1321,14 +1320,14 @@ discard block |
||
1321 | 1320 | if ($result === self::$UNDEFINED) { |
1322 | 1321 | continue; |
1323 | 1322 | } |
1324 | - if (! $containsPromise && $this->getPromise($result)) { |
|
1323 | + if (!$containsPromise && $this->getPromise($result)) { |
|
1325 | 1324 | $containsPromise = true; |
1326 | 1325 | } |
1327 | 1326 | $finalResults[$responseName] = $result; |
1328 | 1327 | } |
1329 | 1328 | |
1330 | 1329 | // If there are no promises, we can just return the object |
1331 | - if (! $containsPromise) { |
|
1330 | + if (!$containsPromise) { |
|
1332 | 1331 | return self::fixResultsIfEmptyArray($finalResults); |
1333 | 1332 | } |
1334 | 1333 | |
@@ -1371,7 +1370,7 @@ discard block |
||
1371 | 1370 | |
1372 | 1371 | $promise = $this->exeContext->promises->all($valuesAndPromises); |
1373 | 1372 | |
1374 | - return $promise->then(function ($values) use ($keys) { |
|
1373 | + return $promise->then(function($values) use ($keys) { |
|
1375 | 1374 | $resolvedResults = []; |
1376 | 1375 | foreach ($values as $i => $value) { |
1377 | 1376 | $resolvedResults[$keys[$i]] = $value; |
@@ -1394,10 +1393,9 @@ discard block |
||
1394 | 1393 | &$result |
1395 | 1394 | ) { |
1396 | 1395 | $runtimeType = is_string($runtimeTypeOrName) ? |
1397 | - $this->exeContext->schema->getType($runtimeTypeOrName) : |
|
1398 | - $runtimeTypeOrName; |
|
1396 | + $this->exeContext->schema->getType($runtimeTypeOrName) : $runtimeTypeOrName; |
|
1399 | 1397 | |
1400 | - if (! $runtimeType instanceof ObjectType) { |
|
1398 | + if (!$runtimeType instanceof ObjectType) { |
|
1401 | 1399 | throw new InvariantViolation( |
1402 | 1400 | sprintf( |
1403 | 1401 | 'Abstract type %s must resolve to an Object type at ' . |
@@ -1414,7 +1412,7 @@ discard block |
||
1414 | 1412 | ); |
1415 | 1413 | } |
1416 | 1414 | |
1417 | - if (! $this->exeContext->schema->isPossibleType($returnType, $runtimeType)) { |
|
1415 | + if (!$this->exeContext->schema->isPossibleType($returnType, $runtimeType)) { |
|
1418 | 1416 | throw new InvariantViolation( |
1419 | 1417 | sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeType, $returnType) |
1420 | 1418 | ); |
@@ -94,16 +94,16 @@ discard block |
||
94 | 94 | $ast, |
95 | 95 | [ |
96 | 96 | 'leave' => [ |
97 | - NodeKind::NAME => function (Node $node) { |
|
97 | + NodeKind::NAME => function(Node $node) { |
|
98 | 98 | return '' . $node->value; |
99 | 99 | }, |
100 | - NodeKind::VARIABLE => function ($node) { |
|
100 | + NodeKind::VARIABLE => function($node) { |
|
101 | 101 | return '$' . $node->name; |
102 | 102 | }, |
103 | - NodeKind::DOCUMENT => function (DocumentNode $node) { |
|
103 | + NodeKind::DOCUMENT => function(DocumentNode $node) { |
|
104 | 104 | return $this->join($node->definitions, "\n\n") . "\n"; |
105 | 105 | }, |
106 | - NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) { |
|
106 | + NodeKind::OPERATION_DEFINITION => function(OperationDefinitionNode $node) { |
|
107 | 107 | $op = $node->operation; |
108 | 108 | $name = $node->name; |
109 | 109 | $varDefs = $this->wrap('(', $this->join($node->variableDefinitions, ', '), ')'); |
@@ -111,17 +111,17 @@ discard block |
||
111 | 111 | $selectionSet = $node->selectionSet; |
112 | 112 | // Anonymous queries with no directives or variable definitions can use |
113 | 113 | // the query short form. |
114 | - return ! $name && ! $directives && ! $varDefs && $op === 'query' |
|
114 | + return !$name && !$directives && !$varDefs && $op === 'query' |
|
115 | 115 | ? $selectionSet |
116 | 116 | : $this->join([$op, $this->join([$name, $varDefs]), $directives, $selectionSet], ' '); |
117 | 117 | }, |
118 | - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) { |
|
118 | + NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $node) { |
|
119 | 119 | return $node->variable . ': ' . $node->type . $this->wrap(' = ', $node->defaultValue); |
120 | 120 | }, |
121 | - NodeKind::SELECTION_SET => function (SelectionSetNode $node) { |
|
121 | + NodeKind::SELECTION_SET => function(SelectionSetNode $node) { |
|
122 | 122 | return $this->block($node->selections); |
123 | 123 | }, |
124 | - NodeKind::FIELD => function (FieldNode $node) { |
|
124 | + NodeKind::FIELD => function(FieldNode $node) { |
|
125 | 125 | return $this->join( |
126 | 126 | [ |
127 | 127 | $this->wrap('', $node->alias, ': ') . $node->name . $this->wrap( |
@@ -135,15 +135,15 @@ discard block |
||
135 | 135 | ' ' |
136 | 136 | ); |
137 | 137 | }, |
138 | - NodeKind::ARGUMENT => function (ArgumentNode $node) { |
|
138 | + NodeKind::ARGUMENT => function(ArgumentNode $node) { |
|
139 | 139 | return $node->name . ': ' . $node->value; |
140 | 140 | }, |
141 | 141 | |
142 | 142 | // Fragments |
143 | - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) { |
|
143 | + NodeKind::FRAGMENT_SPREAD => function(FragmentSpreadNode $node) { |
|
144 | 144 | return '...' . $node->name . $this->wrap(' ', $this->join($node->directives, ' ')); |
145 | 145 | }, |
146 | - NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) { |
|
146 | + NodeKind::INLINE_FRAGMENT => function(InlineFragmentNode $node) { |
|
147 | 147 | return $this->join( |
148 | 148 | [ |
149 | 149 | '...', |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ' ' |
155 | 155 | ); |
156 | 156 | }, |
157 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) { |
|
157 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) { |
|
158 | 158 | // Note: fragment variable definitions are experimental and may be changed |
159 | 159 | // or removed in the future. |
160 | 160 | return sprintf('fragment %s', $node->name) |
@@ -165,56 +165,56 @@ discard block |
||
165 | 165 | }, |
166 | 166 | |
167 | 167 | // Value |
168 | - NodeKind::INT => function (IntValueNode $node) { |
|
168 | + NodeKind::INT => function(IntValueNode $node) { |
|
169 | 169 | return $node->value; |
170 | 170 | }, |
171 | - NodeKind::FLOAT => function (FloatValueNode $node) { |
|
171 | + NodeKind::FLOAT => function(FloatValueNode $node) { |
|
172 | 172 | return $node->value; |
173 | 173 | }, |
174 | - NodeKind::STRING => function (StringValueNode $node, $key) { |
|
174 | + NodeKind::STRING => function(StringValueNode $node, $key) { |
|
175 | 175 | if ($node->block) { |
176 | 176 | return $this->printBlockString($node->value, $key === 'description'); |
177 | 177 | } |
178 | 178 | |
179 | 179 | return json_encode($node->value); |
180 | 180 | }, |
181 | - NodeKind::BOOLEAN => function (BooleanValueNode $node) { |
|
181 | + NodeKind::BOOLEAN => function(BooleanValueNode $node) { |
|
182 | 182 | return $node->value ? 'true' : 'false'; |
183 | 183 | }, |
184 | - NodeKind::NULL => function (NullValueNode $node) { |
|
184 | + NodeKind::NULL => function(NullValueNode $node) { |
|
185 | 185 | return 'null'; |
186 | 186 | }, |
187 | - NodeKind::ENUM => function (EnumValueNode $node) { |
|
187 | + NodeKind::ENUM => function(EnumValueNode $node) { |
|
188 | 188 | return $node->value; |
189 | 189 | }, |
190 | - NodeKind::LST => function (ListValueNode $node) { |
|
190 | + NodeKind::LST => function(ListValueNode $node) { |
|
191 | 191 | return '[' . $this->join($node->values, ', ') . ']'; |
192 | 192 | }, |
193 | - NodeKind::OBJECT => function (ObjectValueNode $node) { |
|
193 | + NodeKind::OBJECT => function(ObjectValueNode $node) { |
|
194 | 194 | return '{' . $this->join($node->fields, ', ') . '}'; |
195 | 195 | }, |
196 | - NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) { |
|
196 | + NodeKind::OBJECT_FIELD => function(ObjectFieldNode $node) { |
|
197 | 197 | return $node->name . ': ' . $node->value; |
198 | 198 | }, |
199 | 199 | |
200 | 200 | // DirectiveNode |
201 | - NodeKind::DIRECTIVE => function (DirectiveNode $node) { |
|
201 | + NodeKind::DIRECTIVE => function(DirectiveNode $node) { |
|
202 | 202 | return '@' . $node->name . $this->wrap('(', $this->join($node->arguments, ', '), ')'); |
203 | 203 | }, |
204 | 204 | |
205 | 205 | // Type |
206 | - NodeKind::NAMED_TYPE => function (NamedTypeNode $node) { |
|
206 | + NodeKind::NAMED_TYPE => function(NamedTypeNode $node) { |
|
207 | 207 | return $node->name; |
208 | 208 | }, |
209 | - NodeKind::LIST_TYPE => function (ListTypeNode $node) { |
|
209 | + NodeKind::LIST_TYPE => function(ListTypeNode $node) { |
|
210 | 210 | return '[' . $node->type . ']'; |
211 | 211 | }, |
212 | - NodeKind::NON_NULL_TYPE => function (NonNullTypeNode $node) { |
|
212 | + NodeKind::NON_NULL_TYPE => function(NonNullTypeNode $node) { |
|
213 | 213 | return $node->type . '!'; |
214 | 214 | }, |
215 | 215 | |
216 | 216 | // Type System Definitions |
217 | - NodeKind::SCHEMA_DEFINITION => function (SchemaDefinitionNode $def) { |
|
217 | + NodeKind::SCHEMA_DEFINITION => function(SchemaDefinitionNode $def) { |
|
218 | 218 | return $this->join( |
219 | 219 | [ |
220 | 220 | 'schema', |
@@ -224,16 +224,16 @@ discard block |
||
224 | 224 | ' ' |
225 | 225 | ); |
226 | 226 | }, |
227 | - NodeKind::OPERATION_TYPE_DEFINITION => function (OperationTypeDefinitionNode $def) { |
|
227 | + NodeKind::OPERATION_TYPE_DEFINITION => function(OperationTypeDefinitionNode $def) { |
|
228 | 228 | return $def->operation . ': ' . $def->type; |
229 | 229 | }, |
230 | 230 | |
231 | - NodeKind::SCALAR_TYPE_DEFINITION => $this->addDescription(function ( |
|
231 | + NodeKind::SCALAR_TYPE_DEFINITION => $this->addDescription(function( |
|
232 | 232 | ScalarTypeDefinitionNode $def |
233 | 233 | ) { |
234 | 234 | return $this->join(['scalar', $def->name, $this->join($def->directives, ' ')], ' '); |
235 | 235 | }), |
236 | - NodeKind::OBJECT_TYPE_DEFINITION => $this->addDescription(function ( |
|
236 | + NodeKind::OBJECT_TYPE_DEFINITION => $this->addDescription(function( |
|
237 | 237 | ObjectTypeDefinitionNode $def |
238 | 238 | ) { |
239 | 239 | return $this->join( |
@@ -247,14 +247,14 @@ discard block |
||
247 | 247 | ' ' |
248 | 248 | ); |
249 | 249 | }), |
250 | - NodeKind::FIELD_DEFINITION => $this->addDescription(function (FieldDefinitionNode $def |
|
250 | + NodeKind::FIELD_DEFINITION => $this->addDescription(function(FieldDefinitionNode $def |
|
251 | 251 | ) { |
252 | 252 | return $def->name |
253 | 253 | . $this->wrap('(', $this->join($def->arguments, ', '), ')') |
254 | 254 | . ': ' . $def->type |
255 | 255 | . $this->wrap(' ', $this->join($def->directives, ' ')); |
256 | 256 | }), |
257 | - NodeKind::INPUT_VALUE_DEFINITION => $this->addDescription(function ( |
|
257 | + NodeKind::INPUT_VALUE_DEFINITION => $this->addDescription(function( |
|
258 | 258 | InputValueDefinitionNode $def |
259 | 259 | ) { |
260 | 260 | return $this->join( |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ' ' |
267 | 267 | ); |
268 | 268 | }), |
269 | - NodeKind::INTERFACE_TYPE_DEFINITION => $this->addDescription(function ( |
|
269 | + NodeKind::INTERFACE_TYPE_DEFINITION => $this->addDescription(function( |
|
270 | 270 | InterfaceTypeDefinitionNode $def |
271 | 271 | ) { |
272 | 272 | return $this->join( |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | ' ' |
280 | 280 | ); |
281 | 281 | }), |
282 | - NodeKind::UNION_TYPE_DEFINITION => $this->addDescription(function ( |
|
282 | + NodeKind::UNION_TYPE_DEFINITION => $this->addDescription(function( |
|
283 | 283 | UnionTypeDefinitionNode $def |
284 | 284 | ) { |
285 | 285 | return $this->join( |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | ' ' |
295 | 295 | ); |
296 | 296 | }), |
297 | - NodeKind::ENUM_TYPE_DEFINITION => $this->addDescription(function ( |
|
297 | + NodeKind::ENUM_TYPE_DEFINITION => $this->addDescription(function( |
|
298 | 298 | EnumTypeDefinitionNode $def |
299 | 299 | ) { |
300 | 300 | return $this->join( |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | ' ' |
308 | 308 | ); |
309 | 309 | }), |
310 | - NodeKind::ENUM_VALUE_DEFINITION => $this->addDescription(function ( |
|
310 | + NodeKind::ENUM_VALUE_DEFINITION => $this->addDescription(function( |
|
311 | 311 | EnumValueDefinitionNode $def |
312 | 312 | ) { |
313 | 313 | return $this->join([$def->name, $this->join($def->directives, ' ')], ' '); |
314 | 314 | }), |
315 | - NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $this->addDescription(function ( |
|
315 | + NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $this->addDescription(function( |
|
316 | 316 | InputObjectTypeDefinitionNode $def |
317 | 317 | ) { |
318 | 318 | return $this->join( |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | ' ' |
326 | 326 | ); |
327 | 327 | }), |
328 | - NodeKind::SCALAR_TYPE_EXTENSION => function (ScalarTypeExtensionNode $def) { |
|
328 | + NodeKind::SCALAR_TYPE_EXTENSION => function(ScalarTypeExtensionNode $def) { |
|
329 | 329 | return $this->join( |
330 | 330 | [ |
331 | 331 | 'extend scalar', |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | ' ' |
336 | 336 | ); |
337 | 337 | }, |
338 | - NodeKind::OBJECT_TYPE_EXTENSION => function (ObjectTypeExtensionNode $def) { |
|
338 | + NodeKind::OBJECT_TYPE_EXTENSION => function(ObjectTypeExtensionNode $def) { |
|
339 | 339 | return $this->join( |
340 | 340 | [ |
341 | 341 | 'extend type', |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | ' ' |
348 | 348 | ); |
349 | 349 | }, |
350 | - NodeKind::INTERFACE_TYPE_EXTENSION => function (InterfaceTypeExtensionNode $def) { |
|
350 | + NodeKind::INTERFACE_TYPE_EXTENSION => function(InterfaceTypeExtensionNode $def) { |
|
351 | 351 | return $this->join( |
352 | 352 | [ |
353 | 353 | 'extend interface', |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | ' ' |
359 | 359 | ); |
360 | 360 | }, |
361 | - NodeKind::UNION_TYPE_EXTENSION => function (UnionTypeExtensionNode $def) { |
|
361 | + NodeKind::UNION_TYPE_EXTENSION => function(UnionTypeExtensionNode $def) { |
|
362 | 362 | return $this->join( |
363 | 363 | [ |
364 | 364 | 'extend union', |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | ' ' |
372 | 372 | ); |
373 | 373 | }, |
374 | - NodeKind::ENUM_TYPE_EXTENSION => function (EnumTypeExtensionNode $def) { |
|
374 | + NodeKind::ENUM_TYPE_EXTENSION => function(EnumTypeExtensionNode $def) { |
|
375 | 375 | return $this->join( |
376 | 376 | [ |
377 | 377 | 'extend enum', |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | ' ' |
383 | 383 | ); |
384 | 384 | }, |
385 | - NodeKind::INPUT_OBJECT_TYPE_EXTENSION => function (InputObjectTypeExtensionNode $def) { |
|
385 | + NodeKind::INPUT_OBJECT_TYPE_EXTENSION => function(InputObjectTypeExtensionNode $def) { |
|
386 | 386 | return $this->join( |
387 | 387 | [ |
388 | 388 | 'extend input', |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | ' ' |
394 | 394 | ); |
395 | 395 | }, |
396 | - NodeKind::DIRECTIVE_DEFINITION => $this->addDescription(function ( |
|
396 | + NodeKind::DIRECTIVE_DEFINITION => $this->addDescription(function( |
|
397 | 397 | DirectiveDefinitionNode $def |
398 | 398 | ) { |
399 | 399 | return 'directive @' |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | |
409 | 409 | public function addDescription(\Closure $cb) |
410 | 410 | { |
411 | - return function ($node) use ($cb) { |
|
411 | + return function($node) use ($cb) { |
|
412 | 412 | return $this->join([$node->description, $cb($node)], "\n"); |
413 | 413 | }; |
414 | 414 | } |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | $separator, |
456 | 456 | Utils::filter( |
457 | 457 | $maybeArray, |
458 | - function ($x) { |
|
459 | - return ! ! $x; |
|
458 | + function($x) { |
|
459 | + return !!$x; |
|
460 | 460 | } |
461 | 461 | ) |
462 | 462 | ) |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $this->expect($openKind); |
300 | 300 | |
301 | 301 | $nodes = []; |
302 | - while (! $this->skip($closeKind)) { |
|
302 | + while (!$this->skip($closeKind)) { |
|
303 | 303 | $nodes[] = $parseFn($this); |
304 | 304 | } |
305 | 305 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $this->expect($openKind); |
324 | 324 | |
325 | 325 | $nodes = [$parseFn($this)]; |
326 | - while (! $this->skip($closeKind)) { |
|
326 | + while (!$this->skip($closeKind)) { |
|
327 | 327 | $nodes[] = $parseFn($this); |
328 | 328 | } |
329 | 329 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $definitions = []; |
361 | 361 | do { |
362 | 362 | $definitions[] = $this->parseDefinition(); |
363 | - } while (! $this->skip(Token::EOF)); |
|
363 | + } while (!$this->skip(Token::EOF)); |
|
364 | 364 | |
365 | 365 | return new DocumentNode([ |
366 | 366 | 'definitions' => new NodeList($definitions), |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | return $this->peek(Token::PAREN_L) ? |
493 | 493 | $this->many( |
494 | 494 | Token::PAREN_L, |
495 | - function () { |
|
495 | + function() { |
|
496 | 496 | return $this->parseVariableDefinition(); |
497 | 497 | }, |
498 | 498 | Token::PAREN_R |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | [ |
548 | 548 | 'selections' => $this->many( |
549 | 549 | Token::BRACE_L, |
550 | - function () { |
|
550 | + function() { |
|
551 | 551 | return $this->parseSelection(); |
552 | 552 | }, |
553 | 553 | Token::BRACE_R |
@@ -568,8 +568,7 @@ discard block |
||
568 | 568 | private function parseSelection() |
569 | 569 | { |
570 | 570 | return $this->peek(Token::SPREAD) ? |
571 | - $this->parseFragment() : |
|
572 | - $this->parseField(); |
|
571 | + $this->parseFragment() : $this->parseField(); |
|
573 | 572 | } |
574 | 573 | |
575 | 574 | /** |
@@ -607,16 +606,15 @@ discard block |
||
607 | 606 | private function parseArguments($isConst) |
608 | 607 | { |
609 | 608 | $parseFn = $isConst ? |
610 | - function () { |
|
609 | + function() { |
|
611 | 610 | return $this->parseConstArgument(); |
612 | 611 | } : |
613 | - function () { |
|
612 | + function() { |
|
614 | 613 | return $this->parseArgument(); |
615 | 614 | }; |
616 | 615 | |
617 | 616 | return $this->peek(Token::PAREN_L) ? |
618 | - $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) : |
|
619 | - new NodeList([]); |
|
617 | + $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) : new NodeList([]); |
|
620 | 618 | } |
621 | 619 | |
622 | 620 | /** |
@@ -808,7 +806,7 @@ discard block |
||
808 | 806 | break; |
809 | 807 | |
810 | 808 | case Token::DOLLAR: |
811 | - if (! $isConst) { |
|
809 | + if (!$isConst) { |
|
812 | 810 | return $this->parseVariable(); |
813 | 811 | } |
814 | 812 | break; |
@@ -855,9 +853,9 @@ discard block |
||
855 | 853 | private function parseArray($isConst) |
856 | 854 | { |
857 | 855 | $start = $this->lexer->token; |
858 | - $parseFn = $isConst ? function () { |
|
856 | + $parseFn = $isConst ? function() { |
|
859 | 857 | return $this->parseConstValue(); |
860 | - } : function () { |
|
858 | + } : function() { |
|
861 | 859 | return $this->parseVariableValue(); |
862 | 860 | }; |
863 | 861 | |
@@ -878,7 +876,7 @@ discard block |
||
878 | 876 | $start = $this->lexer->token; |
879 | 877 | $this->expect(Token::BRACE_L); |
880 | 878 | $fields = []; |
881 | - while (! $this->skip(Token::BRACE_R)) { |
|
879 | + while (!$this->skip(Token::BRACE_R)) { |
|
882 | 880 | $fields[] = $this->parseObjectField($isConst); |
883 | 881 | } |
884 | 882 | |
@@ -1065,7 +1063,7 @@ discard block |
||
1065 | 1063 | |
1066 | 1064 | $operationTypes = $this->many( |
1067 | 1065 | Token::BRACE_L, |
1068 | - function () { |
|
1066 | + function() { |
|
1069 | 1067 | return $this->parseOperationTypeDefinition(); |
1070 | 1068 | }, |
1071 | 1069 | Token::BRACE_R |
@@ -1158,7 +1156,7 @@ discard block |
||
1158 | 1156 | $types[] = $this->parseNamedType(); |
1159 | 1157 | } while ($this->skip(Token::AMP) || |
1160 | 1158 | // Legacy support for the SDL? |
1161 | - (! empty($this->lexer->options['allowLegacySDLImplementsInterfaces']) && $this->peek(Token::NAME)) |
|
1159 | + (!empty($this->lexer->options['allowLegacySDLImplementsInterfaces']) && $this->peek(Token::NAME)) |
|
1162 | 1160 | ); |
1163 | 1161 | } |
1164 | 1162 | |
@@ -1172,7 +1170,7 @@ discard block |
||
1172 | 1170 | private function parseFieldsDefinition() |
1173 | 1171 | { |
1174 | 1172 | // Legacy support for the SDL? |
1175 | - if (! empty($this->lexer->options['allowLegacySDLEmptyFields']) && |
|
1173 | + if (!empty($this->lexer->options['allowLegacySDLEmptyFields']) && |
|
1176 | 1174 | $this->peek(Token::BRACE_L) && |
1177 | 1175 | $this->lexer->lookahead()->kind === Token::BRACE_R |
1178 | 1176 | ) { |
@@ -1185,7 +1183,7 @@ discard block |
||
1185 | 1183 | return $this->peek(Token::BRACE_L) |
1186 | 1184 | ? $this->many( |
1187 | 1185 | Token::BRACE_L, |
1188 | - function () { |
|
1186 | + function() { |
|
1189 | 1187 | return $this->parseFieldDefinition(); |
1190 | 1188 | }, |
1191 | 1189 | Token::BRACE_R |
@@ -1223,13 +1221,13 @@ discard block |
||
1223 | 1221 | */ |
1224 | 1222 | private function parseArgumentDefs() |
1225 | 1223 | { |
1226 | - if (! $this->peek(Token::PAREN_L)) { |
|
1224 | + if (!$this->peek(Token::PAREN_L)) { |
|
1227 | 1225 | return new NodeList([]); |
1228 | 1226 | } |
1229 | 1227 | |
1230 | 1228 | return $this->many( |
1231 | 1229 | Token::PAREN_L, |
1232 | - function () { |
|
1230 | + function() { |
|
1233 | 1231 | return $this->parseInputValueDef(); |
1234 | 1232 | }, |
1235 | 1233 | Token::PAREN_R |
@@ -1362,7 +1360,7 @@ discard block |
||
1362 | 1360 | return $this->peek(Token::BRACE_L) |
1363 | 1361 | ? $this->many( |
1364 | 1362 | Token::BRACE_L, |
1365 | - function () { |
|
1363 | + function() { |
|
1366 | 1364 | return $this->parseEnumValueDefinition(); |
1367 | 1365 | }, |
1368 | 1366 | Token::BRACE_R |
@@ -1420,7 +1418,7 @@ discard block |
||
1420 | 1418 | return $this->peek(Token::BRACE_L) |
1421 | 1419 | ? $this->many( |
1422 | 1420 | Token::BRACE_L, |
1423 | - function () { |
|
1421 | + function() { |
|
1424 | 1422 | return $this->parseInputValueDef(); |
1425 | 1423 | }, |
1426 | 1424 | Token::BRACE_R |
@@ -1500,7 +1498,7 @@ discard block |
||
1500 | 1498 | $directives = $this->parseDirectives(true); |
1501 | 1499 | $fields = $this->parseFieldsDefinition(); |
1502 | 1500 | |
1503 | - if (! $interfaces && |
|
1501 | + if (!$interfaces && |
|
1504 | 1502 | count($directives) === 0 && |
1505 | 1503 | count($fields) === 0 |
1506 | 1504 | ) { |
@@ -1559,7 +1557,7 @@ discard block |
||
1559 | 1557 | $directives = $this->parseDirectives(true); |
1560 | 1558 | $types = $this->parseUnionMemberTypes(); |
1561 | 1559 | if (count($directives) === 0 && |
1562 | - ! $types |
|
1560 | + !$types |
|
1563 | 1561 | ) { |
1564 | 1562 | throw $this->unexpected(); |
1565 | 1563 | } |
@@ -489,7 +489,7 @@ |
||
489 | 489 | case 117: |
490 | 490 | $position = $this->position; |
491 | 491 | list ($hex) = $this->readChars(4, true); |
492 | - if (! preg_match('/[0-9a-fA-F]{4}/', $hex)) { |
|
492 | + if (!preg_match('/[0-9a-fA-F]{4}/', $hex)) { |
|
493 | 493 | throw new SyntaxError( |
494 | 494 | $this->source, |
495 | 495 | $position - 1, |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $this->endToken = $endToken; |
68 | 68 | $this->source = $source; |
69 | 69 | |
70 | - if (! $startToken || ! $endToken) { |
|
70 | + if (!$startToken || !$endToken) { |
|
71 | 71 | return; |
72 | 72 | } |
73 | 73 |