Completed
Push — master ( 46306f...e069d8 )
by Alexandr
03:27
created
Tests/Library/Type/InputObjectTypeTest.php 2 patches
Unused Use Statements   -7 removed lines patch added patch discarded remove patch
@@ -9,13 +9,7 @@  discard block
 block discarded – undo
9 9
 namespace Youshido\Tests\Library\Type;
10 10
 
11 11
 
12
-use Youshido\GraphQL\Execution\Context\ExecutionContext;
13 12
 use Youshido\GraphQL\Execution\Processor;
14
-use Youshido\GraphQL\Execution\Request;
15
-use Youshido\GraphQL\Field\Field;
16
-use Youshido\GraphQL\Parser\Ast\Argument;
17
-use Youshido\GraphQL\Parser\Ast\ArgumentValue\Literal;
18
-use Youshido\GraphQL\Parser\Ast\Query;
19 13
 use Youshido\GraphQL\Schema\Schema;
20 14
 use Youshido\GraphQL\Type\InputObject\InputObjectType;
21 15
 use Youshido\GraphQL\Type\ListType\ListType;
@@ -24,7 +18,6 @@  discard block
 block discarded – undo
24 18
 use Youshido\GraphQL\Type\Scalar\BooleanType;
25 19
 use Youshido\GraphQL\Type\Scalar\StringType;
26 20
 use Youshido\GraphQL\Type\TypeMap;
27
-use Youshido\GraphQL\Validator\ResolveValidator\ResolveValidator;
28 21
 use Youshido\Tests\DataProvider\TestInputObjectType;
29 22
 
30 23
 class InputObjectTypeTest extends \PHPUnit_Framework_TestCase
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 'fields' => [
61 61
                     'empty' => [
62 62
                         'type'    => new StringType(),
63
-                        'resolve' => function () {
63
+                        'resolve' => function() {
64 64
                             return null;
65 65
                         }
66 66
                     ]
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                             ]))
80 80
                         ],
81 81
                         'type'    => new BooleanType(),
82
-                        'resolve' => function ($object, $args) {
82
+                        'resolve' => function($object, $args) {
83 83
                             return true;
84 84
                         }
85 85
                     ]
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 'fields' => [
101 101
                     'empty' => [
102 102
                         'type'    => new StringType(),
103
-                        'resolve' => function () { }
103
+                        'resolve' => function() { }
104 104
                     ],
105 105
                 ]
106 106
             ]),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                                 ]
123 123
                             ])
124 124
                         ],
125
-                        'resolve' => function () { return 'success message'; }
125
+                        'resolve' => function() { return 'success message'; }
126 126
                     ]
127 127
                 ]
128 128
             ])
Please login to merge, or discard this patch.
src/Type/ListType/AbstractListType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $isValid = is_null($value) || is_array($value) || (is_object($value) && in_array('IteratorAggregate', class_implements($value)));
36 36
         $itemType = $this->config->get('itemType');
37 37
         if ($isValid && $itemType->isInputType()) {
38
-            foreach($value as $item) {
38
+            foreach ($value as $item) {
39 39
                 $isValid = $itemType->isValidValue($item);
40 40
                 if (!$isValid) return false;
41 41
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@
 block discarded – undo
37 37
         if ($isValid && $itemType->isInputType()) {
38 38
             foreach($value as $item) {
39 39
                 $isValid = $itemType->isValidValue($item);
40
-                if (!$isValid) return false;
40
+                if (!$isValid) {
41
+                    return false;
42
+                }
41 43
             }
42 44
         }
43 45
         return $isValid;
Please login to merge, or discard this patch.