@@ -39,32 +39,32 @@ |
||
39 | 39 | { |
40 | 40 | $listeners = $this->listeners[$message->signal] ?? []; |
41 | 41 | |
42 | - yield \array_map(function ($listener) use ($message) { |
|
42 | + yield \array_map(function($listener) use ($message) { |
|
43 | 43 | return $this->processor->execute($listener, $message->arguments); |
44 | 44 | }, $listeners); |
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -Amp\Loop::run(function () { |
|
48 | +Amp\Loop::run(function() { |
|
49 | 49 | $processor = new Processor\SimpleProcessor(); |
50 | 50 | |
51 | 51 | $publisher = new Publisher($processor); |
52 | 52 | $publisher |
53 | - ->listen('print', function ($num) { |
|
53 | + ->listen('print', function($num) { |
|
54 | 54 | for ($i = 0; $i < $num; $i++) { |
55 | 55 | echo '-'; |
56 | 56 | |
57 | 57 | yield new Delayed(100); |
58 | 58 | } |
59 | 59 | }) |
60 | - ->listen('print', function ($num) { |
|
60 | + ->listen('print', function($num) { |
|
61 | 61 | for ($i = 0; $i < $num; $i++) { |
62 | 62 | echo '+'; |
63 | 63 | |
64 | 64 | yield new Delayed(100); |
65 | 65 | } |
66 | 66 | }) |
67 | - ->listen('print', function ($num) { |
|
67 | + ->listen('print', function($num) { |
|
68 | 68 | for ($i = 0; $i < $num; $i++) { |
69 | 69 | echo '*'; |
70 | 70 |
@@ -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 | $processor = new Processor\ParallelProcessor(); |
10 | 10 | $dispatcher = new Dispatcher($processor); |
11 | - $dispatcher->register('load', function ($url) { |
|
11 | + $dispatcher->register('load', function($url) { |
|
12 | 12 | echo "Start getting: {$url}" . \PHP_EOL; |
13 | 13 | |
14 | 14 | file_get_contents($url); |
@@ -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\Action; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | continue; |
57 | 57 | } |
58 | 58 | |
59 | - $handler = static function (string $watcherId, int $sigNo, $sigInfo = null) use ($dispatcher, $signal) { |
|
59 | + $handler = static 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\Processor; |
14 | 14 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | protected function process(callable $handler, array $arguments, Token $token): callable |
49 | 49 | { |
50 | - return function () use ($handler, $arguments, $token) { |
|
50 | + return function() use ($handler, $arguments, $token) { |
|
51 | 51 | $parallel = ParallelFunctions\parallel($handler, $this->pool); |
52 | 52 | |
53 | 53 | return $parallel(...$arguments); |
@@ -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\Processor; |
14 | 14 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function process(callable $handler, array $arguments, Token $token): callable |
25 | 25 | { |
26 | - return function () use ($handler, $arguments, $token) { |
|
26 | + return function() use ($handler, $arguments, $token) { |
|
27 | 27 | return $this->adapt($handler(...$arguments), $token); |
28 | 28 | }; |
29 | 29 | } |