Test Setup Failed
Push — master ( d8a2c4...22e3b6 )
by Juuso
03:25
created
src/DataLoader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         }
72 72
 
73 73
         $promise = new Promise(
74
-            function (callable $resolve, callable $reject) use ($key) {
74
+            function(callable $resolve, callable $reject) use ($key) {
75 75
                 $this->promiseQueue[] = [
76 76
                     'key' => $key,
77 77
                     'resolve' => $resolve,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         return all(
100 100
             \array_map(
101
-                function ($key) {
101
+                function($key) {
102 102
                     return $this->load($key);
103 103
                 },
104 104
                 $keys
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function prime($key, $value): void
129 129
     {
130
-        if (! $this->promiseCache->get($key)) {
130
+        if ( ! $this->promiseCache->get($key)) {
131 131
             // Cache a rejected promise if the value is an Exception, in order to match
132 132
             // the behavior of load($key).
133 133
             $promise = $value instanceof \Exception ? reject($value) : resolve($value);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     {
147 147
         if ($this->options->shouldBatch()) {
148 148
             $this->eventLoop->futureTick(
149
-                function () {
149
+                function() {
150 150
                     $this->dispatchQueue();
151 151
                 }
152 152
             );
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
         }
197 197
 
198 198
         $batchPromise->then(
199
-            function ($values) use ($batch, $keys) {
199
+            function($values) use ($batch, $keys) {
200 200
                 $this->validateBatchPromiseOutput($values, $keys);
201 201
                 $this->handleSuccessfulDispatch($batch, $values);
202 202
             }
203
-        )->then(null, function ($error) use ($batch) {
203
+        )->then(null, function($error) use ($batch) {
204 204
             $this->handleFailedDispatch($batch, $error);
205 205
         });
206 206
     }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     private function validateBatchPromiseOutput($values, $keys): void
269 269
     {
270
-        if (! \is_array($values)) {
270
+        if ( ! \is_array($values)) {
271 271
             throw new DataLoaderException(
272 272
                 self::class . ' must be constructed with a function which accepts ' .
273 273
                 'an array of keys and returns a Promise which resolves to an array of values ' .
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     private function validateBatchPromise($batchPromise): void
296 296
     {
297
-        if (! $batchPromise || ! \is_callable([$batchPromise, 'then'])) {
297
+        if ( ! $batchPromise || ! \is_callable([$batchPromise, 'then'])) {
298 298
             throw new DataLoaderException(
299 299
                 self::class . ' must be constructed with a function which accepts ' .
300 300
                 'an array of keys and returns a Promise which resolves to an array of values ' .
Please login to merge, or discard this patch.