Completed
Push — master ( c7f3c1...18a515 )
by Alexandr
17:08
created
src/Introspection/FieldType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             ->addField('isDeprecated', TypeMap::TYPE_BOOLEAN)
24 24
             ->addField('deprecationReason', TypeMap::TYPE_STRING)
25 25
             ->addField('type', new QueryType(), [
26
-                'resolve' => function (Field $value) {
26
+                'resolve' => function(Field $value) {
27 27
                     return $value->getType();
28 28
                 }
29 29
             ])
Please login to merge, or discard this patch.
src/Introspection/SchemaType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             ->addField('subscriptionType', new ObjectType([
57 57
                 'name'    => '__Subscription',
58 58
                 'fields'  => ['name' => ['type' => TypeMap::TYPE_STRING]],
59
-                'resolve' => function () { return null; }
59
+                'resolve' => function() { return null; }
60 60
             ]))
61 61
             ->addField('types', new QueryListType())
62 62
             ->addField('directives', new DirectiveListType());
Please login to merge, or discard this patch.
src/Validator/ResolveValidator/ResolveValidator.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
     {
53 53
         if (!count($field->getConfig()->getArguments())) return true;
54 54
 
55
-        $requiredArguments = array_filter($field->getConfig()->getArguments(), function (InputField $argument) {
55
+        $requiredArguments = array_filter($field->getConfig()->getArguments(), function(InputField $argument) {
56 56
             return $argument->getConfig()->getType()->getKind() == TypeMap::KIND_NON_NULL;
57 57
         });
58 58
 
59
-        $withDefaultArguments = array_filter($field->getConfig()->getArguments(), function (InputField $argument) {
59
+        $withDefaultArguments = array_filter($field->getConfig()->getArguments(), function(InputField $argument) {
60 60
             return $argument->getConfig()->get('default') !== null;
61 61
         });
62 62
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function assertTypeImplementsInterface(AbstractObjectType $type, AbstractInterfaceType $interface)
121 121
     {
122 122
         if (!$interface->isValidValue($type)) {
123
-            throw new ResolveException('Type ' . $type->getName() . ' does not implement ' . $interface->getName());
123
+            throw new ResolveException('Type '.$type->getName().' does not implement '.$interface->getName());
124 124
         };
125 125
 
126 126
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@
 block discarded – undo
50 50
      */
51 51
     public function validateArguments($field, $query, $request)
52 52
     {
53
-        if (!count($field->getConfig()->getArguments())) return true;
53
+        if (!count($field->getConfig()->getArguments())) {
54
+            return true;
55
+        }
54 56
 
55 57
         $requiredArguments = array_filter($field->getConfig()->getArguments(), function (InputField $argument) {
56 58
             return $argument->getConfig()->getType()->getKind() == TypeMap::KIND_NON_NULL;
Please login to merge, or discard this patch.
src/Validator/ConfigValidator/Rules/TypeValidationRule.php 1 patch
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -84,7 +84,9 @@  discard block
 block discarded – undo
84 84
 
85 85
     private function isArrayOfValues($data)
86 86
     {
87
-        if (!is_array($data)) return false;
87
+        if (!is_array($data)) {
88
+            return false;
89
+        }
88 90
 
89 91
         foreach ($data as $item) {
90 92
             if (!array_key_exists('value', $item)) {
@@ -97,7 +99,9 @@  discard block
 block discarded – undo
97 99
 
98 100
     private static function isArrayOfInterfaces($data)
99 101
     {
100
-        if (!is_array($data)) return false;
102
+        if (!is_array($data)) {
103
+            return false;
104
+        }
101 105
 
102 106
         foreach ($data as $item) {
103 107
             if (!TypeMap::isInterface($item)) {
@@ -110,10 +114,14 @@  discard block
 block discarded – undo
110 114
 
111 115
     private function isArrayOfFields($data)
112 116
     {
113
-        if (!is_array($data)) return false;
117
+        if (!is_array($data)) {
118
+            return false;
119
+        }
114 120
 
115 121
         foreach ($data as $name => $item) {
116
-            if (!$this->isField($item, $name)) return false;
122
+            if (!$this->isField($item, $name)) {
123
+                return false;
124
+            }
117 125
         }
118 126
 
119 127
         return true;
@@ -127,7 +135,9 @@  discard block
 block discarded – undo
127 135
 
128 136
         try {
129 137
             /** @todo need to change it to optimize performance */
130
-            if (empty($data['name'])) $data['name'] = $name;
138
+            if (empty($data['name'])) {
139
+                $data['name'] = $name;
140
+            }
131 141
 
132 142
             $config = new FieldConfig($data);
133 143
 
@@ -141,10 +151,14 @@  discard block
 block discarded – undo
141 151
 
142 152
     private function isArrayOfInputs($data)
143 153
     {
144
-        if (!is_array($data)) return false;
154
+        if (!is_array($data)) {
155
+            return false;
156
+        }
145 157
 
146 158
         foreach ($data as $name => $item) {
147
-            if (!$this->isInputField($item, $name)) return false;
159
+            if (!$this->isInputField($item, $name)) {
160
+                return false;
161
+            }
148 162
         }
149 163
 
150 164
         return true;
Please login to merge, or discard this patch.
src/Parser/Tokenizer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@
 block discarded – undo
270 270
 
271 271
     protected function createError($message)
272 272
     {
273
-        return new SyntaxErrorException($message . " ({$this->line}:{$this->getColumn()})");
273
+        return new SyntaxErrorException($message." ({$this->line}:{$this->getColumn()})");
274 274
     }
275 275
 
276 276
     protected function getColumn()
Please login to merge, or discard this patch.
Tests/Type/Union/Schema/QueryType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
     {
25 25
         $config
26 26
             ->addField('unionList', new ListType(new TestUnionType()), [
27
-                'resolve' => function () {
27
+                'resolve' => function() {
28 28
                     return UnionTestData::getList();
29 29
                 }
30 30
             ])
31 31
             ->addField('oneUnion', new TestUnionType(), [
32
-                'resolve' => function () {
32
+                'resolve' => function() {
33 33
                     return UnionTestData::getOne();
34 34
                 }
35 35
             ]);
Please login to merge, or discard this patch.
Tests/ProcessorTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                         'id'   => ['type' => TypeMap::TYPE_INT],
131 131
                         'name' => ['type' => TypeMap::TYPE_STRING]
132 132
                     ],
133
-                    'resolve' => function () {
133
+                    'resolve' => function() {
134 134
                         return [
135 135
                             'id'   => 1,
136 136
                             'name' => 'Alex'
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
                                 ['name' => 'String', 'fields' => null],
193 193
                                 ['name' => '__Schema', 'fields' => [['name' => 'queryType'], ['name' => 'mutationType'], ['name' => 'subscriptionType'], ['name' => 'types'], ['name' => 'directives']]],
194 194
                                 ['name' => '__Type', 'fields' => [['name' => 'name'], ['name' => 'kind'], ['name' => 'description'], ['name' => 'ofType'], ['name' => 'inputFields'], ['name' => 'enumValues'], ['name' => 'fields'], ['name' => 'interfaces'], ['name' => 'possibleTypes']]],
195
-                                ['name' => '__InputValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'type'], ['name' => 'defaultValue'],]],
196
-                                ['name' => '__EnumValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'deprecationReason'], ['name' => 'isDeprecated'],]],
195
+                                ['name' => '__InputValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'type'], ['name' => 'defaultValue'], ]],
196
+                                ['name' => '__EnumValue', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'deprecationReason'], ['name' => 'isDeprecated'], ]],
197 197
                                 ['name' => 'Boolean', 'fields' => null],
198 198
                                 ['name' => '__Field', 'fields' => [['name' => 'name'], ['name' => 'description'], ['name' => 'isDeprecated'], ['name' => 'deprecationReason'], ['name' => 'type'], ['name' => 'args']]],
199 199
                                 ['name' => '__Subscription', 'fields' => [['name' => 'name']]],
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                         'id'   => ['type' => TypeMap::TYPE_INT],
288 288
                         'name' => ['type' => TypeMap::TYPE_STRING]
289 289
                     ],
290
-                    'resolve' => function () {
290
+                    'resolve' => function() {
291 291
                         return [
292 292
                             'id'   => 1,
293 293
                             'name' => 'Alex'
Please login to merge, or discard this patch.
Tests/StarWars/Schema/CharacterInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             ->addField('id', TypeMap::TYPE_ID, ['required' => true])
22 22
             ->addField('name', TypeMap::TYPE_STRING, ['required' => true])
23 23
             ->addField('friends', new ListType(new CharacterInterface()), [
24
-                'resolve' => function ($value) {
24
+                'resolve' => function($value) {
25 25
                     return $value['friends'];
26 26
                 }
27 27
             ])
Please login to merge, or discard this patch.
Tests/StarWars/Schema/DroidType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     {
29 29
         parent::build($config);
30 30
 
31
-        $config->getField('friends')->getConfig()->set('resolve', function ($droid) {
31
+        $config->getField('friends')->getConfig()->set('resolve', function($droid) {
32 32
             return StarWarsData::getFriends($droid);
33 33
         });
34 34
 
Please login to merge, or discard this patch.