Passed
Push — master ( baeed4...2f01ca )
by PHPinnacle
02:39
created
src/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
      */
53 53
     public static function error(\Exception $error): self
54 54
     {
55
-        return self::define(function () use ($error) {
55
+        return self::define(function() use ($error) {
56 56
             throw $error;
57 57
         });
58 58
     }
Please login to merge, or discard this patch.
src/SignalDispatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $handler = $this->handler($signal);
36 36
         $channel = Channel::open($signal);
37 37
 
38
-        $promise = \future(function () use ($channel, $handler, $arguments) {
38
+        $promise = \future(function() use ($channel, $handler, $arguments) {
39 39
             $result = $handler(...$arguments);
40 40
 
41 41
             if ($result instanceof \Generator) {
Please login to merge, or discard this patch.
examples/pcntl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 require __DIR__ . '/../vendor/autoload.php';
4 4
 
5
-Amp\Loop::run(function () {
5
+Amp\Loop::run(function() {
6 6
     $signals = \pcntl_signal_list(['SIGINT']);
7 7
 
8 8
     foreach ($signals as $signal) {
9
-        \ensign_signal($signal, function ($sigNo) {
9
+        \ensign_signal($signal, function($sigNo) {
10 10
             echo \sprintf('System signal "%d" received.' . \PHP_EOL, $sigNo);
11 11
         });
12 12
     }
Please login to merge, or discard this patch.
examples/concurent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 
6 6
 require __DIR__ . '/../vendor/autoload.php';
7 7
 
8
-Amp\Loop::run(function () {
8
+Amp\Loop::run(function() {
9 9
     $handlers = new HandlerMap();
10
-    $handlers->register('emit', function (string $string, int $num, int $delay) {
10
+    $handlers->register('emit', function(string $string, int $num, int $delay) {
11 11
         for ($i = 0; $i < $num; $i++) {
12 12
             echo $string;
13 13
 
Please login to merge, or discard this patch.
examples/emit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
     }
16 16
 }
17 17
 
18
-Amp\Loop::run(function () {
18
+Amp\Loop::run(function() {
19 19
     $handlers = new HandlerMap();
20
-    $handlers->register('emit', function (int $num) {
20
+    $handlers->register('emit', function(int $num) {
21 21
         yield new SimpleEvent($num - 1);
22 22
         yield new Amp\Delayed(1000); // Just do some heavy calculations
23 23
 
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
     $dispatcher = new SignalDispatcher($handlers);
35 35
 
36 36
     $task = $dispatcher->dispatch('emit', 10);
37
-    $task->onResolve(function (\Throwable $error = null, $data) {
37
+    $task->onResolve(function(\Throwable $error = null, $data) {
38 38
         echo \sprintf('Task resolved with value: %d at %s' . \PHP_EOL, $data, \microtime(true));
39 39
     });
40 40
 
41 41
     $eventOne = $task->wait(SimpleEvent::class);
42
-    $eventOne->onResolve(function (\Throwable $error = null, SimpleEvent $event = null) {
42
+    $eventOne->onResolve(function(\Throwable $error = null, SimpleEvent $event = null) {
43 43
         echo \sprintf('Event one resolved with value: %d at %s' . \PHP_EOL, $event->num, \microtime(true));
44 44
     });
45 45
 
46 46
     $eventTwo = $task->wait(SimpleEvent::class);
47
-    $eventTwo->onResolve(function (\Throwable $error = null, SimpleEvent $event = null) {
47
+    $eventTwo->onResolve(function(\Throwable $error = null, SimpleEvent $event = null) {
48 48
         echo \sprintf('Event two resolved with value: %d at %s' . \PHP_EOL, $event->num, \microtime(true));
49 49
     });
50 50
 
51 51
     $eventThree = $task->wait(SimpleEvent::class);
52
-    $eventThree->onResolve(function (\Throwable $error = null, SimpleEvent $event = null) {
52
+    $eventThree->onResolve(function(\Throwable $error = null, SimpleEvent $event = null) {
53 53
         echo \sprintf('Event three resolved with value: %d at %s' . \PHP_EOL, $event->num, \microtime(true));
54 54
     });
55 55
 });
Please login to merge, or discard this patch.
src/async.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
  */
86 86
 function future(...$arguments): \Amp\Promise
87 87
 {
88
-    return new \Amp\LazyPromise(function () use ($arguments) {
88
+    return new \Amp\LazyPromise(function() use ($arguments) {
89 89
         return \promise(...$arguments);
90 90
     });
91 91
 }
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
             continue;
94 94
         }
95 95
 
96
-        $handler = function (string $watcherId, int $sigNo, $sigInfo = null) use ($dispatcher, $signal) {
96
+        $handler = function(string $watcherId, int $sigNo, $sigInfo = null) use ($dispatcher, $signal) {
97 97
             yield $dispatcher->dispatch($signal, $sigNo, $sigInfo, $watcherId);
98 98
         };
99 99
 
Please login to merge, or discard this patch.