Passed
Branch master (128aab)
by Shiyu
02:58
created
Category
src/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $this->name = $name;
44 44
         $this->listen = $listen;
45 45
 
46
-        $this->events()->attach(Worker::STARTED, function (Conn $ctx) {
46
+        $this->events()->attach(Worker::STARTED, function(Conn $ctx) {
47 47
             $ctx->events()->attach(HTTP::REQUESTING, RServer::layers()->handler());
48 48
         });
49 49
     }
Please login to merge, or discard this patch.
src/Serviced/ConsulRG.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 ->servicing($advertise, $server, $this->dTagging->getTags())
67 67
             ;
68 68
 
69
-            ($ready = $service->ready())->then(static function () use ($service) {
69
+            ($ready = $service->ready())->then(static function() use ($service) {
70 70
                 logger('hrpc')->info('Service has been registered', ['node' => $service->endpoint()]);
71 71
             });
72 72
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $waits = [];
85 85
 
86 86
         foreach ($this->sRegistered as $service) {
87
-            ($respond = $service->deregister())->then(static function () use ($service) {
87
+            ($respond = $service->deregister())->then(static function() use ($service) {
88 88
                 logger('hrpc')->info('Service has been deregistered', ['node' => $service->endpoint()]);
89 89
             });
90 90
             $waits[] = $respond;
Please login to merge, or discard this patch.
src/Handlers/TrafficShaping.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         Ticker::new([
39 39
             Metrics::gauge()->named('shaper.bucket.tokens'),
40 40
             Metrics::gauge()->named('shaper.acquire.waits'),
41
-        ], static function (Gauge $tokens, Gauge $waits) use ($shaper) {
41
+        ], static function(Gauge $tokens, Gauge $waits) use ($shaper) {
42 42
             $tokens->set($shaper->tokens());
43 43
             $waits->set($shaper->waits());
44 44
         });
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             return $request;
56 56
         }
57 57
 
58
-        return $this->shaper->queued()->then(static function () use ($request) {
58
+        return $this->shaper->queued()->then(static function() use ($request) {
59 59
             return $request;
60 60
         });
61 61
     }
Please login to merge, or discard this patch.
src/Plugins/Registry.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function enabled() : bool
69 69
     {
70
-        return DI::has(ServiceRG::class) ? !! $this->registry = DI::get(ServiceRG::class) : false;
70
+        return DI::has(ServiceRG::class) ? !!$this->registry = DI::get(ServiceRG::class) : false;
71 71
     }
72 72
 
73 73
     /**
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
         $forked->waiting($this->waits);
81 81
 
82 82
         $events
83
-        ->attach(Events\Server::CREATED, static function (Conn $serv) use ($forked) {
83
+        ->attach(Events\Server::CREATED, static function(Conn $serv) use ($forked) {
84 84
             $forked->startup($serv->server()->raw());
85 85
         })
86
-        ->attach(Events\Server::STARTUP, static function (Conn $serv) use ($forked) {
86
+        ->attach(Events\Server::STARTUP, static function(Conn $serv) use ($forked) {
87 87
             $forked->porting($serv->local()->port());
88 88
         })
89
-        ->attach(Events\Server::SHUTDOWN, static function () use ($forked) {
89
+        ->attach(Events\Server::SHUTDOWN, static function() use ($forked) {
90 90
             $forked->shutdown();
91 91
         })
92
-        ->attach(Events\Worker::STARTED, static function (Conn $serv) use ($forked) {
92
+        ->attach(Events\Worker::STARTED, static function(Conn $serv) use ($forked) {
93 93
             $startup = $serv->ctx()->get('WG:STARTING');
94 94
             if ($startup instanceof Waited) {
95
-                $startup->done()->then(function () use ($serv, $forked) {
95
+                $startup->done()->then(function() use ($serv, $forked) {
96 96
                     $forked->ready($serv->worker());
97 97
                 });
98 98
             } else {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function ready(int $wid) : void
126 126
     {
127
-        $this->ready ++;
127
+        $this->ready++;
128 128
         $this->starting();
129 129
     }
130 130
 
Please login to merge, or discard this patch.
src/Components/Scanner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
          * @var RScanner $scanner
29 29
          */
30 30
 
31
-        if (defined('CWD') && is_file($rf = CWD . '/registers.php')) {
31
+        if (defined('CWD') && is_file($rf = CWD.'/registers.php')) {
32 32
             DI::set(Router::class, $router = DI::object(Router::class));
33 33
             DI::set(RScanner::class, $scanner = DI::object(RScanner::class));
34 34
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
             $app->named($router->server());
38 38
 
39
-            $app->starting()->add(static function () use ($scanner) {
39
+            $app->starting()->add(static function() use ($scanner) {
40 40
                 $scanner->analyzing();
41 41
             });
42 42
         }
Please login to merge, or discard this patch.
src/Components/Serving.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         // initial mark server "unavailable"
49 49
         Server::layers()->append(ServerWrapper::class, DI::object(ServerUnavailable::class));
50 50
 
51
-        $app->starting()->add(static function () {
51
+        $app->starting()->add(static function() {
52 52
             // add traffic monitor layer
53 53
             DI::has(Daemon::class) && Server::layers()->append(
54 54
                 ServerWrapper::class,
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             );
57 57
         });
58 58
 
59
-        $app->starting()->done()->then(static function () {
59
+        $app->starting()->done()->then(static function() {
60 60
             // mark server "available" when bootstrap done
61 61
             Server::layers()->remove(ServerUnavailable::class);
62 62
         });
Please login to merge, or discard this patch.
src/Components/Dispatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         $started = $app->starting()->done();
42 42
         $shutdown = Promise::deferred();
43 43
 
44
-        $app->starting()->add(static function () use ($dispatcher, $scanner, $started, $shutdown) {
45
-            $dispatcher->preparing($started, $shutdown)->catch(function (Throwable $e) {
44
+        $app->starting()->add(static function() use ($dispatcher, $scanner, $started, $shutdown) {
45
+            $dispatcher->preparing($started, $shutdown)->catch(function(Throwable $e) {
46 46
                 logger('hrpc')->error(
47 47
                     'Service startup failed when initialize',
48 48
                     ['ec' => get_class($e), 'em' => $e->getMessage()]
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             });
51 51
         });
52 52
 
53
-        $app->stopping()->add(static function () use ($shutdown) {
53
+        $app->stopping()->add(static function() use ($shutdown) {
54 54
             $shutdown->resolve();
55 55
         });
56 56
     }
Please login to merge, or discard this patch.
src/Components/Tracing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@
 block discarded – undo
41 41
 
42 42
         $platform = DI::get(Observer::class);
43 43
 
44
-        $platform->transportable(static function () {
44
+        $platform->transportable(static function() {
45 45
             Server::layers()->has(TracedOutgoing::class)
46 46
             || Server::layers()->prepend(ServerWrapper::class, DI::object(TracedOutgoing::class));
47 47
             Server::layers()->has(TracedIncoming::class)
48 48
             || Server::layers()->append(ServerWrapper::class, DI::object(TracedIncoming::class));
49
-        }, static function () {
49
+        }, static function() {
50 50
             Server::layers()->remove(TracedOutgoing::class);
51 51
             Server::layers()->remove(TracedIncoming::class);
52 52
         });
Please login to merge, or discard this patch.