@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | |
| 21 | 21 | |
| 22 | - $schema = new Schema([ |
|
| 22 | + $schema = new Schema([ |
|
| 23 | 23 | 'query' => new ObjectType([ |
| 24 | 24 | 'name' => 'RootQuery', |
| 25 | 25 | 'fields' => [ |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ] |
| 48 | 48 | ])) |
| 49 | 49 | ], |
| 50 | - 'resolve' => function ($source, $args) { |
|
| 50 | + 'resolve' => function($source, $args) { |
|
| 51 | 51 | return [ |
| 52 | 52 | 'id' => '1', |
| 53 | 53 | 'name' => sprintf('Meeting with %d beans', count($args['related_beans'])), |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $typeConfig = $this->getConfig(); |
| 57 | - $requiredFields = array_filter($typeConfig->getFields(), function (FieldInterface $field) { |
|
| 57 | + $requiredFields = array_filter($typeConfig->getFields(), function(FieldInterface $field) { |
|
| 58 | 58 | return $field->getType()->getKind() == TypeMap::KIND_NON_NULL; |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public function parseValue($value) |
| 88 | 88 | { |
| 89 | 89 | if (is_null($value)) return null; |
| 90 | - if($value instanceof InputObject) { |
|
| 90 | + if ($value instanceof InputObject) { |
|
| 91 | 91 | $value = $value->getValue(); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -86,7 +86,9 @@ |
||
| 86 | 86 | |
| 87 | 87 | public function parseValue($value) |
| 88 | 88 | { |
| 89 | - if (is_null($value)) return null; |
|
| 89 | + if (is_null($value)) { |
|
| 90 | + return null; |
|
| 91 | + } |
|
| 90 | 92 | if($value instanceof InputObject) { |
| 91 | 93 | $value = $value->getValue(); |
| 92 | 94 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | } |
| 11 | 11 | if ($_SERVER['REQUEST_URI'] == '/graphiql.css') { |
| 12 | 12 | header('Content-Type: text/css'); |
| 13 | - readfile(__DIR__ . '/../GraphiQL/graphiql.css'); |
|
| 13 | + readfile(__DIR__.'/../GraphiQL/graphiql.css'); |
|
| 14 | 14 | die(); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Youshido\GraphQL\Execution\Processor; |
| 19 | 19 | use Youshido\GraphQL\Schema\Schema; |
| 20 | 20 | |
| 21 | -require_once __DIR__ . '/schema-bootstrap.php'; |
|
| 21 | +require_once __DIR__.'/schema-bootstrap.php'; |
|
| 22 | 22 | /** @var Schema $schema */ |
| 23 | 23 | $schema = new BookStoreSchema(); |
| 24 | 24 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $variables = isset($requestData['variables']) ? $requestData['variables'] : null; |
| 36 | 36 | |
| 37 | 37 | if (empty($payload)) { |
| 38 | - $GraphiQLData = file_get_contents(__DIR__ . '/../GraphiQL/index.html'); |
|
| 38 | + $GraphiQLData = file_get_contents(__DIR__.'/../GraphiQL/index.html'); |
|
| 39 | 39 | echo $GraphiQLData; |
| 40 | 40 | die(); |
| 41 | 41 | } |
@@ -1,11 +1,11 @@ |
||
| 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/Field/Book/RecentBooksField.php'; |
|
| 10 | -require_once __DIR__ . '/DataProvider.php'; |
|
| 11 | -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/Field/Book/RecentBooksField.php'; |
|
| 10 | +require_once __DIR__.'/DataProvider.php'; |
|
| 11 | +require_once __DIR__.'/Schema/BookStoreSchema.php'; |
|
@@ -129,9 +129,9 @@ |
||
| 129 | 129 | if (is_object($data)) { |
| 130 | 130 | $getter = $path; |
| 131 | 131 | if (substr($path, 0, 2) != 'is') { |
| 132 | - $getter = 'get' . self::classify($path); |
|
| 132 | + $getter = 'get'.self::classify($path); |
|
| 133 | 133 | if (!is_callable([$data, $getter])) { |
| 134 | - $getter = 'is' . self::classify($path); |
|
| 134 | + $getter = 'is'.self::classify($path); |
|
| 135 | 135 | } |
| 136 | 136 | if (!is_callable([$data, $getter])) { |
| 137 | 137 | $getter = self::classify($path); |
@@ -27,12 +27,12 @@ |
||
| 27 | 27 | |
| 28 | 28 | private function createExecutionChain($middlewareList) |
| 29 | 29 | { |
| 30 | - $lastCallable = function () {}; // Last callable is a NO-OP |
|
| 30 | + $lastCallable = function() {}; // Last callable is a NO-OP |
|
| 31 | 31 | while ($middleware = array_pop($middlewareList)) { |
| 32 | - if (! $middleware instanceof ErrorHandlerMiddlewareInterface) { |
|
| 32 | + if (!$middleware instanceof ErrorHandlerMiddlewareInterface) { |
|
| 33 | 33 | throw InvalidErrorHandlerMiddlewareException::forMiddleware($middleware); |
| 34 | 34 | } |
| 35 | - $lastCallable = function ($error, ExecutionContext $executionContext) use ($middleware, $lastCallable) { |
|
| 35 | + $lastCallable = function($error, ExecutionContext $executionContext) use ($middleware, $lastCallable) { |
|
| 36 | 36 | return $middleware->execute($error, $executionContext, $lastCallable); |
| 37 | 37 | }; |
| 38 | 38 | } |