@@ -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 |
@@ -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 |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function add(): void |
28 | 28 | { |
29 | - $this->async->add(static function () { |
|
29 | + $this->async->add(static function() { |
|
30 | 30 | usleep(8000); |
31 | 31 | |
32 | 32 | return 555; |
33 | 33 | }); |
34 | - $this->async->add(static function () { |
|
34 | + $this->async->add(static function() { |
|
35 | 35 | return 2; |
36 | 36 | }); |
37 | 37 | |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function then(): void |
45 | 45 | { |
46 | - $this->async->add(static function () { |
|
46 | + $this->async->add(static function() { |
|
47 | 47 | return 555; |
48 | - })->then(static function (int $value) { |
|
48 | + })->then(static function(int $value) { |
|
49 | 49 | static::assertEquals(555, $value); |
50 | 50 | }); |
51 | 51 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function failed(): void |
59 | 59 | { |
60 | - $this->async->add(static function () { |
|
60 | + $this->async->add(static function() { |
|
61 | 61 | throw new \Exception('Test message'); |
62 | - })->catch(function ($exception) { |
|
62 | + })->catch(function($exception) { |
|
63 | 63 | static::assertEquals('Test message', $exception->getMessage()); |
64 | 64 | }); |
65 | 65 |
@@ -56,9 +56,9 @@ |
||
56 | 56 | protected function listener(): void |
57 | 57 | { |
58 | 58 | pcntl_async_signals(true); |
59 | - pcntl_signal(SIGCHLD, function ($signo, $status) { |
|
59 | + pcntl_signal(SIGCHLD, function($signo, $status) { |
|
60 | 60 | while (true) { |
61 | - $pid = pcntl_waitpid(-1, $processState, WNOHANG | WUNTRACED); |
|
61 | + $pid = pcntl_waitpid(-1, $processState, WNOHANG|WUNTRACED); |
|
62 | 62 | if ($pid <= 0) { |
63 | 63 | break; |
64 | 64 | } |
@@ -41,11 +41,11 @@ |
||
41 | 41 | protected function find(string $file): ?string |
42 | 42 | { |
43 | 43 | $paths = array_filter([ |
44 | - __DIR__ . '/../../../../'.$file, |
|
45 | - __DIR__ . '/../../../'.$file, |
|
46 | - __DIR__ . '/../../'.$file, |
|
47 | - __DIR__ . '/../'.$file, |
|
48 | - ], static function (string $path) { |
|
44 | + __DIR__ . '/../../../../' . $file, |
|
45 | + __DIR__ . '/../../../' . $file, |
|
46 | + __DIR__ . '/../../' . $file, |
|
47 | + __DIR__ . '/../' . $file, |
|
48 | + ], static function(string $path) { |
|
49 | 49 | return file_exists($path); |
50 | 50 | }); |
51 | 51 | return reset($paths); |