@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ->addField('id', TypeMap::TYPE_ID, ['required' => true]) |
| 22 | 22 | ->addField('name', TypeMap::TYPE_STRING, ['required' => true]) |
| 23 | 23 | ->addField('friends', new ListType(new CharacterInterface()), [ |
| 24 | - 'resolve' => function ($value) { |
|
| 24 | + 'resolve' => function($value) { |
|
| 25 | 25 | return $value['friends']; |
| 26 | 26 | } |
| 27 | 27 | ]) |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | parent::build($config); |
| 30 | 30 | |
| 31 | - $config->getField('friends')->getConfig()->set('resolve', function ($droid) { |
|
| 31 | + $config->getField('friends')->getConfig()->set('resolve', function($droid) { |
|
| 32 | 32 | return StarWarsData::getFriends($droid); |
| 33 | 33 | }); |
| 34 | 34 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Youshido\GraphQL\Type\Object\ObjectType; |
| 7 | 7 | use Youshido\GraphQL\Type\Scalar\StringType; |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 9 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 10 | 10 | |
| 11 | 11 | $processor = new Processor(); |
| 12 | 12 | $processor->setSchema(new Schema([ |
@@ -24,4 +24,4 @@ discard block |
||
| 24 | 24 | ])); |
| 25 | 25 | |
| 26 | 26 | $processor->processRequest('{ currentTime }'); |
| 27 | -echo json_encode($processor->getResponseData()) . "\n"; |
|
| 27 | +echo json_encode($processor->getResponseData())."\n"; |
|
@@ -9,15 +9,15 @@ |
||
| 9 | 9 | use Youshido\GraphQL\Type\Scalar\StringType; |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 13 | -require_once __DIR__ . '/inline-schema.php'; |
|
| 12 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 13 | +require_once __DIR__.'/inline-schema.php'; |
|
| 14 | 14 | /** @var ObjectType $rootQueryType */ |
| 15 | 15 | |
| 16 | 16 | $processor = new Processor(); |
| 17 | 17 | $processor->setSchema(new Schema([ |
| 18 | 18 | 'query' => $rootQueryType |
| 19 | 19 | ])); |
| 20 | -$payload = '{ latestPost { title(truncated: true), summary } }'; |
|
| 20 | +$payload = '{ latestPost { title(truncated: true), summary } }'; |
|
| 21 | 21 | |
| 22 | 22 | $processor->processRequest($payload); |
| 23 | -echo json_encode($processor->getResponseData()) . "\n"; |
|
| 24 | 23 | \ No newline at end of file |
| 24 | +echo json_encode($processor->getResponseData())."\n"; |
|
| 25 | 25 | \ No newline at end of file |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Youshido\GraphQL\Processor; |
| 7 | 7 | use Youshido\GraphQL\Schema; |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/schema-bootstrap.php'; |
|
| 9 | +require_once __DIR__.'/schema-bootstrap.php'; |
|
| 10 | 10 | /** @var Schema $schema */ |
| 11 | 11 | $schema = new BlogSchema(); |
| 12 | 12 | |
@@ -21,4 +21,4 @@ discard block |
||
| 21 | 21 | $payload = 'mutation { createPost(author: "Alex", post: {title: "Hey, this is my new post", summary: "my post" }) { title } }'; |
| 22 | 22 | |
| 23 | 23 | $processor->processRequest($payload); |
| 24 | -echo json_encode($processor->getResponseData()) . "\n"; |
|
| 24 | +echo json_encode($processor->getResponseData())."\n"; |
|
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | protected function executeMutation(Mutation $mutation, $currentLevelSchema) |
| 159 | 159 | { |
| 160 | - if (!$currentLevelSchema) throw new ConfigurationException('There is no mutation ' . $mutation->getName()); |
|
| 160 | + if (!$currentLevelSchema) throw new ConfigurationException('There is no mutation '.$mutation->getName()); |
|
| 161 | 161 | |
| 162 | 162 | if (!$this->resolveValidator->checkFieldExist($currentLevelSchema, $mutation)) { |
| 163 | 163 | return null; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | } elseif ($field->getType()->getKind() == TypeMap::KIND_NON_NULL) { |
| 248 | 248 | if (!$field->getType()->isValidValue($preResolvedValue)) { |
| 249 | - $this->resolveValidator->addError(new ResolveException(sprintf('Cannot return null for non-nullable field %s', $astField->getName() . '.' . $field->getName()))); |
|
| 249 | + $this->resolveValidator->addError(new ResolveException(sprintf('Cannot return null for non-nullable field %s', $astField->getName().'.'.$field->getName()))); |
|
| 250 | 250 | } elseif (!$field->getType()->getNullableType()->isValidValue($preResolvedValue)) { |
| 251 | 251 | $this->resolveValidator->addError(new ResolveException(sprintf('Not valid value for %s field %s', $field->getType()->getNullableType()->getKind(), $field->getName()))); |
| 252 | 252 | $value = null; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | protected function getPropertyValue($data, $path) |
| 358 | 358 | { |
| 359 | 359 | if (is_object($data)) { |
| 360 | - $getter = 'get' . $this->classify($path); |
|
| 360 | + $getter = 'get'.$this->classify($path); |
|
| 361 | 361 | |
| 362 | 362 | return is_callable([$data, $getter]) ? $data->$getter() : null; |
| 363 | 363 | } elseif (is_array($data)) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $name = $name == 'Datetime' ? 'DateTime' : $name; |
| 98 | 98 | $name = $name == 'Datetimetz' ? 'DateTimeTz' : $name; |
| 99 | 99 | |
| 100 | - $className = 'Youshido\GraphQL\Type\Scalar\\' . $name . 'Type'; |
|
| 100 | + $className = 'Youshido\GraphQL\Type\Scalar\\'.$name.'Type'; |
|
| 101 | 101 | self::$scalarObjectsCache[$type] = new $className(); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | public static function isScalarType($typeName) |
| 117 | 117 | { |
| 118 | - if(is_object($typeName)) { |
|
| 118 | + if (is_object($typeName)) { |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | |