Completed
Push — master ( 1641ea...5cdde0 )
by Alexandr
02:42
created
Tests/DataProvider/TestObjectType.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@
 block discarded – undo
30 30
                 ],
31 31
             ]))
32 32
             ->addField('location', [
33
-                 'type'    => new ObjectType(
34
-                     [
35
-                         'name'   => 'Location',
36
-                         'fields' => [
37
-                             'address'    => new StringType()
38
-                         ]
39
-                     ]
40
-                 ),
41
-                 'args'    => [
42
-                     'noop' => new IntType()
43
-                 ],
44
-                 'resolve' => function ($value, $args, $info) {
45
-                   return ['address' => '1234 Street'];
46
-                 }
47
-             ]
33
+                    'type'    => new ObjectType(
34
+                        [
35
+                            'name'   => 'Location',
36
+                            'fields' => [
37
+                                'address'    => new StringType()
38
+                            ]
39
+                        ]
40
+                    ),
41
+                    'args'    => [
42
+                        'noop' => new IntType()
43
+                    ],
44
+                    'resolve' => function ($value, $args, $info) {
45
+                    return ['address' => '1234 Street'];
46
+                    }
47
+                ]
48 48
             )
49 49
             ->addField(
50 50
                 'echo', [
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
                  'args'    => [
42 42
                      'noop' => new IntType()
43 43
                  ],
44
-                 'resolve' => function ($value, $args, $info) {
44
+                 'resolve' => function($value, $args, $info) {
45 45
                    return ['address' => '1234 Street'];
46 46
                  }
47 47
              ]
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     'args'    => [
53 53
                         'value' => new NonNullType(new StringType())
54 54
                     ],
55
-                    'resolve' => function ($value, $args, $info) {
55
+                    'resolve' => function($value, $args, $info) {
56 56
                         return $args['value'];
57 57
                     }
58 58
                 ]
Please login to merge, or discard this patch.
Tests/Library/Utilities/TypeUtilitiesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,6 +61,6 @@
 block discarded – undo
61 61
         $arrayData = (new TestObjectType())->getData();
62 62
 
63 63
         $this->assertEquals('John', TypeService::getPropertyValue($arrayData, 'name'));
64
-        $this->assertEquals('John', TypeService::getPropertyValue((object) $arrayData, 'name'));
64
+        $this->assertEquals('John', TypeService::getPropertyValue((object)$arrayData, 'name'));
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
src/Type/TypeFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
             if (empty(self::$objectsHash[$type])) {
36 36
                 $name = ucfirst($type);
37 37
 
38
-                $className                = 'Youshido\GraphQL\Type\Scalar\\' . $name . 'Type';
38
+                $className                = 'Youshido\GraphQL\Type\Scalar\\'.$name.'Type';
39 39
                 self::$objectsHash[$type] = new $className();
40 40
             }
41 41
 
42 42
             return self::$objectsHash[$type];
43 43
         } else {
44
-            throw new ConfigurationException('Configuration problem with type ' . $type);
44
+            throw new ConfigurationException('Configuration problem with type '.$type);
45 45
         }
46 46
     }
47 47
 
Please login to merge, or discard this patch.
Tests/Library/Type/ScalarExtendTypeTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
                 'title' => new StringType(),
28 28
             ]
29 29
         ]);
