@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace PHPinnacle\Ensign; |
14 | 14 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | $token = new Token(); |
46 | 46 | |
47 | - return new Task(++$this->tasks, new LazyPromise(function () use ($callable, $arguments, $token) { |
|
47 | + return new Task(++$this->tasks, new LazyPromise(function() use ($callable, $arguments, $token) { |
|
48 | 48 | return $this->adapt($callable(...$arguments), $token); |
49 | 49 | }), $token); |
50 | 50 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | use PHPinnacle\Ensign\Dispatcher; |
14 | 14 | use PHPinnacle\Ensign\Task; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | continue; |
57 | 57 | } |
58 | 58 | |
59 | - $handler = function (string $watcherId, int $sigNo, $sigInfo = null) use ($dispatcher, $signal) { |
|
59 | + $handler = function(string $watcherId, int $sigNo, $sigInfo = null) use ($dispatcher, $signal) { |
|
60 | 60 | yield $dispatcher->dispatch($signal, $sigNo, $sigInfo, $watcherId); |
61 | 61 | }; |
62 | 62 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace PHPinnacle\Ensign; |
14 | 14 | |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | { |
75 | 75 | $deferred = new Deferred; |
76 | 76 | |
77 | - $watcher = Loop::delay($timeout, function () use ($deferred) { |
|
77 | + $watcher = Loop::delay($timeout, function() use ($deferred) { |
|
78 | 78 | $deferred->fail(new Exception\TaskTimeout($this->id)); |
79 | 79 | }); |
80 | 80 | Loop::unreference($watcher); |
81 | 81 | |
82 | 82 | $promise = $this->promise; |
83 | - $promise->onResolve(function () use ($deferred, $watcher) { |
|
83 | + $promise->onResolve(function() use ($deferred, $watcher) { |
|
84 | 84 | Loop::cancel($watcher); |
85 | 85 | |
86 | 86 | $deferred->resolve($this->promise); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace PHPinnacle\Ensign\Resolver; |
14 | 14 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * file that was distributed with this source code. |
8 | 8 | */ |
9 | 9 | |
10 | -declare(strict_types = 1); |
|
10 | +declare(strict_types=1); |
|
11 | 11 | |
12 | 12 | namespace PHPinnacle\Ensign; |
13 | 13 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace PHPinnacle\Ensign\Exception; |
14 | 14 |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | { |
23 | 23 | } |
24 | 24 | |
25 | -Amp\Loop::run(function () { |
|
25 | +Amp\Loop::run(function() { |
|
26 | 26 | $dispatcher = Dispatcher::instance(); |
27 | 27 | $dispatcher |
28 | - ->register(Ping::class, function (Ping $cmd) { |
|
28 | + ->register(Ping::class, function(Ping $cmd) { |
|
29 | 29 | if ($cmd->times > 0) { |
30 | 30 | $cmd->times--; |
31 | 31 | |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | yield new Stop(); |
37 | 37 | } |
38 | 38 | }) |
39 | - ->register(Pong::class, function (Pong $cmd) { |
|
39 | + ->register(Pong::class, function(Pong $cmd) { |
|
40 | 40 | echo 'Pong!' . \PHP_EOL; |
41 | 41 | |
42 | 42 | yield new Ping($cmd->times); |
43 | 43 | }) |
44 | - ->register(Stop::class, function () { |
|
44 | + ->register(Stop::class, function() { |
|
45 | 45 | echo 'Stop!' . \PHP_EOL; |
46 | 46 | }) |
47 | 47 | ; |
@@ -5,10 +5,10 @@ |
||
5 | 5 | |
6 | 6 | require __DIR__ . '/../vendor/autoload.php'; |
7 | 7 | |
8 | -Amp\Loop::run(function () { |
|
8 | +Amp\Loop::run(function() { |
|
9 | 9 | $dispatcher = Dispatcher::instance(); |
10 | 10 | $dispatcher |
11 | - ->register('emit', function (string $string, int $num, int $delay = 100) { |
|
11 | + ->register('emit', function(string $string, int $num, int $delay = 100) { |
|
12 | 12 | for ($i = 0; $i < $num; $i++) { |
13 | 13 | echo $string; |
14 | 14 |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | -Amp\Loop::run(function () { |
|
30 | +Amp\Loop::run(function() { |
|
31 | 31 | $dispatcher = Dispatcher::instance(); |
32 | 32 | $dispatcher |
33 | - ->register(SimpleCommand::class, function (SimpleCommand $cmd) { |
|
33 | + ->register(SimpleCommand::class, function(SimpleCommand $cmd) { |
|
34 | 34 | yield new Delayed($cmd->delay); // Just do some heavy calculations |
35 | 35 | yield SimpleEvent::class => new SimpleEvent($cmd->num + $cmd->num); |
36 | 36 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | return $cmd->num; |
41 | 41 | }) |
42 | - ->register(SimpleEvent::class, function (SimpleEvent $event) { |
|
42 | + ->register(SimpleEvent::class, function(SimpleEvent $event) { |
|
43 | 43 | echo \sprintf('Signal dispatched with value: %d at %s' . \PHP_EOL, $event->num, \microtime(true)); |
44 | 44 | }) |
45 | 45 | ; |