Completed
Push — master ( 712720...2189d0 )
by Juuso
02:53
created
src/DataLoader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         }
68 68
 
69 69
         $promise = new Promise(
70
-            function (callable $resolve, callable $reject) use ($key) {
70
+            function(callable $resolve, callable $reject) use ($key) {
71 71
                 $this->promiseQueue[] = [
72 72
                     'key' => $key,
73 73
                     'resolve' => $resolve,
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
         return \React\Promise\all(
96 96
             \array_map(
97
-                function ($key) {
97
+                function($key) {
98 98
                     return $this->load($key);
99 99
                 },
100 100
                 $keys
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function prime($key, $value)
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 ? \React\Promise\reject($value) : \React\Promise\resolve($value);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     {
149 149
         if ($this->options->shouldBatch()) {
150 150
             $this->eventLoop->nextTick(
151
-                function () {
151
+                function() {
152 152
                     $this->dispatchQueue();
153 153
                 }
154 154
             );
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
         }
199 199
 
200 200
         $batchPromise->then(
201
-            function ($values) use ($batch, $keys) {
201
+            function($values) use ($batch, $keys) {
202 202
                 $this->validateBatchPromiseOutput($values, $keys);
203 203
                 $this->handleSuccessfulDispatch($batch, $values);
204 204
             }
205
-        )->then(null, function ($error) use ($batch) {
205
+        )->then(null, function($error) use ($batch) {
206 206
             $this->handleFailedDispatch($batch, $error);
207 207
         });
208 208
     }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     private function validateBatchPromiseOutput($values, $keys)
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)
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.