| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | $this->extractEndpoint(EXT::LOCAL_ENDPOINT, 'localEndpoint', $tags, $data); | 
| 47 | 47 | $this->extractEndpoint(EXT::REMOTE_ENDPOINT, 'remoteEndpoint', $tags, $data); | 
| 48 | 48 | |
| 49 | -        array_walk($tags, function (string &$v) { | |
| 49 | +        array_walk($tags, function(string &$v) { | |
| 50 | 50 | // values type convert .. do nothing | 
| 51 | 51 | }); | 
| 52 | 52 | |
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | list($timestamp, $fields) = $log; | 
| 58 | 58 | |
| 59 | 59 | $items = []; | 
| 60 | -                array_walk($fields, function ($v, $k) use (&$items) { | |
| 60 | +                array_walk($fields, function($v, $k) use (&$items) { | |
| 61 | 61 |                      $items[] = "{$k}={$v}"; | 
| 62 | 62 | }); | 
| 63 | 63 | |
| @@ -28,11 +28,11 @@ | ||
| 28 | 28 | DI::set(Platform::class, $zpk); | 
| 29 | 29 | DI::set(Observer::class, $zpk); | 
| 30 | 30 | |
| 31 | -        $app->starting()->add(static function () use ($zpk) { | |
| 31 | +        $app->starting()->add(static function() use ($zpk) { | |
| 32 | 32 | return $zpk->init(); | 
| 33 | 33 | }); | 
| 34 | 34 | |
| 35 | -        $app->stopping()->add(static function () use ($zpk) { | |
| 35 | +        $app->stopping()->add(static function() use ($zpk) { | |
| 36 | 36 | return $zpk->leave(); | 
| 37 | 37 | }); | 
| 38 | 38 | } | 
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | $this->endpoint | 
| 76 | 76 | ); | 
| 77 | 77 | |
| 78 | -        $this->daemon = Timer::loop(self::BATCH_INV, function () { | |
| 78 | +        $this->daemon = Timer::loop(self::BATCH_INV, function() { | |
| 79 | 79 | $this->submitting(); | 
| 80 | 80 | }); | 
| 81 | 81 | } | 
| @@ -87,7 +87,7 @@ discard block | ||
| 87 | 87 |      { | 
| 88 | 88 | Timer::clear($this->daemon); | 
| 89 | 89 | |
| 90 | -        $closing = function () { | |
| 90 | +        $closing = function() { | |
| 91 | 91 | $this->client->closed()->pended() && $this->client->close(); | 
| 92 | 92 | }; | 
| 93 | 93 | |
| @@ -120,7 +120,7 @@ discard block | ||
| 120 | 120 | */ | 
| 121 | 121 | private function submitting(Closure $then = null) : void | 
| 122 | 122 |      { | 
| 123 | -        $this->spouting(co(function (array $spans) use ($then) { | |
| 123 | +        $this->spouting(co(function(array $spans) use ($then) { | |
| 124 | 124 | $request = new Request( | 
| 125 | 125 | 'POST', | 
| 126 | 126 |                  new Uri('http', $this->endpoint->host(), $this->endpoint->port(), $this->path), | 
| @@ -134,13 +134,13 @@ discard block | ||
| 134 | 134 | * @var Response $response | 
| 135 | 135 | */ | 
| 136 | 136 | $response = yield $this->client->perform($request); | 
| 137 | -                if ((int)($response->getStatusCode() / 100) !== 2) { | |
| 137 | +                if ((int) ($response->getStatusCode() / 100) !== 2) { | |
| 138 | 138 |                      logger('traced')->notice( | 
| 139 | 139 | 'Server not accepting', | 
| 140 | 140 | [ | 
| 141 | - 'endpoint' => (string)$request->getUri(), | |
| 142 | -                            'error' => sprintf('#%d->%s', $response->getStatusCode(), (string)$response->getBody()), | |
| 143 | - 'payload' => debug() ? (string)$request->getBody() : '[IGNORED]', | |
| 141 | + 'endpoint' => (string) $request->getUri(), | |
| 142 | +                            'error' => sprintf('#%d->%s', $response->getStatusCode(), (string) $response->getBody()), | |
| 143 | + 'payload' => debug() ? (string) $request->getBody() : '[IGNORED]', | |
| 144 | 144 | ] | 
| 145 | 145 | ); | 
| 146 | 146 | } | 
| @@ -148,7 +148,7 @@ discard block | ||
| 148 | 148 |                  logger('traced')->notice( | 
| 149 | 149 | 'Posting failed', | 
| 150 | 150 | [ | 
| 151 | - 'endpoint' => (string)$request->getUri(), | |
| 151 | + 'endpoint' => (string) $request->getUri(), | |
| 152 | 152 |                          'error' => sprintf('%s::%s', get_class($e), $e->getMessage()), | 
| 153 | 153 | ] | 
| 154 | 154 | ); | 
| @@ -82,13 +82,13 @@ | ||
| 82 | 82 | 'zipkin' => [ZipkinHAV2::class, ZipkinJFV2::class], | 
| 83 | 83 | 'udp' => [UDPRelays::class, ZipkinJFV2::class], | 
| 84 | 84 | ], | 
| 85 | -            function (Transport $transport = null, Protocol $protocol = null) { | |
| 85 | +            function(Transport $transport = null, Protocol $protocol = null) { | |
| 86 | 86 | $this->transport && $this->transport->disconnect(); | 
| 87 | 87 | $this->transport = $transport; | 
| 88 | 88 | $this->protocol = $protocol; | 
| 89 | 89 | $this->changed($transport); | 
| 90 | 90 | }, | 
| 91 | -            static function (Throwable $e) { | |
| 91 | +            static function(Throwable $e) { | |
| 92 | 92 |                  logger('traced')->warning('Transport initialize failed', [ | 
| 93 | 93 | 'p' => 'zipkin', | 
| 94 | 94 | 'ec' => get_class($e), | 
| @@ -58,7 +58,7 @@ discard block | ||
| 58 | 58 | PHP_SAPI === 'cli' ? SWOOLE_SOCK_ASYNC : SWOOLE_SOCK_SYNC | 
| 59 | 59 | ); | 
| 60 | 60 | $this->client->connect($this->endpoint->host(), $this->endpoint->port()); | 
| 61 | -        $this->sender = function (string $data) { | |
| 61 | +        $this->sender = function(string $data) { | |
| 62 | 62 | @$this->client->send($data); | 
| 63 | 63 | }; | 
| 64 | 64 | } | 
| @@ -72,7 +72,7 @@ discard block | ||
| 72 | 72 | SOCK_DGRAM, | 
| 73 | 73 | $this->uxdomain ? IPPROTO_IP : SOL_UDP | 
| 74 | 74 | ); | 
| 75 | -        $this->sender = function (string $data) { | |
| 75 | +        $this->sender = function(string $data) { | |
| 76 | 76 | @socket_sendto( | 
| 77 | 77 | $this->socket, | 
| 78 | 78 | $data, | 
| @@ -142,10 +142,10 @@ discard block | ||
| 142 | 142 | private function packing(string $payload) : string | 
| 143 | 143 |      { | 
| 144 | 144 | return | 
| 145 | - self::MAGIC . | |
| 146 | -            pack('N', strlen($this->identify)) . | |
| 147 | - $this->identify . | |
| 148 | -            pack('N', strlen($payload)) . | |
| 145 | + self::MAGIC. | |
| 146 | +            pack('N', strlen($this->identify)). | |
| 147 | + $this->identify. | |
| 148 | +            pack('N', strlen($payload)). | |
| 149 | 149 | $payload | 
| 150 | 150 | ; | 
| 151 | 151 | } | 
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | Closure $setter, | 
| 33 | 33 | Closure $failure = null | 
| 34 | 34 |      ) : void { | 
| 35 | -        $source->watching($conf, static function (string $dsn) use ($schemes, $setter, $failure) { | |
| 35 | +        $source->watching($conf, static function(string $dsn) use ($schemes, $setter, $failure) { | |
| 36 | 36 | // parsing dsn | 
| 37 | 37 | $parsed = parse_url($dsn) ?: []; | 
| 38 | 38 | |