Completed
Push — master ( 4406e7...95db8c )
by Alexandr
02:55
created
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.
examples/02_blog/schema-bootstrap.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 
3 3
 namespace BlogTest;
4 4
 
5
-require_once __DIR__ . '/../../../../../vendor/autoload.php';
6
-require_once __DIR__ . '/Schema/DataProvider.php';
7
-require_once __DIR__ . '/Schema/PostType.php';
8
-require_once __DIR__ . '/Schema/PostStatus.php';
9
-require_once __DIR__ . '/Schema/ContentBlockInterface.php';
10
-require_once __DIR__ . '/Schema/LikePostField.php';
11
-require_once __DIR__ . '/Schema/BannerType.php';
12
-require_once __DIR__ . '/Schema/ContentBlockUnion.php';
13
-require_once __DIR__ . '/Schema/PostInputType.php';
14
-require_once __DIR__ . '/Schema/BlogSchema.php';
5
+require_once __DIR__.'/../../../../../vendor/autoload.php';
6
+require_once __DIR__.'/Schema/DataProvider.php';
7
+require_once __DIR__.'/Schema/PostType.php';
8
+require_once __DIR__.'/Schema/PostStatus.php';
9
+require_once __DIR__.'/Schema/ContentBlockInterface.php';
10
+require_once __DIR__.'/Schema/LikePostField.php';
11
+require_once __DIR__.'/Schema/BannerType.php';
12
+require_once __DIR__.'/Schema/ContentBlockUnion.php';
13
+require_once __DIR__.'/Schema/PostInputType.php';
14
+require_once __DIR__.'/Schema/BlogSchema.php';
Please login to merge, or discard this patch.
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/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.