@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | |
6 | 6 | require __DIR__ . '/../vendor/autoload.php'; |
7 | 7 | |
8 | -Amp\Loop::run(function () { |
|
8 | +Amp\Loop::run(function() { |
|
9 | 9 | $dispatcher = new Dispatcher(); |
10 | 10 | $dispatcher |
11 | - ->register('endless', function (string $sign) { |
|
11 | + ->register('endless', function(string $sign) { |
|
12 | 12 | while (true) { |
13 | 13 | yield new Delayed(100); |
14 | 14 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | try { |
21 | 21 | $action = $dispatcher->dispatch('endless', '.'); |
22 | 22 | |
23 | - Amp\Loop::delay(500, function () use ($action) { |
|
23 | + Amp\Loop::delay(500, function() use ($action) { |
|
24 | 24 | $action->cancel(); |
25 | 25 | }); |
26 | 26 |
@@ -5,10 +5,10 @@ discard block |
||
5 | 5 | |
6 | 6 | require __DIR__ . '/../vendor/autoload.php'; |
7 | 7 | |
8 | -Amp\Loop::run(function () { |
|
8 | +Amp\Loop::run(function() { |
|
9 | 9 | $dispatcher = new Dispatcher(); |
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 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | }) |
20 | 20 | ; |
21 | 21 | |
22 | - $times = \rand(5, 10); |
|
22 | + $times = \rand(5, 10); |
|
23 | 23 | $actionOne = $dispatcher->dispatch('emit', '-', $times, 100); |
24 | 24 | $actionTwo = $dispatcher->dispatch('emit', '+', $times + \rand(5, 10), 100); |
25 | 25 |
@@ -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 |
@@ -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 |
@@ -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\Executor; |
14 | 14 |
@@ -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\Executor; |
14 | 14 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $id = UUID::random(); |
57 | 57 | |
58 | 58 | $token = new Token($id); |
59 | - $promise = new LazyPromise(function () use ($handler, $arguments, $token) { |
|
59 | + $promise = new LazyPromise(function() use ($handler, $arguments, $token) { |
|
60 | 60 | return $this->adapt($this->executor->execute($handler, $arguments), $token); |
61 | 61 | }); |
62 | 62 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public function __invoke(Publish $message) |
39 | 39 | { |
40 | - $actions = \array_map(function ($listener) use ($message) { |
|
40 | + $actions = \array_map(function($listener) use ($message) { |
|
41 | 41 | return $this->processor->execute($listener, $message->arguments); |
42 | 42 | }, $this->listeners[$message->signal] ?? []); |
43 | 43 | |
@@ -45,25 +45,25 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -Amp\Loop::run(function () { |
|
48 | +Amp\Loop::run(function() { |
|
49 | 49 | $processor = new Processor(); |
50 | 50 | $publisher = new Publisher($processor); |
51 | 51 | $publisher |
52 | - ->listen('print', function ($num) { |
|
52 | + ->listen('print', function($num) { |
|
53 | 53 | for ($i = 0; $i < $num; $i++) { |
54 | 54 | echo '-'; |
55 | 55 | |
56 | 56 | yield new Delayed(100); |
57 | 57 | } |
58 | 58 | }) |
59 | - ->listen('print', function ($num) { |
|
59 | + ->listen('print', function($num) { |
|
60 | 60 | for ($i = 0; $i < $num; $i++) { |
61 | 61 | echo '+'; |
62 | 62 | |
63 | 63 | yield new Delayed(100); |
64 | 64 | } |
65 | 65 | }) |
66 | - ->listen('print', function ($num) { |
|
66 | + ->listen('print', function($num) { |
|
67 | 67 | for ($i = 0; $i < $num; $i++) { |
68 | 68 | echo '*'; |
69 | 69 |