@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $this |
| 59 | 59 | ->getAssertionManager() |
| 60 | - ->setHandler('delegateCall', function (MockAggregator $mock) { |
|
| 60 | + ->setHandler('delegateCall', function(MockAggregator $mock) { |
|
| 61 | 61 | return $this->delegateCall($mock); |
| 62 | 62 | }) |
| 63 | 63 | ; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $rejected = $this->delegateMock(), |
| 112 | 112 | $notify = $this->delegateMock() |
| 113 | 113 | ) |
| 114 | - ->when(function () use ($promise, $succeed, $rejected, $notify) { |
|
| 114 | + ->when(function() use ($promise, $succeed, $rejected, $notify) { |
|
| 115 | 115 | $promise->then($succeed, $rejected, $notify); |
| 116 | 116 | $this->resolve('foo'); |
| 117 | 117 | }) |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $notify = $this->delegateMock(), |
| 134 | 134 | $reason = new \Exception() |
| 135 | 135 | ) |
| 136 | - ->when(function () use ($promise, $succeed, $rejected, $notify, $reason) { |
|
| 136 | + ->when(function() use ($promise, $succeed, $rejected, $notify, $reason) { |
|
| 137 | 137 | $promise->then($succeed, $rejected, $notify); |
| 138 | 138 | $this->reject($reason); |
| 139 | 139 | }) |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $rejected = $this->delegateMock(), |
| 155 | 155 | $notify = $this->delegateMock() |
| 156 | 156 | ) |
| 157 | - ->when(function () use ($promise, $succeed, $rejected, $notify) { |
|
| 157 | + ->when(function() use ($promise, $succeed, $rejected, $notify) { |
|
| 158 | 158 | $promise->then($succeed, $rejected, $notify); |
| 159 | 159 | for ($i = 0; $i < 10; ++$i) { |
| 160 | 160 | $this->notify(($i + 1) * 10); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $succeedThen = $this->delegateMock() |
| 179 | 179 | ) |
| 180 | 180 | ->let($promiseThen = $promise->then($succeed, $rejected, $notify)) |
| 181 | - ->when(function () use ($promiseThen, $succeedThen) { |
|
| 181 | + ->when(function() use ($promiseThen, $succeedThen) { |
|
| 182 | 182 | $promiseThen->then($succeedThen); |
| 183 | 183 | $this->resolve('foo'); |
| 184 | 184 | }) |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | ->then() |
| 300 | 300 | ->delegateCall($otherwise) |
| 301 | 301 | ->with() |
| 302 | - ->arguments(0, function ($argument) { |
|
| 302 | + ->arguments(0, function($argument) { |
|
| 303 | 303 | $this->object($argument)->isInstanceOf(\RuntimeException::class); |
| 304 | 304 | }) |
| 305 | 305 | ->once() |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | ->if($promise->then($succeed)) |
| 340 | 340 | ->when($this->resolve()) |
| 341 | 341 | ->exception( |
| 342 | - function () { |
|
| 342 | + function() { |
|
| 343 | 343 | $this->resolve(); |
| 344 | 344 | } |
| 345 | 345 | )->isInstanceOf(\LogicException::class) |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | ->if($promise->then($succeed)) |
| 354 | 354 | ->when($this->resolve()) |
| 355 | 355 | ->exception( |
| 356 | - function () { |
|
| 356 | + function() { |
|
| 357 | 357 | $this->reject(); |
| 358 | 358 | } |
| 359 | 359 | )->isInstanceOf(\LogicException::class) |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | ->if($promise->then($succeed)) |
| 368 | 368 | ->when($this->resolve()) |
| 369 | 369 | ->exception( |
| 370 | - function () { |
|
| 370 | + function() { |
|
| 371 | 371 | $this->notify(); |
| 372 | 372 | } |
| 373 | 373 | )->isInstanceOf(\LogicException::class) |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | ->if($promise->then($succeed)) |
| 388 | 388 | ->when($this->reject()) |
| 389 | 389 | ->exception( |
| 390 | - function () { |
|
| 390 | + function() { |
|
| 391 | 391 | $this->resolve(); |
| 392 | 392 | } |
| 393 | 393 | )->isInstanceOf(\LogicException::class) |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | ->if($promise->then($succeed)) |
| 402 | 402 | ->when($this->reject()) |
| 403 | 403 | ->exception( |
| 404 | - function () { |
|
| 404 | + function() { |
|
| 405 | 405 | $this->reject(); |
| 406 | 406 | } |
| 407 | 407 | )->isInstanceOf(\LogicException::class) |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | ->if($promise->then($succeed)) |
| 416 | 416 | ->when($this->reject()) |
| 417 | 417 | ->exception( |
| 418 | - function () { |
|
| 418 | + function() { |
|
| 419 | 419 | $this->notify(); |
| 420 | 420 | } |
| 421 | 421 | )->isInstanceOf(\LogicException::class) |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | { |
| 430 | 430 | $mockName = '\mock\Cubiche\Core\Delegate\Delegate'; |
| 431 | 431 | |
| 432 | - return new $mockName(function ($value = null) use ($return) { |
|
| 432 | + return new $mockName(function($value = null) use ($return) { |
|
| 433 | 433 | return $return === null ? $value : $return; |
| 434 | 434 | }); |
| 435 | 435 | } |
@@ -49,16 +49,16 @@ |
||
| 49 | 49 | protected function defaultConstructorArguments() |
| 50 | 50 | { |
| 51 | 51 | return array( |
| 52 | - function (callable $callable) { |
|
| 52 | + function(callable $callable) { |
|
| 53 | 53 | $this->resolve = new Delegate($callable); |
| 54 | 54 | }, |
| 55 | - function (callable $callable) { |
|
| 55 | + function(callable $callable) { |
|
| 56 | 56 | $this->reject = new Delegate($callable); |
| 57 | 57 | }, |
| 58 | - function (callable $callable) { |
|
| 58 | + function(callable $callable) { |
|
| 59 | 59 | $this->notify = new Delegate($callable); |
| 60 | 60 | }, |
| 61 | - function (callable $callable) { |
|
| 61 | + function(callable $callable) { |
|
| 62 | 62 | $this->cancel = new Delegate($callable); |
| 63 | 63 | }, |
| 64 | 64 | ); |
@@ -67,16 +67,16 @@ |
||
| 67 | 67 | { |
| 68 | 68 | if ($this->promise === null) { |
| 69 | 69 | $this->promise = new Promise( |
| 70 | - new Delegate(function (callable $callable) { |
|
| 70 | + new Delegate(function(callable $callable) { |
|
| 71 | 71 | $this->resolveDelegate = new Delegate($callable); |
| 72 | 72 | }), |
| 73 | - new Delegate(function (callable $callable) { |
|
| 73 | + new Delegate(function(callable $callable) { |
|
| 74 | 74 | $this->rejectDelegate = new Delegate($callable); |
| 75 | 75 | }), |
| 76 | - new Delegate(function (callable $callable) { |
|
| 76 | + new Delegate(function(callable $callable) { |
|
| 77 | 77 | $this->notifyDelegate = new Delegate($callable); |
| 78 | 78 | }), |
| 79 | - new Delegate(function (callable $callable) { |
|
| 79 | + new Delegate(function(callable $callable) { |
|
| 80 | 80 | $this->cancelDelegate = new Delegate($callable); |
| 81 | 81 | }) |
| 82 | 82 | ); |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | $this->rejectedDelegates = array(); |
| 67 | 67 | $this->notifyDelegates = array(); |
| 68 | 68 | |
| 69 | - $exportResolve(function ($value = null) { |
|
| 69 | + $exportResolve(function($value = null) { |
|
| 70 | 70 | return $this->resolve($value); |
| 71 | 71 | }); |
| 72 | - $exportReject(function ($reason = null) { |
|
| 72 | + $exportReject(function($reason = null) { |
|
| 73 | 73 | return $this->reject($reason); |
| 74 | 74 | }); |
| 75 | - $exportNotify(function ($state = null) { |
|
| 75 | + $exportNotify(function($state = null) { |
|
| 76 | 76 | return $this->notify($state); |
| 77 | 77 | }); |
| 78 | - $exportCancel(function () { |
|
| 78 | + $exportCancel(function() { |
|
| 79 | 79 | return $this->cancel(); |
| 80 | 80 | }); |
| 81 | 81 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | private function addSucceedDelegate(DeferredInterface $deferred, callable $succeed = null) |
| 106 | 106 | { |
| 107 | 107 | if ($this->state === self::WAITING || $this->state === self::COMPLETED) { |
| 108 | - $this->succeedDelegates[] = new Delegate(function ($value = null) use ($succeed, $deferred) { |
|
| 108 | + $this->succeedDelegates[] = new Delegate(function($value = null) use ($succeed, $deferred) { |
|
| 109 | 109 | $actual = $value; |
| 110 | 110 | if ($succeed !== null) { |
| 111 | 111 | $actual = $succeed($value); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | private function addRejectedDelegate(DeferredInterface $deferred, callable $rejected = null) |
| 124 | 124 | { |
| 125 | 125 | if ($this->state === self::WAITING || $this->state === self::REJECTED) { |
| 126 | - $this->rejectedDelegates[] = new Delegate(function ($reason = null) use ($rejected, $deferred) { |
|
| 126 | + $this->rejectedDelegates[] = new Delegate(function($reason = null) use ($rejected, $deferred) { |
|
| 127 | 127 | if ($rejected !== null) { |
| 128 | 128 | $rejected($reason); |
| 129 | 129 | } |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function always(callable $finally, callable $notify = null) |
| 162 | 162 | { |
| 163 | - return $this->then(function ($value) use ($finally) { |
|
| 163 | + return $this->then(function($value) use ($finally) { |
|
| 164 | 164 | $finally($value, null); |
| 165 | 165 | |
| 166 | 166 | return $value; |
| 167 | - }, function ($reason) use ($finally) { |
|
| 167 | + }, function($reason) use ($finally) { |
|
| 168 | 168 | $finally(null, $reason); |
| 169 | 169 | }, $notify); |
| 170 | 170 | } |