30
-        $processor  = new Processor(new Schema([
30
+        $processor = new Processor(new Schema([
31 31
                 'query' => new ObjectType([
32 32
                     'name'   => 'RootQueryType',
33 33
                     'fields' => [
34 34
                         'latestReport' => [
35 35
                             'type'    => $reportType,
36
-                            'resolve' => function () {
36
+                            'resolve' => function() {
37 37
                                 return [
38 38
                                     'title' => 'Accident #1',
39 39
                                     'time'  => '13:30:12',
Please login to merge, or discard this patch.
Tests/Performance/LoadTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
             $authors = [];
44 44
             while (count($authors) < rand(1, 4)) {
45 45
                 $authors[] = [
46
-                    'name' => 'Author ' . substr(md5(time()), 0, 4)
46
+                    'name' => 'Author '.substr(md5(time()), 0, 4)
47 47
                 ];
48 48
             }
49 49
             $data[] = [
50 50
                 'id'      => $i,
51
-                'title'   => 'Title of ' . $i,
51
+                'title'   => 'Title of '.$i,
52 52
                 'authors' => $authors,
53 53
             ];
54 54
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 //        return true;
70 70
         $p->processPayload('{ posts { id, title, authors { name } } }');
71 71
         $res = $p->getResponseData();
72
-        echo "Count: " . count($res['data']['posts']) . "\n";
72
+        echo "Count: ".count($res['data']['posts'])."\n";
73 73
         printf("Test Time: %04f\n", microtime(true) - $time);
74 74
 //        $p->getResponseData();
75 75
     }
Please login to merge, or discard this patch.
src/Introspection/QueryType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         if ($value && $value->getKind() == TypeMap::KIND_ENUM) {
59 59
             $data = [];
60 60
             foreach ($value->getValues() as $enumValue) {
61
-                if(!$args['includeDeprecated'] && (isset($enumValue['isDeprecated']) && $enumValue['isDeprecated'])) {
61
+                if (!$args['includeDeprecated'] && (isset($enumValue['isDeprecated']) && $enumValue['isDeprecated'])) {
62 62
                     continue;
63 63
                 }
64 64
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         }
92 92
 
93 93
         /** @var AbstractObjectType $value */
94
-        return array_filter($value->getConfig()->getFields(), function ($field) use ($args) {
94
+        return array_filter($value->getConfig()->getFields(), function($field) use ($args) {
95 95
             /** @var $field Field */
96 96
             if (in_array($field->getName(), ['__type', '__schema']) || (!$args['includeDeprecated'] && $field->isDeprecated())) {
97 97
                 return false;
Please login to merge, or discard this patch.
Tests/Schema/IntrospectionTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             'description'       => 'latest description',
137 137
             'deprecationReason' => 'for test',
138 138
             'isDeprecated'      => true,
139
-            'resolve'           => function () {
139
+            'resolve'           => function() {
140 140
                 return [
141 141
                     'id'   => 1,
142 142
                     'name' => 'Alex'
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
                                 ['name' => 'String', 'fields' => null],
202 202
                                 ['name' => '__Schema', 'fields' => [['name' => 'queryType', 'args' => []], ['name' => 'mutationType', 'args' => []], ['name' => 'subscriptionType', 'args' => []], ['name' => 'types', 'args' => []], ['name' => 'directives', 'args' => []]]],
203 203
                                 ['name' => '__Type', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'kind', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'ofType', 'args' => []], ['name' => 'inputFields', 'args' => []], ['name' => 'enumValues', 'args' => [['defaultValue' => 'false']]], ['name' => 'fields', 'args' => [['defaultValue' => 'false']]], ['name' => 'interfaces', 'args' => []], ['name' => 'possibleTypes', 'args' => []]]],
204
-                                ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []],]],
204
+                                ['name' => '__InputValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'defaultValue', 'args' => []], ]],
205 205
                                 ['name' => 'Boolean', 'fields' => null],
206
-                                ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []],]],
206
+                                ['name' => '__EnumValue', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ]],
207 207
                                 ['name' => '__Field', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'isDeprecated', 'args' => []], ['name' => 'deprecationReason', 'args' => []], ['name' => 'type', 'args' => []], ['name' => 'args', 'args' => []]]],
208 208
                                 ['name' => '__Subscription', 'fields' => [['name' => 'name', 'args' => []]]],
209 209
                                 ['name' => '__Directive', 'fields' => [['name' => 'name', 'args' => []], ['name' => 'description', 'args' => []], ['name' => 'args', 'args' => []], ['name' => 'onOperation', 'args' => []], ['name' => 'onFragment', 'args' => []], ['name' => 'onField', 'args' => []]]],
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 'id'   => ['type' => new IntType()],
292 292
                 'name' => ['type' => new IntType()],
293 293
             ],
294
-            'resolveType' => function ($type) {
294
+            'resolveType' => function($type) {
295 295
 
296 296
             }
297 297
         ]);
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         $unionType = new UnionType([
320 320
             'name'        => 'UnionType',
321 321
             'types'       => [$object1, $object2],
322
-            'resolveType' => function () {
322
+            'resolveType' => function() {
323 323
 
324 324
             }
325 325
         ]);
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
             'args'    => [
331 331
                 'id' => ['type' => TypeMap::TYPE_INT]
332 332
             ],
333
-            'resolve' => function () {
333
+            'resolve' => function() {
334 334
                 return [
335 335
                     'id'   => 1,
336 336
                     'name' => 'Alex'
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                     ]
357 357
                 ])
358 358
             ],
359
-            'resolve' => function () {
359
+            'resolve' => function() {
360 360
                 return null;
361 361
             }
362 362
         ]));
Please login to merge, or discard this patch.
src/Type/Object/AbstractObjectType.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -87,6 +87,9 @@
 block discarded – undo
87 87
         return $this->getConfigValue('interfaces', []);
88 88
     }
89 89
 
90
+    /**
91
+     * @param ObjectType|null $value
92
+     */
90 93
     public function isValidValue($value)
91 94
     {
92 95
         return is_array($value) || is_null($value) || is_object($value);
Please login to merge, or discard this patch.
src/Field/AbstractField.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             $config['type'] = $this->getType();
35 35
             $config['name'] = $this->getName();
36 36
             if (empty($config['name'])) {
37
-                $config['name'] =$this->getAutoName();
37
+                $config['name'] = $this->getAutoName();
38 38
             }
39 39
         }
40 40
 
Please login to merge, or discard this patch.