@@ -71,7 +71,7 @@ |
||
| 71 | 71 | /** |
| 72 | 72 | * @param callable $onFulfilled |
| 73 | 73 | * |
| 74 | - * @return mixed |
|
| 74 | + * @return PromiseInterface |
|
| 75 | 75 | */ |
| 76 | 76 | private function resolveActual(callable $onFulfilled) |
| 77 | 77 | { |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | public function testConstruct() |
| 42 | 42 | { |
| 43 | 43 | $this |
| 44 | - ->exception(function () { |
|
| 44 | + ->exception(function() { |
|
| 45 | 45 | $this->newTestedInstance($this->newDefaultTestedInstance()); |
| 46 | 46 | }) |
| 47 | 47 | ->isInstanceOf(\InvalidArgumentException::class) |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | parent::testResolve(); |
| 26 | 26 | |
| 27 | - $this->innerFailureTest(function (callable $resolveCallback, callable $rejectCallback) { |
|
| 27 | + $this->innerFailureTest(function(callable $resolveCallback, callable $rejectCallback) { |
|
| 28 | 28 | /** @var \Cubiche\Core\Async\Promise\ObservableResolver $resolver */ |
| 29 | 29 | $resolver = $this->newTestedInstance($resolveCallback, $rejectCallback); |
| 30 | 30 | $resolver->resolve(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | parent::testNotify(); |
| 40 | 40 | |
| 41 | - $this->innerFailureTest(function (callable $notifyCallback, callable $rejectCallback) { |
|
| 41 | + $this->innerFailureTest(function(callable $notifyCallback, callable $rejectCallback) { |
|
| 42 | 42 | /** @var \Cubiche\Core\Async\Promise\ObservableResolver $resolver */ |
| 43 | 43 | $resolver = $this->newTestedInstance(null, $rejectCallback, $notifyCallback); |
| 44 | 44 | $resolver->notify(); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $onFulfilledThen = $this->delegateMock(), |
| 168 | 168 | $onNotify = $this->delegateMock() |
| 169 | 169 | ) |
| 170 | - ->when(function () use ($deferred, $thenPromise, $onFulfilledThen, $onNotify) { |
|
| 170 | + ->when(function() use ($deferred, $thenPromise, $onFulfilledThen, $onNotify) { |
|
| 171 | 171 | $thenPromise->then($onFulfilledThen, null, $onNotify); |
| 172 | 172 | $deferred->notify('state'); |
| 173 | 173 | $deferred->resolve('bar'); |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | ->given( |
| 296 | 296 | $onFulfilled = $this->delegateMockWithException(new \Exception()) |
| 297 | 297 | ) |
| 298 | - ->exception(function () use ($promise, $onFulfilled) { |
|
| 298 | + ->exception(function() use ($promise, $onFulfilled) { |
|
| 299 | 299 | $promise->done($onFulfilled); |
| 300 | 300 | })->isInstanceof(\Exception::class) |
| 301 | 301 | ; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | ->given( |
| 325 | 325 | $onRejected = $this->delegateMockWithException(new \Exception()) |
| 326 | 326 | ) |
| 327 | - ->exception(function () use ($promise, $onRejected) { |
|
| 327 | + ->exception(function() use ($promise, $onRejected) { |
|
| 328 | 328 | $promise->done(null, $onRejected); |
| 329 | 329 | })->isInstanceof(\Exception::class) |
| 330 | 330 | ; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | parent::testResolve(); |
| 26 | 26 | |
| 27 | - $this->innerFailureTest(function (callable $onFulfilled) { |
|
| 27 | + $this->innerFailureTest(function(callable $onFulfilled) { |
|
| 28 | 28 | /** @var \Cubiche\Core\Async\Promise\DoneResolver $resolver */ |
| 29 | 29 | $resolver = $this->newTestedInstance($onFulfilled); |
| 30 | 30 | $resolver->resolve(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | parent::testReject(); |
| 40 | 40 | |
| 41 | - $this->innerFailureTest(function (callable $onRejected) { |
|
| 41 | + $this->innerFailureTest(function(callable $onRejected) { |
|
| 42 | 42 | /** @var \Cubiche\Core\Async\Promise\DoneResolver $resolver */ |
| 43 | 43 | $resolver = $this->newTestedInstance(null, $onRejected); |
| 44 | 44 | $resolver->reject(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | parent::testNotify(); |
| 54 | 54 | |
| 55 | - $this->innerFailureTest(function (callable $onNotify) { |
|
| 55 | + $this->innerFailureTest(function(callable $onNotify) { |
|
| 56 | 56 | /** @var \Cubiche\Core\Async\Promise\DoneResolver $resolver */ |
| 57 | 57 | $resolver = $this->newTestedInstance(null, null, $onNotify); |
| 58 | 58 | $resolver->notify(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $reason = new \Exception(), |
| 70 | 70 | $callback = $this->delegateMockWithException($reason) |
| 71 | 71 | ) |
| 72 | - ->exception(function () use ($when, $callback) { |
|
| 72 | + ->exception(function() use ($when, $callback) { |
|
| 73 | 73 | $when($callback); |
| 74 | 74 | }) |
| 75 | 75 | ; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $onFulfilledPromise = $this->delegateMock(), |
| 37 | 37 | $onNotifyPromise = $this->delegateMock() |
| 38 | 38 | ) |
| 39 | - ->when(function () use ($resolver, $onFulfilledPromise, $onNotifyPromise) { |
|
| 39 | + ->when(function() use ($resolver, $onFulfilledPromise, $onNotifyPromise) { |
|
| 40 | 40 | $resolver->resolve(); |
| 41 | 41 | $resolver->promise()->then($onFulfilledPromise, null, $onNotifyPromise); |
| 42 | 42 | }) |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $resolver = $this->newTestedInstance($onFulfilled), |
| 72 | 72 | $onRejectedPromise = $this->delegateMock() |
| 73 | 73 | ) |
| 74 | - ->when(function () use ($resolver, $onRejectedPromise) { |
|
| 74 | + ->when(function() use ($resolver, $onRejectedPromise) { |
|
| 75 | 75 | $resolver->resolve(); |
| 76 | 76 | $resolver->promise()->then(null, $onRejectedPromise); |
| 77 | 77 | }) |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $resolver = $this->newTestedInstance(null, $onRejected), |
| 98 | 98 | $onRejectedPromise = $this->delegateMock() |
| 99 | 99 | ) |
| 100 | - ->when(function () use ($resolver, $onRejectedPromise) { |
|
| 100 | + ->when(function() use ($resolver, $onRejectedPromise) { |
|
| 101 | 101 | $resolver->reject(); |
| 102 | 102 | $resolver->promise()->then(null, $onRejectedPromise); |
| 103 | 103 | }) |
@@ -66,11 +66,11 @@ |
||
| 66 | 66 | { |
| 67 | 67 | $value = $this->callResolveCallback($value); |
| 68 | 68 | if ($value instanceof PromiseInterface) { |
| 69 | - $value->then(function ($actual) { |
|
| 69 | + $value->then(function($actual) { |
|
| 70 | 70 | $this->deferred->resolve($actual); |
| 71 | - }, function ($reason) { |
|
| 71 | + }, function($reason) { |
|
| 72 | 72 | $this->deferred->reject($reason); |
| 73 | - }, function ($state) { |
|
| 73 | + }, function($state) { |
|
| 74 | 74 | $this->deferred->notify($state); |
| 75 | 75 | }); |
| 76 | 76 | } else { |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | { |
| 43 | 43 | if ($this->promise === null) { |
| 44 | 44 | $this->promise = new Promise( |
| 45 | - function (callable $resolveCallback) { |
|
| 45 | + function(callable $resolveCallback) { |
|
| 46 | 46 | $this->resolveCallback = $resolveCallback; |
| 47 | 47 | }, |
| 48 | - function (callable $rejectCallback) { |
|
| 48 | + function(callable $rejectCallback) { |
|
| 49 | 49 | $this->rejectCallback = $rejectCallback; |
| 50 | 50 | }, |
| 51 | - function (callable $notifyCallback) { |
|
| 51 | + function(callable $notifyCallback) { |
|
| 52 | 52 | $this->notifyCallback = $notifyCallback; |
| 53 | 53 | } |
| 54 | 54 | ); |