Completed
Push — master ( 200493...fdd355 )
by Alexandr
08:14 queued 04:55
created
examples/02_blog_inline/inline-schema.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
             'fields'  => [
18 18
                 // here you have a complex field with a lot of options
19 19
                 'title'     => [
20
-                    'type'              => new StringType(),                    // string type
21
-                    'description'       => 'This field contains a post title',  // description
22
-                    'isDeprecated'      => true,                                // marked as deprecated
23
-                    'deprecationReason' => 'field title is now deprecated',     // explain the reason
20
+                    'type'              => new StringType(), // string type
21
+                    'description'       => 'This field contains a post title', // description
22
+                    'isDeprecated'      => true, // marked as deprecated
23
+                    'deprecationReason' => 'field title is now deprecated', // explain the reason
24 24
                     'args'              => [
25 25
                         'truncated' => new BooleanType()                        // add an optional argument
26 26
                     ],
27
-                    'resolve'           => function ($value, $args) {
27
+                    'resolve'           => function($value, $args) {
28 28
                         // used argument to modify a field value
29
-                        return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
29
+                        return (!empty($args['truncated'])) ? explode(' ', $value)[0].'...' : $value;
30 30
                     }
31 31
                 ],
32 32
                 // if field just has a type, you can use a short declaration syntax like this
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                 'id' => new IntType()
39 39
             ],
40 40
             // resolve function for the query
41
-            'resolve' => function ($value, $args, $type) {
41
+            'resolve' => function($value, $args, $type) {
42 42
                 return [
43 43
                     'title'   => 'Title for the latest Post',
44 44
                     'summary' => 'Post summary',
Please login to merge, or discard this patch.
src/AbstractSchema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
22 22
     public function __construct($config = [])
23 23
     {
24 24
         if (!array_key_exists('query', $config)) {
25
-            $config['query'] = new ObjectType(['name' => $this->getName() . 'Query']);
25
+            $config['query'] = new ObjectType(['name' => $this->getName().'Query']);
26 26
         }
27 27
         if (!array_key_exists('mutation', $config)) {
28
-            $config['mutation'] = new ObjectType(['name' => $this->getName() . 'Mutation']);
28
+            $config['mutation'] = new ObjectType(['name' => $this->getName().'Mutation']);
29 29
         }
30 30
 
31 31
         $this->config = new SchemaConfig($config, $this);
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/Type/Object/AbstractInterfaceType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     public function isValidValue($value)
59 59
     {
60 60
         if ($value instanceof AbstractObjectType) {
61
-            foreach($value->getInterfaces() as $interface) {
61
+            foreach ($value->getInterfaces() as $interface) {
62 62
                 if ($interface instanceof $this) return true;
63 63
             }
64 64
         }
Please login to merge, or discard this patch.
src/Introspection/Traits/TypeCollectorTrait.php 1 patch
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.
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 1 patch
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.