@@ -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 | |
@@ -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); |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $result = []; |
| 402 | 402 | foreach ($resolvedValue as $resolvedValueItem) { |
| 403 | 403 | try { |
| 404 | - $fakeField->getConfig()->set('resolve', function () use ($resolvedValueItem) { |
|
| 404 | + $fakeField->getConfig()->set('resolve', function() use ($resolvedValueItem) { |
|
| 405 | 405 | return $resolvedValueItem; |
| 406 | 406 | }); |
| 407 | 407 | |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | /** @var AbstractUnionType $type */ |
| 454 | - $type = $field->getType()->getNullableType(); |
|
| 454 | + $type = $field->getType()->getNullableType(); |
|
| 455 | 455 | $resolveInfo = new ResolveInfo( |
| 456 | 456 | $field, |
| 457 | 457 | $ast instanceof AstQuery ? $ast->getFields() : [], |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | if ($this->hasDefaultValue()) { |
| 72 | 72 | return $this->defaultValue; |
| 73 | 73 | } |
| 74 | - throw new \LogicException('Value is not set for variable "' . $this->name . '"'); |
|
| 74 | + throw new \LogicException('Value is not set for variable "'.$this->name.'"'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $this->value; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'args' => [ |
| 24 | 24 | 'ids' => new ListType(new NonNullType(new IdType())), |
| 25 | 25 | ], |
| 26 | - 'resolve' => function () { |
|
| 26 | + 'resolve' => function() { |
|
| 27 | 27 | return 'item'; |
| 28 | 28 | }, |
| 29 | 29 | ], |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'args' => [ |
| 101 | 101 | 'sortOrder' => new StringType(), |
| 102 | 102 | ], |
| 103 | - 'resolve' => function ($args) { |
|
| 103 | + 'resolve' => function($args) { |
|
| 104 | 104 | return sprintf('Result with %s order', empty($args['sortOrder']) ? 'default' : $args['sortOrder']); |
| 105 | 105 | }, |
| 106 | 106 | ], |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | foreach (TypeFactory::getScalarTypesNames() as $typeName) { |
| 24 | 24 | $scalarType = TypeFactory::getScalarType($typeName); |
| 25 | - $testDataMethod = 'get' . $typeName . 'TestData'; |
|
| 25 | + $testDataMethod = 'get'.$typeName.'TestData'; |
|
| 26 | 26 | |
| 27 | 27 | $this->assertNotEmpty($scalarType->getDescription()); |
| 28 | 28 | $this->assertEquals($scalarType->getKind(), TypeMap::KIND_SCALAR); |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | $this->assertParse($scalarType, $data, $serialized, $typeName); |
| 39 | 39 | |
| 40 | 40 | if ($isValid) { |
| 41 | - $this->assertTrue($scalarType->isValidValue($data), $typeName . ' validation for :' . serialize($data)); |
|
| 41 | + $this->assertTrue($scalarType->isValidValue($data), $typeName.' validation for :'.serialize($data)); |
|
| 42 | 42 | } else { |
| 43 | - $this->assertFalse($scalarType->isValidValue($data), $typeName . ' validation for :' . serialize($data)); |
|
| 43 | + $this->assertFalse($scalarType->isValidValue($data), $typeName.' validation for :'.serialize($data)); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | private function assertSerialization(AbstractScalarType $object, $input, $expected) |
| 63 | 63 | { |
| 64 | - $this->assertEquals($expected, $object->serialize($input), $object->getName() . ' serialize for: ' . serialize($input)); |
|
| 64 | + $this->assertEquals($expected, $object->serialize($input), $object->getName().' serialize for: '.serialize($input)); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | private function assertParse(AbstractScalarType $object, $input, $expected, $typeName) |
@@ -72,6 +72,6 @@ discard block |
||
| 72 | 72 | $parsed = \DateTime::createFromFormat('Y-m-d H:i:s', $parsed->format('Y-m-d H:i:s')); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $this->assertEquals($expected, $parsed, $object->getName() . ' parse for: ' . serialize($input)); |
|
| 75 | + $this->assertEquals($expected, $parsed, $object->getName().' parse for: '.serialize($input)); |
|
| 76 | 76 | } |
| 77 | 77 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | public function parseValue($value) |
| 79 | 79 | { |
| 80 | - foreach ((array) $value as $keyValue => $valueItem) { |
|
| 80 | + foreach ((array)$value as $keyValue => $valueItem) { |
|
| 81 | 81 | $value[$keyValue] = $this->getItemType()->parseValue($valueItem); |
| 82 | 82 | } |
| 83 | 83 | |