@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $promise = new Promise( |
| 72 | - function (callable $resolve, callable $reject) use ($key) { |
|
| 72 | + function(callable $resolve, callable $reject) use ($key) { |
|
| 73 | 73 | $this->promiseQueue[] = [ |
| 74 | 74 | 'key' => $key, |
| 75 | 75 | 'resolve' => $resolve, |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | return \React\Promise\all( |
| 98 | 98 | array_map( |
| 99 | - function ($key) { |
|
| 99 | + function($key) { |
|
| 100 | 100 | return $this->load($key); |
| 101 | 101 | }, |
| 102 | 102 | $keys |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function prime($key, $value) |
| 131 | 131 | { |
| 132 | - if (! $this->promiseCache->get($key)) { |
|
| 132 | + if ( ! $this->promiseCache->get($key)) { |
|
| 133 | 133 | // Cache a rejected promise if the value is an Exception, in order to match |
| 134 | 134 | // the behavior of load($key). |
| 135 | 135 | $promise = $value instanceof \Exception ? \React\Promise\reject($value) : \React\Promise\resolve($value); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | if ($this->options->shouldBatch()) { |
| 152 | 152 | $this->eventLoop->nextTick( |
| 153 | - function () { |
|
| 153 | + function() { |
|
| 154 | 154 | $this->dispatchQueue(); |
| 155 | 155 | } |
| 156 | 156 | ); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /** @var Promise $batchPromise */ |
| 193 | 193 | $batchPromise = ($this->batchLoadFunction)($keys); |
| 194 | 194 | |
| 195 | - if (! $batchPromise || ! is_callable([$batchPromise, 'then'])) { |
|
| 195 | + if ( ! $batchPromise || ! is_callable([$batchPromise, 'then'])) { |
|
| 196 | 196 | return $this->handleFailedDispatch($batch, new DataLoaderException( |
| 197 | 197 | self::class . ' must be constructed with a function which accepts ' . |
| 198 | 198 | 'an array of keys and returns a Promise which resolves to an array of values ' . |
@@ -201,11 +201,11 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $batchPromise->then( |
| 204 | - function ($values) use ($batch, $keys) { |
|
| 204 | + function($values) use ($batch, $keys) { |
|
| 205 | 205 | $this->validateBatchPromiseOutput($values, $keys); |
| 206 | 206 | $this->handleSuccessfulDispatch($batch, $values); |
| 207 | 207 | } |
| 208 | - )->then(null, function ($error) use ($batch) { |
|
| 208 | + )->then(null, function($error) use ($batch) { |
|
| 209 | 209 | $this->handleFailedDispatch($batch, $error); |
| 210 | 210 | }); |
| 211 | 211 | } |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | private function validateBatchPromiseOutput($values, $keys) |
| 272 | 272 | { |
| 273 | - if (! is_array($values)) { |
|
| 273 | + if ( ! is_array($values)) { |
|
| 274 | 274 | throw new DataLoaderException( |
| 275 | 275 | self::class . ' must be constructed with a function which accepts ' . |
| 276 | 276 | 'an array of keys and returns a Promise which resolves to an array of values ' . |