@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | public function testGetValue($actual, $expected) |
| 16 | 16 | { |
| 17 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 17 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 18 | 18 | $var->setValue($actual); |
| 19 | 19 | $this->assertEquals($var->getValue(), $expected); |
| 20 | 20 | } |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function testGetNullValueException() |
| 27 | 27 | { |
| 28 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 28 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 29 | 29 | $var->getValue(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function testGetValueReturnsDefaultValueIfNoValueSet() |
| 33 | 33 | { |
| 34 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 34 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 35 | 35 | $var->setDefaultValue('default-value'); |
| 36 | 36 | |
| 37 | 37 | $this->assertEquals( |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function testGetValueReturnsSetValueEvenWithDefaultValue() |
| 44 | 44 | { |
| 45 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 45 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 46 | 46 | $var->setValue('real-value'); |
| 47 | 47 | $var->setDefaultValue('default-value'); |
| 48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function testIndicatesDefaultValuePresent() |
| 56 | 56 | { |
| 57 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 57 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 58 | 58 | $var->setDefaultValue('default-value'); |
| 59 | 59 | |
| 60 | 60 | $this->assertTrue( |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function testHasNoDefaultValue() |
| 66 | 66 | { |
| 67 | - $var = new Variable('foo', 'bar', false, false, true, new Location(1,1)); |
|
| 67 | + $var = new Variable('foo', 'bar', false, false, true, new Location(1, 1)); |
|
| 68 | 68 | |
| 69 | 69 | $this->assertFalse( |
| 70 | 70 | $var->hasDefaultValue() |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | public function __construct($config = []) |
| 25 | 25 | { |
| 26 | 26 | if (!array_key_exists('query', $config)) { |
| 27 | - $config['query'] = new InternalSchemaQueryObject(['name' => $this->getName($config) . 'Query']); |
|
| 27 | + $config['query'] = new InternalSchemaQueryObject(['name' => $this->getName($config).'Query']); |
|
| 28 | 28 | } |
| 29 | 29 | if (!array_key_exists('mutation', $config)) { |
| 30 | - $config['mutation'] = new InternalSchemaMutationObject(['name' => $this->getName($config) . 'Mutation']); |
|
| 30 | + $config['mutation'] = new InternalSchemaMutationObject(['name' => $this->getName($config).'Mutation']); |
|
| 31 | 31 | } |
| 32 | 32 | if (!array_key_exists('types', $config)) { |
| 33 | 33 | $config['types'] = []; |
@@ -80,6 +80,6 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $defaultName = 'RootSchema'; |
| 82 | 82 | |
| 83 | - return isset($config["name"])? $config["name"] : $defaultName; |
|
| 83 | + return isset($config["name"]) ? $config["name"] : $defaultName; |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (is_file(__DIR__ . '/../../../../../vendor/autoload.php')) { |
|
| 4 | - require_once __DIR__ . '/../../../../../vendor/autoload.php'; |
|
| 3 | +if (is_file(__DIR__.'/../../../../../vendor/autoload.php')) { |
|
| 4 | + require_once __DIR__.'/../../../../../vendor/autoload.php'; |
|
| 5 | 5 | } |
| 6 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 7 | -require_once __DIR__ . '/Schema/Type/BookType.php'; |
|
| 8 | -require_once __DIR__ . '/Schema/Type/AuthorType.php'; |
|
| 9 | -require_once __DIR__ . '/Schema/Type/CategoryType.php'; |
|
| 10 | -require_once __DIR__ . '/Schema/Field/Book/RecentBooksField.php'; |
|
| 11 | -require_once __DIR__ . '/Schema/Field/CategoriesField.php'; |
|
| 12 | -require_once __DIR__ . '/DataProvider.php'; |
|
| 13 | -require_once __DIR__ . '/Schema/BookStoreSchema.php'; |
|
| 6 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 7 | +require_once __DIR__.'/Schema/Type/BookType.php'; |
|
| 8 | +require_once __DIR__.'/Schema/Type/AuthorType.php'; |
|
| 9 | +require_once __DIR__.'/Schema/Type/CategoryType.php'; |
|
| 10 | +require_once __DIR__.'/Schema/Field/Book/RecentBooksField.php'; |
|
| 11 | +require_once __DIR__.'/Schema/Field/CategoriesField.php'; |
|
| 12 | +require_once __DIR__.'/DataProvider.php'; |
|
| 13 | +require_once __DIR__.'/Schema/BookStoreSchema.php'; |
|
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | |
| 25 | 25 | public function resolve($value, array $args, ResolveInfo $info) |
| 26 | 26 | { |
| 27 | - return new DeferredResolver(function () use ($value) { |
|
| 28 | - $id = empty($value['id']) ? "1" : $value['id'] . ".1"; |
|
| 27 | + return new DeferredResolver(function() use ($value) { |
|
| 28 | + $id = empty($value['id']) ? "1" : $value['id'].".1"; |
|
| 29 | 29 | |
| 30 | 30 | return [ |
| 31 | 31 | 'id' => $id, |
| 32 | - 'title' => 'Category ' . $id, |
|
| 32 | + 'title' => 'Category '.$id, |
|
| 33 | 33 | 'authors' => [ |
| 34 | 34 | [ |
| 35 | 35 | 'id' => 'author1', |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $config->getQuery()->addFields([ |
| 25 | 25 | 'authors' => [ |
| 26 | 26 | 'type' => new ListType(new AuthorType()), |
| 27 | - 'resolve' => function () { |
|
| 27 | + 'resolve' => function() { |
|
| 28 | 28 | return DataProvider::getAuthors(); |
| 29 | 29 | } |
| 30 | 30 | ], |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $key = md5(serialize($ids)); |
| 59 | 59 | $this->buffer[$key] = $ids; |
| 60 | 60 | |
| 61 | - return function () use ($key) { |
|
| 61 | + return function() use ($key) { |
|
| 62 | 62 | return $this->fetch($key); |
| 63 | 63 | }; |
| 64 | 64 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | [ |
| 106 | 106 | 'name' => 'name', |
| 107 | 107 | 'type' => new StringType(), |
| 108 | - 'resolve' => function ($value) { |
|
| 108 | + 'resolve' => function($value) { |
|
| 109 | 109 | return $value['name']; |
| 110 | 110 | }, |
| 111 | 111 | ] |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | [ |
| 118 | 118 | 'name' => 'friends', |
| 119 | 119 | 'type' => new ListType(new DeferredUserType($this->database)), |
| 120 | - 'resolve' => function ($value) { |
|
| 120 | + 'resolve' => function($value) { |
|
| 121 | 121 | return new DeferredResolver( |
| 122 | 122 | $this->database->add($value['friends']) |
| 123 | 123 | ); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | [ |
| 132 | 132 | 'name' => 'foes', |
| 133 | 133 | 'type' => new ListType(new DeferredUserType($this->database)), |
| 134 | - 'resolve' => function ($value) { |
|
| 134 | + 'resolve' => function($value) { |
|
| 135 | 135 | return new DeferredResolver( |
| 136 | 136 | $this->database->add($value['foes']) |
| 137 | 137 | ); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | [ |
| 152 | 152 | 'name' => 'users', |
| 153 | 153 | 'type' => new ListType(new DeferredUserType($buffer)), |
| 154 | - 'resolve' => function ($value, $args) use ($buffer) { |
|
| 154 | + 'resolve' => function($value, $args) use ($buffer) { |
|
| 155 | 155 | return new DeferredResolver($buffer->add($args['ids'])); |
| 156 | 156 | }, |
| 157 | 157 | ] |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | if ($fieldConfig instanceof FieldInterface) { |
| 53 | 53 | $this->fields[$fieldConfig->getName()] = $fieldConfig; |
| 54 | 54 | continue; |
| 55 | - } elseif($fieldConfig instanceof InputFieldInterface) { |
|
| 55 | + } elseif ($fieldConfig instanceof InputFieldInterface) { |
|
| 56 | 56 | $this->fields[$fieldConfig->getName()] = $fieldConfig; |
| 57 | 57 | continue; |
| 58 | 58 | } else { |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | |
| 108 | 108 | public function testFieldWithInputFieldArgument() |
| 109 | 109 | { |
| 110 | - $schema = new Schema([ |
|
| 110 | + $schema = new Schema([ |
|
| 111 | 111 | 'query' => new ObjectType([ |
| 112 | 112 | 'name' => 'RootQuery', |
| 113 | 113 | 'fields' => [ |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (is_file(__DIR__ . '/../../../../../vendor/autoload.php')) { |
|
| 3 | - require_once __DIR__ . '/../../../../../vendor/autoload.php'; |
|
| 2 | +if (is_file(__DIR__.'/../../../../../vendor/autoload.php')) { |
|
| 3 | + require_once __DIR__.'/../../../../../vendor/autoload.php'; |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
| 7 | -require_once __DIR__ . '/Schema/FactionType.php'; |
|
| 8 | -require_once __DIR__ . '/Schema/ShipType.php'; |
|
| 9 | -require_once __DIR__ . '/Schema/TestDataProvider.php'; |
|
| 10 | -require_once __DIR__ . '/Schema/StarWarsRelaySchema.php'; |
|
| 6 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
| 7 | +require_once __DIR__.'/Schema/FactionType.php'; |
|
| 8 | +require_once __DIR__.'/Schema/ShipType.php'; |
|
| 9 | +require_once __DIR__.'/Schema/TestDataProvider.php'; |
|
| 10 | +require_once __DIR__.'/Schema/StarWarsRelaySchema.php'; |
|