@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | public static function assign($obj, array $vars, array $requiredKeys = []) |
85 | 85 | { |
86 | 86 | foreach ($requiredKeys as $key) { |
87 | - if (! isset($vars[$key])) { |
|
87 | + if (!isset($vars[$key])) { |
|
88 | 88 | throw new InvalidArgumentException(sprintf('Key %s is expected to be set and not to be null', $key)); |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | 92 | foreach ($vars as $key => $value) { |
93 | - if (! property_exists($obj, $key)) { |
|
93 | + if (!property_exists($obj, $key)) { |
|
94 | 94 | $cls = get_class($obj); |
95 | 95 | Warning::warn( |
96 | 96 | sprintf("Trying to set non-existing property '%s' on class '%s'", $key, $cls), |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $result = []; |
142 | 142 | $assoc = false; |
143 | 143 | foreach ($traversable as $key => $value) { |
144 | - if (! $assoc && ! is_int($key)) { |
|
144 | + if (!$assoc && !is_int($key)) { |
|
145 | 145 | $assoc = true; |
146 | 146 | } |
147 | - if (! $predicate($value, $key)) { |
|
147 | + if (!$predicate($value, $key)) { |
|
148 | 148 | continue; |
149 | 149 | } |
150 | 150 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $map = []; |
217 | 217 | foreach ($traversable as $key => $value) { |
218 | 218 | $newKey = $keyFn($value, $key); |
219 | - if (! is_scalar($newKey)) { |
|
219 | + if (!is_scalar($newKey)) { |
|
220 | 220 | continue; |
221 | 221 | } |
222 | 222 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | public static function every($traversable, callable $predicate) |
296 | 296 | { |
297 | 297 | foreach ($traversable as $key => $value) { |
298 | - if (! $predicate($value, $key)) { |
|
298 | + if (!$predicate($value, $key)) { |
|
299 | 299 | return false; |
300 | 300 | } |
301 | 301 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public static function invariant($test, $message = '') |
311 | 311 | { |
312 | - if (! $test) { |
|
312 | + if (!$test) { |
|
313 | 313 | if (func_num_args() > 2) { |
314 | 314 | $args = func_get_args(); |
315 | 315 | array_shift($args); |
@@ -446,10 +446,10 @@ discard block |
||
446 | 446 | */ |
447 | 447 | public static function ord($char, $encoding = 'UTF-8') |
448 | 448 | { |
449 | - if (! $char && $char !== '0') { |
|
449 | + if (!$char && $char !== '0') { |
|
450 | 450 | return 0; |
451 | 451 | } |
452 | - if (! isset($char[1])) { |
|
452 | + if (!isset($char[1])) { |
|
453 | 453 | return ord($char); |
454 | 454 | } |
455 | 455 | if ($encoding !== 'UCS-4BE') { |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | ); |
528 | 528 | } |
529 | 529 | |
530 | - if (! preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { |
|
530 | + if (!preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { |
|
531 | 531 | return new Error( |
532 | 532 | sprintf('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "%s" does not.', $name), |
533 | 533 | $node |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | */ |
548 | 548 | public static function withErrorHandling(callable $fn, array &$errors) |
549 | 549 | { |
550 | - return static function () use ($fn, &$errors) { |
|
550 | + return static function() use ($fn, &$errors) { |
|
551 | 551 | // Catch custom errors (to report them in query results) |
552 | - set_error_handler(static function ($severity, $message, $file, $line) use (&$errors) { |
|
552 | + set_error_handler(static function($severity, $message, $file, $line) use (&$errors) { |
|
553 | 553 | $errors[] = new ErrorException($message, 0, $severity, $file, $line); |
554 | 554 | }); |
555 | 555 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | public static function quotedOrList(array $items) |
570 | 570 | { |
571 | 571 | $items = array_map( |
572 | - static function ($item) { |
|
572 | + static function($item) { |
|
573 | 573 | return sprintf('"%s"', $item); |
574 | 574 | }, |
575 | 575 | $items |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | |
599 | 599 | return array_reduce( |
600 | 600 | range(1, $selectedLength - 1), |
601 | - static function ($list, $index) use ($selected, $selectedLength) { |
|
601 | + static function($list, $index) use ($selected, $selectedLength) { |
|
602 | 602 | return $list . |
603 | 603 | ($selectedLength > 2 ? ', ' : ' ') . |
604 | 604 | ($index === $selectedLength - 1 ? 'or ' : '') . |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $suggestions = Utils::suggestionList( |
99 | 99 | Utils::printSafe($value), |
100 | 100 | array_map( |
101 | - static function ($enumValue) { |
|
101 | + static function($enumValue) { |
|
102 | 102 | return $enumValue->name; |
103 | 103 | }, |
104 | 104 | $type->getValues() |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($type instanceof InputObjectType) { |
150 | - if (! is_object($value) && ! is_array($value) && ! $value instanceof Traversable) { |
|
150 | + if (!is_object($value) && !is_array($value) && !$value instanceof Traversable) { |
|
151 | 151 | return self::ofErrors([ |
152 | 152 | self::coercionError( |
153 | 153 | sprintf('Expected type %s to be an object', $type->name), |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $pathStr = ''; |
271 | 271 | $currentPath = $path; |
272 | 272 | while ($currentPath) { |
273 | - $pathStr = |
|
273 | + $pathStr = |
|
274 | 274 | (is_string($currentPath['key']) |
275 | 275 | ? '.' . $currentPath['key'] |
276 | 276 | : '[' . $currentPath['key'] . ']') . $pathStr; |
@@ -187,7 +187,7 @@ |
||
187 | 187 | $fields = []; |
188 | 188 | foreach ($selectionSet->selections as $selectionNode) { |
189 | 189 | if ($selectionNode instanceof FieldNode) { |
190 | - $fields[$selectionNode->name->value] = $descend > 0 && ! empty($selectionNode->selectionSet) |
|
190 | + $fields[$selectionNode->name->value] = $descend > 0 && !empty($selectionNode->selectionSet) |
|
191 | 191 | ? $this->foldSelectionSet($selectionNode->selectionSet, $descend - 1) |
192 | 192 | : true; |
193 | 193 | } elseif ($selectionNode instanceof FragmentSpreadNode) { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | $totalFields = 0; |
35 | 35 | foreach ($schema->getTypeMap() as $type) { |
36 | - if (! ($type instanceof ObjectType)) { |
|
36 | + if (!($type instanceof ObjectType)) { |
|
37 | 37 | continue; |
38 | 38 | } |
39 | 39 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | return new Schema( |
68 | 68 | SchemaConfig::create() |
69 | 69 | ->setQuery($this->schemaBuilder->buildQueryType()) |
70 | - ->setTypeLoader(function ($name) { |
|
70 | + ->setTypeLoader(function($name) { |
|
71 | 71 | return $this->schemaBuilder->loadType($name); |
72 | 72 | }) |
73 | 73 | ); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public static function runQueue() : void |
40 | 40 | { |
41 | 41 | $queue = self::getQueue(); |
42 | - while (! $queue->isEmpty()) { |
|
42 | + while (!$queue->isEmpty()) { |
|
43 | 43 | /** @var self $dequeuedNodeValue */ |
44 | 44 | $dequeuedNodeValue = $queue->dequeue(); |
45 | 45 | $dequeuedNodeValue->run(); |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | // Some parameters could be provided as serialized JSON. |
90 | 90 | foreach (['extensions', 'variables'] as $param) { |
91 | - if (! is_string($params[$param])) { |
|
91 | + if (!is_string($params[$param])) { |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | if ($fieldType instanceof InputObjectType) { |
72 | 72 | $this->fieldPath[] = $field; |
73 | 73 | |
74 | - if (! isset($this->fieldPathIndexByTypeName[$fieldType->name])) { |
|
74 | + if (!isset($this->fieldPathIndexByTypeName[$fieldType->name])) { |
|
75 | 75 | $this->validate($fieldType); |
76 | 76 | } else { |
77 | 77 | $cycleIndex = $this->fieldPathIndexByTypeName[$fieldType->name]; |
78 | 78 | $cyclePath = array_slice($this->fieldPath, $cycleIndex); |
79 | 79 | $fieldNames = array_map( |
80 | - static function (InputObjectField $field) : string { |
|
80 | + static function(InputObjectField $field) : string { |
|
81 | 81 | return $field->name; |
82 | 82 | }, |
83 | 83 | $cyclePath |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'Cannot reference Input Object "' . $fieldType->name . '" within itself ' |
88 | 88 | . 'through a series of non-null fields: "' . implode('.', $fieldNames) . '".', |
89 | 89 | array_map( |
90 | - static function (InputObjectField $field) : ?InputValueDefinitionNode { |
|
90 | + static function(InputObjectField $field) : ?InputValueDefinitionNode { |
|
91 | 91 | return $field->astNode; |
92 | 92 | }, |
93 | 93 | $cyclePath |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | Visitor::visitWithTypeInfo( |
129 | 129 | $typeInfo, |
130 | 130 | [ |
131 | - NodeKind::VARIABLE_DEFINITION => static function () { |
|
131 | + NodeKind::VARIABLE_DEFINITION => static function() { |
|
132 | 132 | return false; |
133 | 133 | }, |
134 | - NodeKind::VARIABLE => static function (VariableNode $variable) use ( |
|
134 | + NodeKind::VARIABLE => static function(VariableNode $variable) use ( |
|
135 | 135 | &$newUsages, |
136 | 136 | $typeInfo |
137 | 137 | ) { |
@@ -158,19 +158,19 @@ discard block |
||
158 | 158 | $fragments = []; |
159 | 159 | $collectedNames = []; |
160 | 160 | $nodesToVisit = [$operation]; |
161 | - while (! empty($nodesToVisit)) { |
|
161 | + while (!empty($nodesToVisit)) { |
|
162 | 162 | $node = array_pop($nodesToVisit); |
163 | 163 | $spreads = $this->getFragmentSpreads($node); |
164 | 164 | foreach ($spreads as $spread) { |
165 | 165 | $fragName = $spread->name->value; |
166 | 166 | |
167 | - if (! empty($collectedNames[$fragName])) { |
|
167 | + if (!empty($collectedNames[$fragName])) { |
|
168 | 168 | continue; |
169 | 169 | } |
170 | 170 | |
171 | 171 | $collectedNames[$fragName] = true; |
172 | 172 | $fragment = $this->getFragment($fragName); |
173 | - if (! $fragment) { |
|
173 | + if (!$fragment) { |
|
174 | 174 | continue; |
175 | 175 | } |
176 | 176 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $spreads = []; |
195 | 195 | /** @var SelectionSetNode[] $setsToVisit */ |
196 | 196 | $setsToVisit = [$node->selectionSet]; |
197 | - while (! empty($setsToVisit)) { |
|
197 | + while (!empty($setsToVisit)) { |
|
198 | 198 | $set = array_pop($setsToVisit); |
199 | 199 | |
200 | 200 | for ($i = 0, $selectionCount = count($set->selections); $i < $selectionCount; $i++) { |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | public function getFragment($name) |
221 | 221 | { |
222 | 222 | $fragments = $this->fragments; |
223 | - if (! $fragments) { |
|
223 | + if (!$fragments) { |
|
224 | 224 | $fragments = []; |
225 | 225 | foreach ($this->getDocument()->definitions as $statement) { |
226 | - if (! ($statement instanceof FragmentDefinitionNode)) { |
|
226 | + if (!($statement instanceof FragmentDefinitionNode)) { |
|
227 | 227 | continue; |
228 | 228 | } |
229 | 229 |