Passed
Push — master ( 392556...a36e60 )
by PHPinnacle
06:42 queued 04:41
created
src/Exception/EnsignException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Exception/UnknownSignal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Exception/BadActionCall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
examples/emit.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
     }
29 29
 }
30 30
 
31
-Amp\Loop::run(function () {
31
+Amp\Loop::run(function() {
32 32
     $builder = new DispatcherBuilder;
33 33
     $builder
34
-        ->register(SimpleCommand::class, function (SimpleCommand $cmd) {
34
+        ->register(SimpleCommand::class, function(SimpleCommand $cmd) {
35 35
             yield new Delayed($cmd->delay); // Just do some heavy calculations
36 36
             yield SimpleEvent::class => new SimpleEvent($cmd->num + $cmd->num);
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
             return $cmd->num;
42 42
         })
43
-        ->register(SimpleEvent::class, function (SimpleEvent $event) {
43
+        ->register(SimpleEvent::class, function(SimpleEvent $event) {
44 44
             echo \sprintf('Signal dispatched with value: %d at %s' . \PHP_EOL, $event->num, \microtime(true));
45 45
         })
46 46
     ;
Please login to merge, or discard this patch.
examples/ping-pong.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
 {
23 23
 }
24 24
 
25
-Amp\Loop::run(function () {
25
+Amp\Loop::run(function() {
26 26
     $builder = new DispatcherBuilder;
27 27
     $builder
28
-        ->register(Ping::class, function (Ping $cmd) {
28
+        ->register(Ping::class, function(Ping $cmd) {
29 29
             if ($cmd->times > 0) {
30 30
                 $cmd->times--;
31 31
 
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
                 yield new Stop();
37 37
             }
38 38
         })
39
-        ->register(Pong::class, function (Pong $cmd) {
39
+        ->register(Pong::class, function(Pong $cmd) {
40 40
             echo 'Pong!' . \PHP_EOL;
41 41
 
42 42
             yield new Ping($cmd->times);
43 43
         })
44
-        ->register(Stop::class, function () {
44
+        ->register(Stop::class, function() {
45 45
             echo 'Stop!' . \PHP_EOL;
46 46
         })
47 47
     ;
Please login to merge, or discard this patch.
examples/events.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,24 +5,24 @@
 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
     $builder = new DispatcherBuilder;
10 10
     $builder
11
-        ->register('print', function ($num) {
11
+        ->register('print', function($num) {
12 12
             for ($i = 0; $i < $num; $i++) {
13 13
                 echo '-';
14 14
 
15 15
                 yield new Delayed(100);
16 16
             }
17 17
         })
18
-        ->register('print', function ($num) {
18
+        ->register('print', function($num) {
19 19
             for ($i = 0; $i < $num; $i++) {
20 20
                 echo '+';
21 21
 
22 22
                 yield new Delayed(100);
23 23
             }
24 24
         })
25
-        ->register('print', function ($num) {
25
+        ->register('print', function($num) {
26 26
             for ($i = 0; $i < $num; $i++) {
27 27
                 echo '*';
28 28
 
Please login to merge, or discard this patch.
examples/process.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
 
7 7
 require __DIR__ . '/../vendor/autoload.php';
8 8
 
9
-Amp\Loop::run(function () {
9
+Amp\Loop::run(function() {
10 10
     $handlers = new HandlerRegistry;
11 11
     $handlers
12
-        ->add('spawn', function (callable $process) {
12
+        ->add('spawn', function(callable $process) {
13 13
             static $pid = 1;
14 14
 
15 15
             $gen = $process($pid);
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 
19 19
             return $pid++;
20 20
         })
21
-        ->add('send', function (int $pid, string $message, ...$arguments) {
21
+        ->add('send', function(int $pid, string $message, ...$arguments) {
22 22
             $signal = sprintf('%s.%d', $message, $pid);
23 23
 
24 24
             return yield $signal => $arguments;
25 25
         })
26
-        ->add('receive', function (int $pid, string $message, callable $handler) use ($handlers) {
26
+        ->add('receive', function(int $pid, string $message, callable $handler) use ($handlers) {
27 27
             $signal = sprintf('%s.%d', $message, $pid);
28 28
 
29 29
             $handlers->add($signal, $handler);
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 
33 33
     $dispatcher = new Dispatcher($handlers);
34 34
 
35
-    $receiver = yield $dispatcher->dispatch('spawn', function (int $pid) {
36
-        yield 'receive' => [$pid, 'ping', function () {
35
+    $receiver = yield $dispatcher->dispatch('spawn', function(int $pid) {
36
+        yield 'receive' => [$pid, 'ping', function() {
37 37
             echo 'Ping!' . \PHP_EOL;
38 38
         }];
39 39
 
40
-        yield 'receive' => [$pid, 'pong', function () {
40
+        yield 'receive' => [$pid, 'pong', function() {
41 41
             echo 'Pong!' . \PHP_EOL;
42 42
         }];
43 43
     });
44 44
 
45
-    $senderOne = $dispatcher->dispatch('spawn', function () use ($receiver) {
45
+    $senderOne = $dispatcher->dispatch('spawn', function() use ($receiver) {
46 46
         yield 'send' => [$receiver, 'ping'];
47 47
         yield new Delayed(500);
48 48
         yield 'send' => [$receiver, 'ping'];
49 49
     });
50 50
 
51
-    $senderTwo = $dispatcher->dispatch('spawn', function () use ($receiver) {
51
+    $senderTwo = $dispatcher->dispatch('spawn', function() use ($receiver) {
52 52
         yield 'send' => [$receiver, 'pong'];
53 53
         yield new Delayed(100);
54 54
         yield 'send' => [$receiver, 'pong'];
Please login to merge, or discard this patch.
examples/concurent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@  discard block
 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
     $builder = new DispatcherBuilder;
10 10
     $builder
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
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     $dispatcher = $builder->build();
23 23
 
24
-    $times   = \rand(5, 10);
24
+    $times = \rand(5, 10);
25 25
     $actionOne = $dispatcher->dispatch('emit', '-', $times, 100);
26 26
     $actionTwo = $dispatcher->dispatch('emit', '+', $times + \rand(5, 10), 100);
27 27
 
Please login to merge, or discard this patch.
src/HandlerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.