Completed
Push — master ( 118ce9...9e4cdb )
by Alexandr
02:51
created
examples/02_blog_inline/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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";
Please login to merge, or discard this patch.
examples/01_sandbox/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
23 23
 ]));
24 24
 
25 25
 $processor->processPayload('{ currentTime }');
26
-echo json_encode($processor->getResponseData()) . "\n";
26
+echo json_encode($processor->getResponseData())."\n";
Please login to merge, or discard this patch.
src/Config/Schema/SchemaConfig.php 1 patch
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,9 @@  discard block
 block discarded – undo
23 23
      */
24 24
     private $typesList;
25 25
 
26
+    /**
27
+     * @param \Youshido\GraphQL\Schema\AbstractSchema $contextObject
28
+     */
26 29
     public function __construct(array $configData, $contextObject = null, $finalClass = false)
27 30
     {
28 31
         $this->typesList = new SchemaTypesList();
@@ -58,7 +61,7 @@  discard block
 block discarded – undo
58 61
     }
59 62
 
60 63
     /**
61
-     * @param $query AbstractObjectType
64
+     * @param \Youshido\Tests\StarWars\Schema\StarWarsQueryType $query AbstractObjectType
62 65
      *
63 66
      * @return SchemaConfig
64 67
      */
Please login to merge, or discard this patch.
src/Execution/Request.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -45,6 +45,9 @@
 block discarded – undo
45 45
     {
46 46
     }
47 47
 
48
+    /**
49
+     * @param string $name
50
+     */
48 51
     public function addQuery($name, AbstractObjectType $query)
49 52
     {
50 53
         $this->getQueryType()->getConfig()->addField($name, $query);
Please login to merge, or discard this patch.
src/Execution/Visitor/MaxComplexityQueryVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
         $this->memo += $cost;
54 54
 
55 55
         if ($this->memo > $this->maxScore) {
56
-            throw new \Exception('query exceeded max allowed complexity of ' . $this->maxScore);
56
+            throw new \Exception('query exceeded max allowed complexity of '.$this->maxScore);
57 57
         }
58 58
 
59 59
         return $cost;
Please login to merge, or discard this patch.
src/Config/Traits/ResolvableObjectTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
14 14
 trait ResolvableObjectTrait
15 15
 {
16 16
 
17
+    /**
18
+     * @param string|boolean $value
19
+     */
17 20
     public function resolve($value, array $args, ResolveInfo $info)
18 21
     {
19 22
         if ($resolveFunction = $this->getConfig()->getResolveFunction()) {
Please login to merge, or discard this patch.
src/Execution/Processor.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -221,6 +221,9 @@  discard block
 block discarded – undo
221 221
         }
222 222
     }
223 223
 
224
+    /**
225
+     * @param \Youshido\GraphQL\Parser\Ast\ArgumentValue\ValueInterface $argumentValue
226
+     */
224 227
     private function prepareArgumentValue($argumentValue, AbstractType $argumentType, Request $request)
225 228
     {
226 229
         switch ($argumentType->getKind()) {
@@ -304,6 +307,9 @@  discard block
 block discarded – undo
304 307
         }
305 308
     }
306 309
 
310
+    /**
311
+     * @param AstFieldInterface $ast
312
+     */
307 313
     private function collectResult(FieldInterface $field, AbstractObjectType $type, $ast, $resolvedValue)
308 314
     {
309 315
         /** @var AstQuery $ast */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -375,7 +375,7 @@
 block discarded – undo
375 375
         $result = [];
376 376
         foreach ($resolvedValue as $resolvedValueItem) {
377 377
             try {
378
-                $fakeField->getConfig()->set('resolve', function () use ($resolvedValueItem) {
378
+                $fakeField->getConfig()->set('resolve', function() use ($resolvedValueItem) {
379 379
                     return $resolvedValueItem;
380 380
                 });
381 381
 
Please login to merge, or discard this patch.
src/Execution/Reducer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
      * Fragments (anonymous and named), and Fields.  The core of the function is simple: recurse until we hit the base
93 93
      * case of a Field and yield that back up to the visitor up in `doVisit`.
94 94
      *
95
-     * @param Query|Field|FragmentInterface $queryNode
95
+     * @param Query $queryNode
96 96
      * @param FieldInterface                $currentLevelAST
97 97
      *
98 98
      * @return \Generator
Please login to merge, or discard this patch.
Tests/Library/Type/InputObjectTypeTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 'fields' => [
54 54
                     'empty' => [
55 55
                         'type'    => new StringType(),
56
-                        'resolve' => function () {
56
+                        'resolve' => function() {
57 57
                             return null;
58 58
                         }
59 59
                     ]
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                             ]))
73 73
                         ],
74 74
                         'type'    => new BooleanType(),
75
-                        'resolve' => function ($object, $args) {
75
+                        'resolve' => function($object, $args) {
76 76
                             return true;
77 77
                         }
78 78
                     ]
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                 'fields' => [
100 100
                     'empty' => [
101 101
                         'type'    => new StringType(),
102
-                        'resolve' => function () {
102
+                        'resolve' => function() {
103 103
                         }
104 104
                     ],
105 105
                 ]
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                                 ]
123 123
                             ])
124 124
                         ],
125
-                        'resolve' => function () {
125
+                        'resolve' => function() {
126 126
                             return 'success message';
127 127
                         }
128 128
                     ]
Please login to merge, or discard this patch.