@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $promise = new Promise( |
| 64 | - function (callable $resolve, callable $reject) use ($key) { |
|
| 64 | + function(callable $resolve, callable $reject) use ($key) { |
|
| 65 | 65 | $this->promiseQueue[] = [ |
| 66 | 66 | 'key' => $key, |
| 67 | 67 | 'resolve' => $resolve, |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | return all( |
| 90 | 90 | \array_map( |
| 91 | - fn ($key) => $this->load($key), |
|
| 91 | + fn($key) => $this->load($key), |
|
| 92 | 92 | $keys |
| 93 | 93 | ) |
| 94 | 94 | ); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function prime($key, $value): void |
| 117 | 117 | { |
| 118 | - if (! $this->promiseCache->get($key)) { |
|
| 118 | + if ( ! $this->promiseCache->get($key)) { |
|
| 119 | 119 | // Cache a rejected promise if the value is an Exception, in order to match |
| 120 | 120 | // the behavior of load($key). |
| 121 | 121 | $promise = $value instanceof \Exception ? reject($value) : resolve($value); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | if ($this->options->shouldBatch()) { |
| 136 | 136 | $this->eventLoop->futureTick( |
| 137 | - fn () => $this->dispatchQueue() |
|
| 137 | + fn() => $this->dispatchQueue() |
|
| 138 | 138 | ); |
| 139 | 139 | |
| 140 | 140 | return; |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $batchPromise |
| 186 | 186 | ->then( |
| 187 | - function ($values) use ($batch, $keys) { |
|
| 187 | + function($values) use ($batch, $keys) { |
|
| 188 | 188 | $this->validateBatchPromiseOutput($values, $keys); |
| 189 | 189 | $this->handleSuccessfulDispatch($batch, $values); |
| 190 | 190 | } |
| 191 | 191 | ) |
| 192 | - ->then(null, fn ($error) => $this->handleFailedDispatch($batch, $error)); |
|
| 192 | + ->then(null, fn($error) => $this->handleFailedDispatch($batch, $error)); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | private function validateBatchPromiseOutput($values, $keys): void |
| 254 | 254 | { |
| 255 | - if (! \is_array($values)) { |
|
| 255 | + if ( ! \is_array($values)) { |
|
| 256 | 256 | throw new DataLoaderException( |
| 257 | 257 | self::class . ' must be constructed with a function which accepts ' . |
| 258 | 258 | 'an array of keys and returns a Promise which resolves to an array of values ' . |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | private function validateBatchPromise($batchPromise): void |
| 281 | 281 | { |
| 282 | - if (! $batchPromise || ! \is_callable([$batchPromise, 'then'])) { |
|
| 282 | + if ( ! $batchPromise || ! \is_callable([$batchPromise, 'then'])) { |
|
| 283 | 283 | throw new DataLoaderException( |
| 284 | 284 | self::class . ' must be constructed with a function which accepts ' . |
| 285 | 285 | 'an array of keys and returns a Promise which resolves to an array of values ' . |