Completed
Pull Request — master (#204)
by Ryan
11:34
created
examples/04_bookstore/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Execution/Processor.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -149,6 +149,9 @@  discard block
 block discarded – undo
149 149
         return [$this->getAlias($query) => $value];
150 150
     }
151 151
 
152
+    /**
153
+     * @return AstFieldInterface
154
+     */
152 155
     protected function resolveField(FieldInterface $field, AstFieldInterface $ast, $parentValue = null, $fromObject = false)
153 156
     {
154 157
         try {
@@ -220,6 +223,9 @@  discard block
 block discarded – undo
220 223
         }
221 224
     }
222 225
 
226
+    /**
227
+     * @param \Youshido\GraphQL\Parser\Ast\Interfaces\ValueInterface $argumentValue
228
+     */
223 229
     private function prepareArgumentValue($argumentValue, AbstractType $argumentType, Request $request)
224 230
     {
225 231
         switch ($argumentType->getKind()) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -337,9 +337,9 @@  discard block
 block discarded – undo
337 337
             }
338 338
 
339 339
             $fakeField = new Field([
340
-              'name' => $field->getName(),
341
-              'type' => $itemType,
342
-              'args' => $field->getArguments(),
340
+                'name' => $field->getName(),
341
+                'type' => $itemType,
342
+                'args' => $field->getArguments(),
343 343
             ]);
344 344
 
345 345
             $result = [];
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
             }
442 442
 
443 443
             $fakeField = new Field([
444
-              'name' => $field->getName(),
445
-              'type' => $resolvedType,
446
-              'args' => $field->getArguments(),
444
+                'name' => $field->getName(),
445
+                'type' => $resolvedType,
446
+                'args' => $field->getArguments(),
447 447
             ]);
448 448
 
449 449
             return $this->resolveObject($fakeField, $ast, $resolvedValue, true);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * http://opensource.org/licenses/MIT
10 10
  */
11 11
 
12
-declare(strict_types=1);
12
+declare(strict_types = 1);
13 13
 /**
14 14
  * Date: 03.11.16.
15 15
  */
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     {
305 305
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
306 306
 
307
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
307
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
308 308
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
309 309
 
310 310
             /** @var AbstractScalarType $type */
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         /** @var AstQuery $ast */
320 320
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
321 321
 
322
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
322
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
323 323
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
324 324
 
325 325
             if (null === $resolvedValue) {
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
             foreach ($resolvedValue as $resolvedValueItem) {
348 348
                 try {
349
-                    $fakeField->getConfig()->set('resolve', static function () use ($resolvedValueItem) {
349
+                    $fakeField->getConfig()->set('resolve', static function() use ($resolvedValueItem) {
350 350
                         return $resolvedValueItem;
351 351
                     });
352 352
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             $resolvedValue = $this->doResolve($field, $ast, $parentValue);
393 393
         }
394 394
 
395
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
395
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
396 396
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
397 397
 
398 398
             if (null === $resolvedValue) {
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
         /** @var AstQuery $ast */
415 415
         $resolvedValue = $this->doResolve($field, $ast, $parentValue);
416 416
 
417
-        return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
417
+        return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
418 418
             $this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
419 419
 
420 420
             if (null === $resolvedValue) {
Please login to merge, or discard this patch.
examples/04_bookstore/schema-bootstrap.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
examples/04_bookstore/Schema/Field/CategoriesField.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
examples/04_bookstore/Schema/BookStoreSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
             ],
Please login to merge, or discard this patch.
examples/03_relay_star_wars/schema-bootstrap.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
examples/03_relay_star_wars/router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 }
10 10
 if ($_SERVER['REQUEST_URI'] == '/graphiql.css') {
11 11
     header('Content-Type: text/css');
12
-    readfile(__DIR__ . '/../GraphiQL/graphiql.css');
12
+    readfile(__DIR__.'/../GraphiQL/graphiql.css');
13 13
     die();
14 14
 }
15 15
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use Youshido\GraphQL\Execution\Processor;
18 18
 use Youshido\GraphQL\Schema\Schema;
19 19
 
20
-require_once __DIR__ . '/schema-bootstrap.php';
20
+require_once __DIR__.'/schema-bootstrap.php';
21 21
 /** @var Schema $schema */
22 22
 $schema = new StarWarsRelaySchema();
23 23
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $variables = isset($requestData['variables']) ? $requestData['variables'] : null;
35 35
 
36 36
 if (empty($payload)) {
37
-    $GraphiQLData = file_get_contents(__DIR__ . '/../GraphiQL/index.html');
37
+    $GraphiQLData = file_get_contents(__DIR__.'/../GraphiQL/index.html');
38 38
     echo $GraphiQLData;
39 39
     die();
40 40
 }
Please login to merge, or discard this patch.
src/Config/AbstractConfig.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     }
148 148
 
149 149
     /**
150
-     * @param      $key
150
+     * @param      string $key
151 151
      * @param null $defaultValue
152 152
      *
153 153
      * @return callable|mixed|null
@@ -157,6 +157,9 @@  discard block
 block discarded – undo
157 157
         return $this->has($key) ? $this->data[$key] : $defaultValue;
158 158
     }
159 159
 
160
+    /**
161
+     * @param string $key
162
+     */
160 163
     public function set($key, $value)
161 164
     {
162 165
         $this->data[$key] = $value;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * http://opensource.org/licenses/MIT
10 10
  */
11 11
 
12
-declare(strict_types=1);
12
+declare(strict_types = 1);
13 13
 /*
14 14
  * This file is a part of graphql-youshido project.
15 15
  *
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return $this->get(\lcfirst(\mb_substr($method, 2)));
80 80
         }
81 81
 
82
-        throw new \Exception('Call to undefined method ' . $method);
82
+        throw new \Exception('Call to undefined method '.$method);
83 83
     }
84 84
 
85 85
     public function validate(): void
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $validator = ConfigValidator::getInstance();
88 88
 
89 89
         if (!$validator->validate($this->data, $this->getContextRules(), $this->extraFieldsAllowed)) {
90
-            throw new ConfigurationException('Config is not valid for ' . ($this->contextObject ? \get_class($this->contextObject) : null) . "\n" . \implode("\n", $validator->getErrorsArray(false)));
90
+            throw new ConfigurationException('Config is not valid for '.($this->contextObject ? \get_class($this->contextObject) : null)."\n".\implode("\n", $validator->getErrorsArray(false)));
91 91
         }
92 92
     }
93 93
 
Please login to merge, or discard this patch.
src/Config/Schema/SchemaConfig.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@
 block discarded – undo
38 38
      */
39 39
     private $directiveList;
40 40
 
41
+    /**
42
+     * @param \Youshido\GraphQL\Schema\AbstractSchema $contextObject
43
+     */
41 44
     public function __construct(array $configData, $contextObject = null, $finalClass = false)
42 45
     {
43 46
         $this->typesList     = new SchemaTypesList();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  * http://opensource.org/licenses/MIT
10 10
  */
11 11
 
12
-declare(strict_types=1);
12
+declare(strict_types = 1);
13 13
 /*
14 14
  * This file is a part of graphql-youshido project.
15 15
  *
Please login to merge, or discard this patch.