@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $edgeFields = !empty($config['edgeFields']) ? $config['edgeFields'] : []; |
53 | 53 | |
54 | 54 | $edgeType = new ObjectType([ |
55 | - 'name' => $name . 'Edge', |
|
55 | + 'name' => $name.'Edge', |
|
56 | 56 | 'description' => 'An edge in a connection.', |
57 | 57 | 'fields' => array_merge([ |
58 | 58 | 'node' => [ |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $connectionFields = !empty($config['connectionFields']) ? $config['connectionFields'] : []; |
85 | 85 | |
86 | 86 | $connectionType = new ObjectType([ |
87 | - 'name' => $name . 'Connection', |
|
87 | + 'name' => $name.'Connection', |
|
88 | 88 | 'description' => 'A connection to a list of items.', |
89 | 89 | 'fields' => array_merge([ |
90 | 90 | 'pageInfo' => [ |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function isValidValue($value) |
44 | 44 | { |
45 | - if($value instanceof InputObject) { |
|
45 | + if ($value instanceof InputObject) { |
|
46 | 46 | $value = $value->getValue(); |
47 | 47 | } |
48 | 48 | |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $typeConfig = $this->getConfig(); |
54 | - $requiredFields = array_filter($typeConfig->getFields(), function (FieldInterface $field) { |
|
54 | + $requiredFields = array_filter($typeConfig->getFields(), function(FieldInterface $field) { |
|
55 | 55 | return $field->getType()->getKind() == TypeMap::KIND_NON_NULL; |
56 | 56 | }); |
57 | 57 | |
58 | 58 | foreach ($value as $valueKey => $valueItem) { |
59 | - if($valueItem instanceof Variable) { |
|
59 | + if ($valueItem instanceof Variable) { |
|
60 | 60 | $valueItem = $valueItem->getValue(); |
61 | 61 | } |
62 | 62 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $typeConfig = $this->getConfig(); |
88 | 88 | foreach ($value as $valueKey => $item) { |
89 | - if($item instanceof Variable) { |
|
89 | + if ($item instanceof Variable) { |
|
90 | 90 | $item = $item->getValue(); |
91 | 91 | } |
92 | 92 |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function validateArguments(FieldInterface $field, $query, Request $request) |
67 | 67 | { |
68 | - $requiredArguments = array_filter($field->getArguments(), function (InputField $argument) { |
|
68 | + $requiredArguments = array_filter($field->getArguments(), function(InputField $argument) { |
|
69 | 69 | return $argument->getType()->getKind() == TypeMap::KIND_NON_NULL; |
70 | 70 | }); |
71 | 71 | |
72 | - $withDefaultArguments = array_filter($field->getArguments(), function (InputField $argument) { |
|
72 | + $withDefaultArguments = array_filter($field->getArguments(), function(InputField $argument) { |
|
73 | 73 | return $argument->getConfig()->get('default') !== null; |
74 | 74 | }); |
75 | 75 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | foreach ($argument->getValue()->getValue() as $item) { |
97 | - if(!$this->processInputObject($item, $argumentType, $request)) { |
|
97 | + if (!$this->processInputObject($item, $argumentType, $request)) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | public function assertTypeImplementsInterface(AbstractType $type, AbstractInterfaceType $interface) |
187 | 187 | { |
188 | 188 | if (!$interface->isValidValue($type)) { |
189 | - throw new ResolveException('Type ' . $type->getName() . ' does not implement ' . $interface->getName()); |
|
189 | + throw new ResolveException('Type '.$type->getName().' does not implement '.$interface->getName()); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | if (!$valid) { |
208 | - throw new ResolveException('Type ' . $type->getName() . ' not exist in types of ' . $unionType->getName()); |
|
208 | + throw new ResolveException('Type '.$type->getName().' not exist in types of '.$unionType->getName()); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | if (!is_array($types)) { |
25 | 25 | throw new \Exception('addTypes accept only array of types'); |
26 | 26 | } |
27 | - foreach($types as $type) { |
|
27 | + foreach ($types as $type) { |
|
28 | 28 | $this->addType($type); |
29 | 29 | } |
30 | 30 | return $this; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/../../../../../vendor/autoload.php'; |
|
4 | -require_once __DIR__ . '/Schema/FactionType.php'; |
|
5 | -require_once __DIR__ . '/Schema/ShipType.php'; |
|
6 | -require_once __DIR__ . '/Schema/TestDataProvider.php'; |
|
7 | -require_once __DIR__ . '/Schema/StarWarsRelaySchema.php'; |
|
3 | +require_once __DIR__.'/../../../../../vendor/autoload.php'; |
|
4 | +require_once __DIR__.'/Schema/FactionType.php'; |
|
5 | +require_once __DIR__.'/Schema/ShipType.php'; |
|
6 | +require_once __DIR__.'/Schema/TestDataProvider.php'; |
|
7 | +require_once __DIR__.'/Schema/StarWarsRelaySchema.php'; |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace BlogTest; |
4 | 4 | |
5 | -require_once __DIR__ . '/../../../../../vendor/autoload.php'; |
|
6 | -require_once __DIR__ . '/Schema/DataProvider.php'; |
|
7 | -require_once __DIR__ . '/Schema/PostType.php'; |
|
8 | -require_once __DIR__ . '/Schema/PostStatus.php'; |
|
9 | -require_once __DIR__ . '/Schema/ContentBlockInterface.php'; |
|
10 | -require_once __DIR__ . '/Schema/LikePostField.php'; |
|
11 | -require_once __DIR__ . '/Schema/BannerType.php'; |
|
12 | -require_once __DIR__ . '/Schema/ContentBlockUnion.php'; |
|
13 | -require_once __DIR__ . '/Schema/PostInputType.php'; |
|
14 | -require_once __DIR__ . '/Schema/BlogSchema.php'; |
|
5 | +require_once __DIR__.'/../../../../../vendor/autoload.php'; |
|
6 | +require_once __DIR__.'/Schema/DataProvider.php'; |
|
7 | +require_once __DIR__.'/Schema/PostType.php'; |
|
8 | +require_once __DIR__.'/Schema/PostStatus.php'; |
|
9 | +require_once __DIR__.'/Schema/ContentBlockInterface.php'; |
|
10 | +require_once __DIR__.'/Schema/LikePostField.php'; |
|
11 | +require_once __DIR__.'/Schema/BannerType.php'; |
|
12 | +require_once __DIR__.'/Schema/ContentBlockUnion.php'; |
|
13 | +require_once __DIR__.'/Schema/PostInputType.php'; |
|
14 | +require_once __DIR__.'/Schema/BlogSchema.php'; |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | use Youshido\GraphQL\Type\Object\ObjectType; |
8 | 8 | |
9 | 9 | |
10 | -require_once __DIR__ . '/../../../../../vendor/autoload.php'; |
|
11 | -require_once __DIR__ . '/inline-schema.php'; |
|
10 | +require_once __DIR__.'/../../../../../vendor/autoload.php'; |
|
11 | +require_once __DIR__.'/inline-schema.php'; |
|
12 | 12 | /** @var ObjectType $rootQueryType */ |
13 | 13 | |
14 | 14 | $processor = new Processor(new Schema([ |
@@ -17,4 +17,4 @@ discard block |
||
17 | 17 | $payload = '{ latestPost { title(truncated: true), summary } }'; |
18 | 18 | |
19 | 19 | $processor->processPayload($payload); |
20 | -echo json_encode($processor->getResponseData()) . "\n"; |
|
20 | +echo json_encode($processor->getResponseData())."\n"; |
@@ -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(new Schema([ |
12 | 12 | 'query' => new ObjectType([ |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | 'fields' => [ |
15 | 15 | 'currentTime' => [ |
16 | 16 | 'type' => new StringType(), |
17 | - 'resolve' => function () { |
|
17 | + 'resolve' => function() { |
|
18 | 18 | return date('Y-m-d H:ia'); |
19 | 19 | } |
20 | 20 | ] |
@@ -23,4 +23,4 @@ discard block |
||
23 | 23 | ])); |
24 | 24 | |
25 | 25 | $processor->processPayload('{ currentTime }'); |
26 | -echo json_encode($processor->getResponseData()) . "\n"; |
|
26 | +echo json_encode($processor->getResponseData())."\n"; |