@@ -71,7 +71,7 @@ |
||
| 71 | 71 | return $this; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - public function catch(callable $callback): self |
|
| 74 | + public function catch (callable $callback): self |
|
| 75 | 75 | { |
| 76 | 76 | $this->error[] = $callback; |
| 77 | 77 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * @param callable $callback |
| 42 | 42 | * @return mixed |
| 43 | 43 | */ |
| 44 | - public function catch(callable $callback): self; |
|
| 44 | + public function catch (callable $callback): self; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * @return $this |
@@ -57,9 +57,9 @@ |
||
| 57 | 57 | private function listener(): void |
| 58 | 58 | { |
| 59 | 59 | pcntl_async_signals(true); |
| 60 | - pcntl_signal(SIGCHLD, function ($signo, $status) { |
|
| 60 | + pcntl_signal(SIGCHLD, function($signo, $status) { |
|
| 61 | 61 | while (true) { |
| 62 | - $pid = pcntl_waitpid(-1, $processState, WNOHANG | WUNTRACED); |
|
| 62 | + $pid = pcntl_waitpid(-1, $processState, WNOHANG|WUNTRACED); |
|
| 63 | 63 | if ($pid <= 0) { |
| 64 | 64 | break; |
| 65 | 65 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | __DIR__ . '/../bin/child', |
| 48 | 48 | __DIR__ . '/bin/child', |
| 49 | 49 | |
| 50 | - ], static function (string $path) { |
|
| 50 | + ], static function(string $path) { |
|
| 51 | 51 | return file_exists($path); |
| 52 | 52 | }); |
| 53 | 53 | $this->script = reset($paths); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | __DIR__ . '/../../../vendor/autoload.php', |
| 68 | 68 | __DIR__ . '/../../vendor/autoload.php', |
| 69 | 69 | __DIR__ . '/../vendor/autoload.php', |
| 70 | - ], static function (string $path) { |
|
| 70 | + ], static function(string $path) { |
|
| 71 | 71 | return file_exists($path); |
| 72 | 72 | }); |
| 73 | 73 | $this->autoloader = reset($paths); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function handle(): void |
| 37 | 37 | { |
| 38 | - $closure = function () { |
|
| 38 | + $closure = function() { |
|
| 39 | 39 | return 33; |
| 40 | 40 | }; |
| 41 | 41 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function handleException(): void |
| 57 | 57 | { |
| 58 | - $closure = function () { |
|
| 58 | + $closure = function() { |
|
| 59 | 59 | throw new Exception('Test message'); |
| 60 | 60 | }; |
| 61 | 61 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function write(): void |
| 77 | 77 | { |
| 78 | - $closure = function () { |
|
| 78 | + $closure = function() { |
|
| 79 | 79 | return 'Same return value'; |
| 80 | 80 | }; |
| 81 | 81 | |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function add(): void |
| 29 | 29 | { |
| 30 | - $this->async->add(static function () { |
|
| 30 | + $this->async->add(static function() { |
|
| 31 | 31 | usleep(8000); |
| 32 | 32 | |
| 33 | 33 | return 555; |
| 34 | 34 | }); |
| 35 | - $this->async->add(static function () { |
|
| 35 | + $this->async->add(static function() { |
|
| 36 | 36 | return 2; |
| 37 | 37 | }); |
| 38 | 38 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function then(): void |
| 46 | 46 | { |
| 47 | - $this->async->add(static function () { |
|
| 47 | + $this->async->add(static function() { |
|
| 48 | 48 | return 555; |
| 49 | - })->then(static function (int $value) { |
|
| 49 | + })->then(static function(int $value) { |
|
| 50 | 50 | static::assertEquals(555, $value); |
| 51 | 51 | }); |
| 52 | 52 | |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function failed(): void |
| 60 | 60 | { |
| 61 | - $this->async->add(static function () { |
|
| 61 | + $this->async->add(static function() { |
|
| 62 | 62 | throw new Exception('Test message'); |
| 63 | - })->catch(function (Exception $exception) { |
|
| 63 | + })->catch(function(Exception $exception) { |
|
| 64 | 64 | static::assertEquals('Test message', $exception->getMessage()); |
| 65 | 65 | }); |
| 66 | 66 | |