Passed
Pull Request — master (#190)
by Sebastian
03:03
created
src/Type/introspection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 {
126 126
     return arraySome(
127 127
       introspectionTypes(),
128
-      function (TypeInterface $introspectionType) use ($type) {
128
+      function(TypeInterface $introspectionType) use ($type) {
129 129
           /** @noinspection PhpUndefinedMethodInspection */
130 130
           return $type->getName() === $introspectionType->getName();
131 131
       }
Please login to merge, or discard this patch.
src/Type/scalars.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 {
71 71
     return arraySome(
72 72
       specifiedScalarTypes(),
73
-      function (ScalarType $specifiedScalarType) use ($type) {
73
+      function(ScalarType $specifiedScalarType) use ($type) {
74 74
           /** @noinspection PhpUndefinedMethodInspection */
75 75
           return $type->getName() === $specifiedScalarType->getName();
76 76
       }
Please login to merge, or discard this patch.
src/Type/ScalarTypesProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
     public function register()
36 36
     {
37 37
         $this->container->add(GraphQL::BOOLEAN,
38
-          function (BooleanCoercer $coercer) {
38
+          function(BooleanCoercer $coercer) {
39 39
               return newScalarType([
40 40
                 'name' => TypeNameEnum::BOOLEAN,
41 41
                 'description' => 'The `Boolean` scalar type represents `true` or `false`.',
42
-                'serialize' => function ($value) use ($coercer) {
42
+                'serialize' => function($value) use ($coercer) {
43 43
                     return $coercer->coerce($value);
44 44
                 },
45
-                'parseValue' => function ($value) use ($coercer) {
45
+                'parseValue' => function($value) use ($coercer) {
46 46
                     return $coercer->coerce($value);
47 47
                 },
48
-                'parseLiteral' => function (NodeInterface $node) {
48
+                'parseLiteral' => function(NodeInterface $node) {
49 49
                     if ($node instanceof BooleanValueNode) {
50 50
                         return $node->getValue();
51 51
                     }
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
           }, true/* $shared */)
56 56
           ->withArgument(BooleanCoercer::class);
57 57
 
58
-        $this->container->add(GraphQL::FLOAT, function (FloatCoercer $coercer) {
58
+        $this->container->add(GraphQL::FLOAT, function(FloatCoercer $coercer) {
59 59
             return newScalarType([
60 60
               'name' => TypeNameEnum::FLOAT,
61 61
               'description' =>
62 62
                 'The `Float` scalar type represents signed double-precision fractional ' .
63 63
                 'values as specified by ' .
64 64
                 '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).',
65
-              'serialize' => function ($value) use ($coercer) {
65
+              'serialize' => function($value) use ($coercer) {
66 66
                   return $coercer->coerce($value);
67 67
               },
68
-              'parseValue' => function ($value) use ($coercer) {
68
+              'parseValue' => function($value) use ($coercer) {
69 69
                   return $coercer->coerce($value);
70 70
               },
71
-              'parseLiteral' => function (NodeInterface $node) {
71
+              'parseLiteral' => function(NodeInterface $node) {
72 72
                   if ($node instanceof FloatValueNode || $node instanceof IntValueNode) {
73 73
                       return $node->getValue();
74 74
                   }
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
         }, true/* $shared */)
79 79
           ->withArgument(FloatCoercer::class);
80 80
 
81
-        $this->container->add(GraphQL::INT, function (IntCoercer $coercer) {
81
+        $this->container->add(GraphQL::INT, function(IntCoercer $coercer) {
82 82
             return newScalarType([
83 83
               'name' => TypeNameEnum::INT,
84 84
               'description' =>
85 85
                 'The `Int` scalar type represents non-fractional signed whole numeric ' .
86 86
                 'values. Int can represent values between -(2^31) and 2^31 - 1.',
87
-              'serialize' => function ($value) use ($coercer) {
87
+              'serialize' => function($value) use ($coercer) {
88 88
                   return $coercer->coerce($value);
89 89
               },
90
-              'parseValue' => function ($value) use ($coercer) {
90
+              'parseValue' => function($value) use ($coercer) {
91 91
                   return $coercer->coerce($value);
92 92
               },
93
-              'parseLiteral' => function (NodeInterface $node) {
93
+              'parseLiteral' => function(NodeInterface $node) {
94 94
                   if ($node instanceof IntValueNode) {
95 95
                       $value = (int)$node->getValue();
96 96
                       if ((string)$node->getValue() === (string)$value &&
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         }, true/* $shared */)
105 105
           ->withArgument(IntCoercer::class);
106 106
 
107
-        $this->container->add(GraphQL::ID, function (StringCoercer $coercer) {
107
+        $this->container->add(GraphQL::ID, function(StringCoercer $coercer) {
108 108
             return newScalarType([
109 109
               'name' => TypeNameEnum::ID,
110 110
               'description' =>
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
                 'response as a String; however, it is not intended to be human-readable. ' .
114 114
                 'When expected as an input type, any string (such as `"4"`) or integer ' .
115 115
                 '(such as `4`) input value will be accepted as an ID.',
116
-              'serialize' => function ($value) use ($coercer) {
116
+              'serialize' => function($value) use ($coercer) {
117 117
                   return $coercer->coerce($value);
118 118
               },
119
-              'parseValue' => function ($value) use ($coercer) {
119
+              'parseValue' => function($value) use ($coercer) {
120 120
                   return $coercer->coerce($value);
121 121
               },
122
-              'parseLiteral' => function (NodeInterface $node) {
122
+              'parseLiteral' => function(NodeInterface $node) {
123 123
                   if ($node instanceof StringValueNode || $node instanceof IntValueNode) {
124 124
                       return $node->getValue();
125 125
                   }
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
           ->withArgument(StringCoercer::class);
131 131
 
132 132
         $this->container->add(GraphQL::STRING,
133
-          function (StringCoercer $coercer) {
133
+          function(StringCoercer $coercer) {
134 134
               return newScalarType([
135 135
                 'name' => TypeNameEnum::STRING,
136 136
                 'description' =>
137 137
                   'The `String` scalar type represents textual data, represented as UTF-8 ' .
138 138
                   'character sequences. The String type is most often used by GraphQL to ' .
139 139
                   'represent free-form human-readable text.',
140
-                'serialize' => function ($value) use ($coercer) {
140
+                'serialize' => function($value) use ($coercer) {
141 141
                     return $coercer->coerce($value);
142 142
                 },
143
-                'parseValue' => function ($value) use ($coercer) {
143
+                'parseValue' => function($value) use ($coercer) {
144 144
                     return $coercer->coerce($value);
145 145
                 },
146
-                'parseLiteral' => function (NodeInterface $node) {
146
+                'parseLiteral' => function(NodeInterface $node) {
147 147
                     if ($node instanceof StringValueNode) {
148 148
                         return $node->getValue();
149 149
                     }
Please login to merge, or discard this patch.
src/Error/GraphQLException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
           ? (!empty($nodes) ? $nodes : [])
114 114
           : (null !== $nodes ? [$nodes] : []);
115 115
 
116
-        $this->nodes = \array_filter($nodes, function ($node) {
116
+        $this->nodes = \array_filter($nodes, function($node) {
117 117
             return null !== $node;
118 118
         });
119 119
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         if (null === $positions && !empty($this->nodes)) {
149 149
             $positions = array_reduce($this->nodes,
150
-              function (array $list, ?NodeInterface $node) {
150
+              function(array $list, ?NodeInterface $node) {
151 151
                   if (null !== $node) {
152 152
                       $location = $node->getLocation();
153 153
                       if (null !== $location) {
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
     protected function resolveLocations(?array $positions, ?Source $source)
177 177
     {
178 178
         if (null !== $positions && null !== $source) {
179
-            $locations = array_map(function ($position) use ($source) {
179
+            $locations = array_map(function($position) use ($source) {
180 180
                 return SourceLocation::fromSource($source, $position);
181 181
             }, $positions);
182 182
         } elseif (!empty($this->nodes)) {
183 183
             $locations = array_reduce($this->nodes,
184
-              function (array $list, NodeInterface $node) {
184
+              function(array $list, NodeInterface $node) {
185 185
                   $location = $node->getLocation();
186 186
                   if (null !== $location) {
187 187
                       $list[] = SourceLocation::fromSource($location->getSource(),
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     public function getLocationsAsArray(): ?array
289 289
     {
290
-        return !empty($this->locations) ? array_map(function (
290
+        return !empty($this->locations) ? array_map(function(
291 291
           SourceLocation $location
292 292
         ) {
293 293
             return $location->toArray();
Please login to merge, or discard this patch.
src/Error/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
           $nextLineNum) . ': ' . $lines[$line] : null,
94 94
     ];
95 95
 
96
-    return \implode("\n", \array_filter($outputLines, function ($line) {
96
+    return \implode("\n", \array_filter($outputLines, function($line) {
97 97
         return null !== $line;
98 98
     }));
99 99
 }
Please login to merge, or discard this patch.