@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | }, |
| 150 | 150 | NodeKind::STRING => function(StringValueNode $node, $key) { |
| 151 | 151 | if ($node->block) { |
| 152 | - return $this->printBlockString($node->value, $key === 'description'); |
|
| 152 | + return $this->printBlockString($node->value, $key === 'description'); |
|
| 153 | 153 | } |
| 154 | 154 | return json_encode($node->value); |
| 155 | 155 | }, |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | return $this->join([ |
| 223 | 223 | $def->description, |
| 224 | 224 | $def->name |
| 225 | - . $this->wrap('(', $this->join($def->arguments, ', '), ')') |
|
| 226 | - . ': ' . $def->type |
|
| 227 | - . $this->wrap(' ', $this->join($def->directives, ' ')) |
|
| 225 | + . $this->wrap('(', $this->join($def->arguments, ', '), ')') |
|
| 226 | + . ': ' . $def->type |
|
| 227 | + . $this->wrap(' ', $this->join($def->directives, ' ')) |
|
| 228 | 228 | ], "\n"); |
| 229 | 229 | }, |
| 230 | 230 | NodeKind::INPUT_VALUE_DEFINITION => function(InputValueDefinitionNode $def) { |
@@ -392,7 +392,7 @@ |
||
| 392 | 392 | $separator, |
| 393 | 393 | Utils::filter( |
| 394 | 394 | $maybeArray, |
| 395 | - function($x) { return !!$x;} |
|
| 395 | + function($x) { return !!$x; } |
|
| 396 | 396 | ) |
| 397 | 397 | ) |
| 398 | 398 | : ''; |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $skipping = new \SplFixedArray($visitorsCount); |
| 372 | 372 | |
| 373 | 373 | return [ |
| 374 | - 'enter' => function ($node) use ($visitors, $skipping, $visitorsCount) { |
|
| 374 | + 'enter' => function($node) use ($visitors, $skipping, $visitorsCount) { |
|
| 375 | 375 | for ($i = 0; $i < $visitorsCount; $i++) { |
| 376 | 376 | if (empty($skipping[$i])) { |
| 377 | 377 | $fn = self::getVisitFn($visitors[$i], $node->kind, /* isLeaving */ false); |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | }, |
| 397 | - 'leave' => function ($node) use ($visitors, $skipping, $visitorsCount) { |
|
| 397 | + 'leave' => function($node) use ($visitors, $skipping, $visitorsCount) { |
|
| 398 | 398 | for ($i = 0; $i < $visitorsCount; $i++) { |
| 399 | 399 | if (empty($skipping[$i])) { |
| 400 | 400 | $fn = self::getVisitFn($visitors[$i], $node->kind, /* isLeaving */ true); |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | static function visitWithTypeInfo(TypeInfo $typeInfo, $visitor) |
| 427 | 427 | { |
| 428 | 428 | return [ |
| 429 | - 'enter' => function ($node) use ($typeInfo, $visitor) { |
|
| 429 | + 'enter' => function($node) use ($typeInfo, $visitor) { |
|
| 430 | 430 | $typeInfo->enter($node); |
| 431 | 431 | $fn = self::getVisitFn($visitor, $node->kind, false); |
| 432 | 432 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | } |
| 443 | 443 | return null; |
| 444 | 444 | }, |
| 445 | - 'leave' => function ($node) use ($typeInfo, $visitor) { |
|
| 445 | + 'leave' => function($node) use ($typeInfo, $visitor) { |
|
| 446 | 446 | $fn = self::getVisitFn($visitor, $node->kind, true); |
| 447 | 447 | $result = $fn ? call_user_func_array($fn, func_get_args()) : null; |
| 448 | 448 | $typeInfo->leave($node); |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $column = $position + 1; |
| 76 | 76 | |
| 77 | 77 | $utfChars = json_decode('"\u2028\u2029"'); |
| 78 | - $lineRegexp = '/\r\n|[\n\r'.$utfChars.']/su'; |
|
| 78 | + $lineRegexp = '/\r\n|[\n\r' . $utfChars . ']/su'; |
|
| 79 | 79 | $matches = []; |
| 80 | 80 | preg_match_all($lineRegexp, mb_substr($this->body, 0, $position, 'UTF-8'), $matches, PREG_OFFSET_CAPTURE); |
| 81 | 81 | |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | private static function leadingWhitespace($str) { |
| 54 | 54 | $i = 0; |
| 55 | 55 | while ($i < mb_strlen($str) && ($str[$i] === ' ' || $str[$i] === '\t')) { |
| 56 | - $i++; |
|
| 56 | + $i++; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return $i; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | return $this->standardStore[$offset]; |
| 158 | 158 | } |
| 159 | 159 | if (is_float($offset)) { |
| 160 | - return $this->floatStore[(string)$offset]; |
|
| 160 | + return $this->floatStore[(string) $offset]; |
|
| 161 | 161 | } |
| 162 | 162 | if (is_object($offset)) { |
| 163 | 163 | return $this->objectStore->offsetGet($offset); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } else if (is_int($offset) || is_string($offset)) { |
| 203 | 203 | $this->standardStore[$offset] = $value; |
| 204 | 204 | } else if (is_float($offset)) { |
| 205 | - $this->floatStore[(string)$offset] = $value; |
|
| 205 | + $this->floatStore[(string) $offset] = $value; |
|
| 206 | 206 | } else if (is_object($offset)) { |
| 207 | 207 | $this->objectStore[$offset] = $value; |
| 208 | 208 | } else if (is_array($offset)) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } else if (is_int($offset) || is_string($offset)) { |
| 237 | 237 | unset($this->standardStore[$offset]); |
| 238 | 238 | } else if (is_float($offset)) { |
| 239 | - unset($this->floatStore[(string)$offset]); |
|
| 239 | + unset($this->floatStore[(string) $offset]); |
|
| 240 | 240 | } else if (is_object($offset)) { |
| 241 | 241 | $this->objectStore->offsetUnset($offset); |
| 242 | 242 | } else if (is_array($offset)) { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | function($type) { |
| 36 | 36 | return !Directive::isSpecifiedDirective($type); |
| 37 | 37 | }, |
| 38 | - function ($type) { |
|
| 38 | + function($type) { |
|
| 39 | 39 | return !Type::isBuiltInType($type); |
| 40 | 40 | }, |
| 41 | 41 | $options |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | private static function descriptionLines($description, $maxLen) { |
| 313 | 313 | $lines = []; |
| 314 | 314 | $rawLines = explode("\n", $description); |
| 315 | - foreach($rawLines as $line) { |
|
| 315 | + foreach ($rawLines as $line) { |
|
| 316 | 316 | if ($line === '') { |
| 317 | 317 | $lines[] = $line; |
| 318 | 318 | } else { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | if (!$type instanceof Type) { |
| 97 | 97 | Warning::warnOnce( |
| 98 | - 'One of the schema types is not a valid type definition instance. '. |
|
| 98 | + 'One of the schema types is not a valid type definition instance. ' . |
|
| 99 | 99 | 'Try running $schema->assertValid() to find out the cause of this warning.', |
| 100 | 100 | Warning::WARNING_NOT_A_TYPE |
| 101 | 101 | ); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if (!empty($typeMap[$type->name])) { |
| 106 | 106 | Utils::invariant( |
| 107 | 107 | $typeMap[$type->name] === $type, |
| 108 | - "Schema must contain unique named types but contains multiple types named \"$type\" ". |
|
| 108 | + "Schema must contain unique named types but contains multiple types named \"$type\" " . |
|
| 109 | 109 | "(see http://webonyx.github.io/graphql-php/type-system/#type-registry)." |
| 110 | 110 | ); |
| 111 | 111 | return $typeMap; |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $fieldOrDirective = $this->getDirective() ?: $this->getFieldDef(); |
| 380 | 380 | $argDef = $argType = null; |
| 381 | 381 | if ($fieldOrDirective) { |
| 382 | - $argDef = Utils::find($fieldOrDirective->args, function($arg) use ($node) {return $arg->name === $node->name->value;}); |
|
| 382 | + $argDef = Utils::find($fieldOrDirective->args, function($arg) use ($node) {return $arg->name === $node->name->value; }); |
|
| 383 | 383 | if ($argDef) { |
| 384 | 384 | $argType = $argDef->getType(); |
| 385 | 385 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | return new Directive([ |
| 182 | 182 | 'name' => $directiveNode->name->value, |
| 183 | 183 | 'description' => $this->getDescription($directiveNode), |
| 184 | - 'locations' => Utils::map($directiveNode->locations, function ($node) { |
|
| 184 | + 'locations' => Utils::map($directiveNode->locations, function($node) { |
|
| 185 | 185 | return $node->value; |
| 186 | 186 | }), |
| 187 | 187 | 'args' => $directiveNode->arguments ? FieldArgument::createMap($this->makeInputValues($directiveNode->arguments)) : null, |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | return new ObjectType([ |
| 256 | 256 | 'name' => $typeName, |
| 257 | 257 | 'description' => $this->getDescription($def), |
| 258 | - 'fields' => function () use ($def) { |
|
| 258 | + 'fields' => function() use ($def) { |
|
| 259 | 259 | return $this->makeFieldDefMap($def); |
| 260 | 260 | }, |
| 261 | - 'interfaces' => function () use ($def) { |
|
| 261 | + 'interfaces' => function() use ($def) { |
|
| 262 | 262 | return $this->makeImplementedInterfaces($def); |
| 263 | 263 | }, |
| 264 | 264 | 'astNode' => $def |
@@ -270,10 +270,10 @@ discard block |
||
| 270 | 270 | return $def->fields |
| 271 | 271 | ? Utils::keyValMap( |
| 272 | 272 | $def->fields, |
| 273 | - function ($field) { |
|
| 273 | + function($field) { |
|
| 274 | 274 | return $field->name->value; |
| 275 | 275 | }, |
| 276 | - function ($field) { |
|
| 276 | + function($field) { |
|
| 277 | 277 | return $this->buildField($field); |
| 278 | 278 | } |
| 279 | 279 | ) |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | // Note: While this could make early assertions to get the correctly |
| 287 | 287 | // typed values, that would throw immediately while type system |
| 288 | 288 | // validation with validateSchema() will produce more actionable results. |
| 289 | - return Utils::map($def->interfaces, function ($iface) { |
|
| 289 | + return Utils::map($def->interfaces, function($iface) { |
|
| 290 | 290 | return $this->buildType($iface); |
| 291 | 291 | }); |
| 292 | 292 | } |
@@ -297,10 +297,10 @@ discard block |
||
| 297 | 297 | { |
| 298 | 298 | return Utils::keyValMap( |
| 299 | 299 | $values, |
| 300 | - function ($value) { |
|
| 300 | + function($value) { |
|
| 301 | 301 | return $value->name->value; |
| 302 | 302 | }, |
| 303 | - function ($value) { |
|
| 303 | + function($value) { |
|
| 304 | 304 | // Note: While this could make assertions to get the correctly typed |
| 305 | 305 | // value, that would throw immediately while type system validation |
| 306 | 306 | // with validateSchema() will produce more actionable results. |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | return new InterfaceType([ |
| 326 | 326 | 'name' => $typeName, |
| 327 | 327 | 'description' => $this->getDescription($def), |
| 328 | - 'fields' => function () use ($def) { |
|
| 328 | + 'fields' => function() use ($def) { |
|
| 329 | 329 | return $this->makeFieldDefMap($def); |
| 330 | 330 | }, |
| 331 | 331 | 'astNode' => $def |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | 'values' => $def->values |
| 341 | 341 | ? Utils::keyValMap( |
| 342 | 342 | $def->values, |
| 343 | - function ($enumValue) { |
|
| 343 | + function($enumValue) { |
|
| 344 | 344 | return $enumValue->name->value; |
| 345 | 345 | }, |
| 346 | - function ($enumValue) { |
|
| 346 | + function($enumValue) { |
|
| 347 | 347 | return [ |
| 348 | 348 | 'description' => $this->getDescription($enumValue), |
| 349 | 349 | 'deprecationReason' => $this->getDeprecationReason($enumValue), |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | // values below, that would throw immediately while type system |
| 366 | 366 | // validation with validateSchema() will produce more actionable results. |
| 367 | 367 | 'types' => $def->types |
| 368 | - ? Utils::map($def->types, function ($typeNode) { |
|
| 368 | + ? Utils::map($def->types, function($typeNode) { |
|
| 369 | 369 | return $this->buildType($typeNode); |
| 370 | 370 | }): |
| 371 | 371 | [], |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | return new InputObjectType([ |
| 391 | 391 | 'name' => $def->name->value, |
| 392 | 392 | 'description' => $this->getDescription($def), |
| 393 | - 'fields' => function () use ($def) { |
|
| 393 | + 'fields' => function() use ($def) { |
|
| 394 | 394 | return $def->fields |
| 395 | 395 | ? $this->makeInputValues($def->fields) |
| 396 | 396 | : []; |
@@ -470,7 +470,7 @@ |
||
| 470 | 470 | function($field) use ($variables) { return self::valueFromASTUntyped($field->value, $variables); }, |
| 471 | 471 | iterator_to_array($valueNode->fields) |
| 472 | 472 | ) |
| 473 | - ); |
|
| 473 | + ); |
|
| 474 | 474 | case $valueNode instanceof VariableNode: |
| 475 | 475 | $variableName = $valueNode->name->value; |
| 476 | 476 | return ($variables && isset($variables[$variableName])) |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | foreach ($node as $key => $value) { |
| 83 | 83 | if ('loc' === $key || 'kind' === $key) { |
| 84 | - continue ; |
|
| 84 | + continue; |
|
| 85 | 85 | } |
| 86 | 86 | if (is_array($value)) { |
| 87 | 87 | if (isset($value[0]) || empty($value)) { |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | $coercedObj = []; |
| 366 | 366 | $fields = $type->getFields(); |
| 367 | - $fieldNodes = Utils::keyMap($valueNode->fields, function($field) {return $field->name->value;}); |
|
| 367 | + $fieldNodes = Utils::keyMap($valueNode->fields, function($field) {return $field->name->value; }); |
|
| 368 | 368 | foreach ($fields as $field) { |
| 369 | 369 | /** @var ValueNode $fieldNode */ |
| 370 | 370 | $fieldName = $field->name; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | // Invalid: intentionally return no value. |
| 378 | 378 | return $undefined; |
| 379 | 379 | } |
| 380 | - continue ; |
|
| 380 | + continue; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | $fieldValue = self::valueFromAST($fieldNode ? $fieldNode->value : null, $field->getType(), $variables); |