Completed
Push — master ( 399762...a894df )
by Alexandr
8s
created
Tests/Library/Config/InterfaceTypeConfigTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function testConfigNoFields()
32 32
     {
33 33
         ConfigValidator::getInstance()->assertValidateConfig(
34
-            new InterfaceTypeConfig(['name' => 'Test', 'resolveType' => function () { }], null, true)
34
+            new InterfaceTypeConfig(['name' => 'Test', 'resolveType' => function() { }], null, true)
35 35
         );
36 36
     }
37 37
 
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
         $interfaceConfig = new InterfaceTypeConfig([
60 60
             'name'        => 'Test',
61 61
             'fields'      => ['id' => new IntType()],
62
-            'resolveType' => function ($object) {
62
+            'resolveType' => function($object) {
63 63
                 return $object->getType();
64 64
             }
65 65
         ], null, true);
66
-        $object          = new ObjectType(['name' => 'User', 'fields' => ['name' => new StringType()]]);
66
+        $object = new ObjectType(['name' => 'User', 'fields' => ['name' => new StringType()]]);
67 67
 
68 68
         $this->assertEquals($interfaceConfig->getName(), 'Test');
69 69
         $this->assertEquals($interfaceConfig->resolveType($object), $object->getType());
Please login to merge, or discard this patch.
src/Execution/Container/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         if (isset($this->values[$id])) {
48 48
             unset($this->values[$id]);
49 49
         }
50
-        $this->keyset[$id]   = true;
50
+        $this->keyset[$id] = true;
51 51
     }
52 52
 
53 53
     public function remove($id)
Please login to merge, or discard this patch.
Tests/Parser/RequestTest.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
     public function testSetVariableParseJson()
54 54
     {
55 55
         $variables = '{"foo": "bar"}';
56
-        $expectedVariableArray = [ 'foo' => 'bar' ];
56
+        $expectedVariableArray = ['foo' => 'bar'];
57 57
 
58 58
         $request = new Request([], $variables);
59 59
         $this->assertEquals($expectedVariableArray, $request->getVariables());
Please login to merge, or discard this patch.
Tests/StarWars/Schema/StarWarsQueryType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 'args'    => [
37 37
                     'episode' => ['type' => new EpisodeEnum()]
38 38
                 ],
39
-                'resolve' => function ($root, $args) {
39
+                'resolve' => function($root, $args) {
40 40
                     return StarWarsData::getHero(isset($args['episode']) ? $args['episode'] : null);
41 41
                 },
42 42
             ])
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 'args'    => [
47 47
                     'id' => new IdType()
48 48
                 ],
49
-                'resolve' => function ($value = null, $args = []) {
49
+                'resolve' => function($value = null, $args = []) {
50 50
                     $humans = StarWarsData::humans();
51 51
 
52 52
                     return isset($humans[$args['id']]) ? $humans[$args['id']] : null;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 'args'    => [
59 59
                     'id' => new IdType()
60 60
                 ],
61
-                'resolve' => function ($value = null, $args = []) {
61
+                'resolve' => function($value = null, $args = []) {
62 62
                     $droids = StarWarsData::droids();
63 63
 
64 64
                     return isset($droids[$args['id']]) ? $droids[$args['id']] : null;
Please login to merge, or discard this patch.
src/Field/AbstractInputField.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 
11 11
 use Youshido\GraphQL\Config\Field\InputFieldConfig;
12
-use Youshido\GraphQL\Config\Traits\ResolvableObjectTrait;
13
-use Youshido\GraphQL\Type\InputObject\AbstractInputObjectType;
14 12
 use Youshido\GraphQL\Type\InputTypeInterface;
15 13
 use Youshido\GraphQL\Type\Traits\AutoNameTrait;
16 14
 use Youshido\GraphQL\Type\Traits\FieldsArgumentsAwareObjectTrait;
Please login to merge, or discard this patch.
src/Introspection/Field/TypesField.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         }
46 46
 
47 47
         foreach ($value->getTypes() as $type) {
48
-          $this->collectTypes($type);
48
+            $this->collectTypes($type);
49 49
         }
50 50
 
51 51
         return array_values($this->types);
Please login to merge, or discard this patch.
src/Relay/Connection/Connection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $edgeFields = !empty($config['edgeFields']) ? $config['edgeFields'] : [];
53 53
 
54 54
         $edgeType = new ObjectType([
55
-            'name'        => $name . 'Edge',
55
+            'name'        => $name.'Edge',
56 56
             'description' => 'An edge in a connection.',
57 57
             'fields'      => array_merge([
58 58
                 'node'   => [
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $connectionFields = !empty($config['connectionFields']) ? $config['connectionFields'] : [];
85 85
 
86 86
         $connectionType = new ObjectType([
87
-            'name'        => $name . 'Connection',
87
+            'name'        => $name.'Connection',
88 88
             'description' => 'A connection to a list of items.',
89 89
             'fields'      => array_merge([
90 90
                 'pageInfo' => [
Please login to merge, or discard this patch.
src/Type/SchemaTypesList.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         if (!is_array($types)) {
25 25
             throw new \Exception('addTypes accept only array of types');
26 26
         }
27
-        foreach($types as $type) {
27
+        foreach ($types as $type) {
28 28
             $this->addType($type);
29 29
         }
30 30
         return $this;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
     public function addType(TypeInterface $type)
43 43
     {
44 44
         $typeName = $this->getTypeName($type);
45
-        if ($this->isTypeNameRegistered($typeName)) return $this;
45
+        if ($this->isTypeNameRegistered($typeName)) {
46
+            return $this;
47
+        }
46 48
 
47 49
         $this->typesList[$typeName] = $type;
48 50
         return $this;
@@ -54,7 +56,9 @@  discard block
 block discarded – undo
54 56
     }
55 57
 
56 58
     private function getTypeName($type) {
57
-        if (is_string($type)) return $type;
59
+        if (is_string($type)) {
60
+            return $type;
61
+        }
58 62
         if (is_object($type) && $type instanceof AbstractType) {
59 63
             return $type->getName();
60 64
         }
Please login to merge, or discard this patch.
examples/03_relay_star_wars/schema-bootstrap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . '/../../../../../vendor/autoload.php';
4
-require_once __DIR__ . '/Schema/FactionType.php';
5
-require_once __DIR__ . '/Schema/ShipType.php';
6
-require_once __DIR__ . '/Schema/TestDataProvider.php';
7
-require_once __DIR__ . '/Schema/StarWarsRelaySchema.php';
3
+require_once __DIR__.'/../../../../../vendor/autoload.php';
4
+require_once __DIR__.'/Schema/FactionType.php';
5
+require_once __DIR__.'/Schema/ShipType.php';
6
+require_once __DIR__.'/Schema/TestDataProvider.php';
7
+require_once __DIR__.'/Schema/StarWarsRelaySchema.php';
Please login to merge, or discard this patch.