@@ -67,7 +67,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 ' . |