Completed
Push — master ( f8702a...461e07 )
by Alexandr
04:08
created
examples/02_blog/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Youshido\GraphQL\Processor;
7 7
 use Youshido\GraphQL\Schema;
8 8
 
9
-require_once __DIR__ . '/schema-bootstrap.php';
9
+require_once __DIR__.'/schema-bootstrap.php';
10 10
 /** @var Schema $schema */
11 11
 $schema = new BlogSchema();
12 12
 
@@ -20,4 +20,4 @@  discard block
 block discarded – undo
20 20
 $payload  = '{ pageContentInterface { title} }';
21 21
 $response = $processor->processRequest($payload, [])->getResponseData();
22 22
 
23
-echo json_encode($response) . "\n\n";
23
+echo json_encode($response)."\n\n";
Please login to merge, or discard this patch.
examples/02_blog/router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 use Youshido\GraphQL\Processor;
12 12
 use Youshido\GraphQL\Schema;
13 13
 
14
-require_once __DIR__ . '/schema-bootstrap.php';
14
+require_once __DIR__.'/schema-bootstrap.php';
15 15
 /** @var Schema $schema */
16 16
 $schema = new BlogSchema();
17 17
 
Please login to merge, or discard this patch.
examples/02_blog/Schema/BlogSchema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,19 +18,19 @@
 block discarded – undo
18 18
             'latestPost'           => new PostType(),
19 19
             'randomBanner'         => [
20 20
                 'type'    => new BannerType(),
21
-                'resolve' => function () {
21
+                'resolve' => function() {
22 22
                     return DataProvider::getBanner(rand(1, 10));
23 23
                 }
24 24
             ],
25 25
             'pageContentUnion'     => [
26 26
                 'type'    => new ListType(new ContentBlockUnion()),
27
-                'resolve' => function () {
27
+                'resolve' => function() {
28 28
                     return [DataProvider::getPost(1), DataProvider::getBanner(1)];
29 29
                 }
30 30
             ],
31 31
             'pageContentInterface' => [
32 32
                 'type'    => new ListType(new ContentBlockInterface()),
33
-                'resolve' => function () {
33
+                'resolve' => function() {
34 34
                     return [DataProvider::getPost(2), DataProvider::getBanner(3)];
35 35
                 }
36 36
             ]
Please login to merge, or discard this patch.
examples/02_blog/Schema/PostType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
                 'args'              => [
26 26
                     'truncated' => new BooleanType()
27 27
                 ],
28
-                'resolve'           => function ($value, $args) {
29
-                    return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
28
+                'resolve'           => function($value, $args) {
29
+                    return (!empty($args['truncated'])) ? explode(' ', $value)[0].'...' : $value;
30 30
                 }
31 31
             ])
32 32
             ->addField('title', new NonNullType(new StringType()))
Please login to merge, or discard this patch.
examples/02_blog/Schema/DataProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
     public static function getPost($id)
11 11
     {
12 12
         return [
13
-            "id"        => "post-" . $id,
14
-            "title"     => "Post " . $id . " title",
13
+            "id"        => "post-".$id,
14
+            "title"     => "Post ".$id." title",
15 15
             "summary"   => "This new GraphQL library for PHP works really well",
16 16
             "status"    => 1,
17 17
             "likeCount" => 2
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     public static function getBanner($id)
22 22
     {
23 23
         return [
24
-            'id'        => "banner-" . $id,
25
-            'title'     => "Banner " . $id,
26
-            'imageLink' => "banner" . $id . ".jpg"
24
+            'id'        => "banner-".$id,
25
+            'title'     => "Banner ".$id,
26
+            'imageLink' => "banner".$id.".jpg"
27 27
         ];
28 28
     }
29 29
 }
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
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 use Youshido\GraphQL\Type\Scalar\StringType;
10 10
 
11 11
 
12
-require_once __DIR__ . '/../../vendor/autoload.php';
13
-require_once __DIR__ . '/inline-schema.php';
12
+require_once __DIR__.'/../../vendor/autoload.php';
13
+require_once __DIR__.'/inline-schema.php';
14 14
 /** @var ObjectType $rootQueryType */
15 15
 
16 16
 $processor = new Processor();
@@ -20,4 +20,4 @@  discard block
 block discarded – undo
20 20
 $payload  = '{ latestPost { title(truncated: true), summary } }';
21 21
 $response = $processor->processRequest($payload, [])->getResponseData();
22 22
 
23
-echo json_encode($response) . "\n\n";
23
+echo json_encode($response)."\n\n";
Please login to merge, or discard this patch.
src/Type/Config/Traits/FieldsAwareTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     {
63 63
         if (is_string($type)) {
64 64
             if (!TypeMap::isScalarType($type)) {
65
-                throw new ConfigurationException('You can\'t pass ' . $type . ' as a string type.');
65
+                throw new ConfigurationException('You can\'t pass '.$type.' as a string type.');
66 66
             }
67 67
 
68 68
             $type = TypeMap::getScalarTypeObject($type);
Please login to merge, or discard this patch.
src/Type/Config/Traits/ConfigCallTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             return $this->config->get($propertyName);
55 55
         }
56 56
 
57
-        throw new \Exception('Call to undefined method ' . $method);
57
+        throw new \Exception('Call to undefined method '.$method);
58 58
     }
59 59
 
60 60
 }
Please login to merge, or discard this patch.
src/Introspection/Traits/TypeCollectorTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
     {
111 111
         foreach ($type->getConfig()->getFields() as $field) {
112 112
             if ($field->getConfig()->getType() instanceof AbstractObjectType) {
113
-                foreach($field->getConfig()->getArguments() as $argument) {
113
+                foreach ($field->getConfig()->getArguments() as $argument) {
114 114
                     $this->collectTypes($argument->getType());
115 115
                 }
116 116
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@
 block discarded – undo
27 27
         if (!$type) {
28 28
             return;
29 29
         }
30
-        if (is_object($type) && array_key_exists($type->getName(), $this->types)) return;
30
+        if (is_object($type) && array_key_exists($type->getName(), $this->types)) {
31
+            return;
32
+        }
31 33
 
32 34
         switch ($type->getKind()) {
33 35
             case TypeMap::KIND_INTERFACE:
Please login to merge, or discard this patch.