@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | { |
59 | 59 | return sprintf( |
60 | 60 | "[%s] [%s] [%s] : %s ~ %s\n", |
61 | - $this->colorSignBGN . $this->colors[$level] . strtoupper($level) . $this->colorSignEND, |
|
61 | + $this->colorSignBGN.$this->colors[$level].strtoupper($level).$this->colorSignEND, |
|
62 | 62 | date('Y-m-d H:i:s'), |
63 | 63 | strtoupper($scene), |
64 | - $this->colorSignBGN . $this->colorMessage . $message . $this->colorSignEND, |
|
64 | + $this->colorSignBGN.$this->colorMessage.$message.$this->colorSignEND, |
|
65 | 65 | $this->context($context) |
66 | 66 | ); |
67 | 67 | } |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | { |
75 | 75 | $print = '['; |
76 | 76 | |
77 | - array_walk($context, function ($item, $key) use (&$print) { |
|
78 | - $ctx = $this->colorSignBGN . $this->colorCtxKey . $key . $this->colorSignEND . '='; |
|
77 | + array_walk($context, function($item, $key) use (&$print) { |
|
78 | + $ctx = $this->colorSignBGN.$this->colorCtxKey.$key.$this->colorSignEND.'='; |
|
79 | 79 | if (is_array($item)) { |
80 | 80 | $ctx .= json_encode($item, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
81 | 81 | } else { |
82 | 82 | $ctx .= $item; |
83 | 83 | } |
84 | - $print .= $ctx . ','; |
|
84 | + $print .= $ctx.','; |
|
85 | 85 | }); |
86 | 86 | |
87 | - return rtrim($print, ',') . ']'; |
|
87 | + return rtrim($print, ',').']'; |
|
88 | 88 | } |
89 | 89 | } |
@@ -48,6 +48,6 @@ |
||
48 | 48 | $context |
49 | 49 | ), |
50 | 50 | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE |
51 | - ) . "\n"; |
|
51 | + )."\n"; |
|
52 | 52 | } |
53 | 53 | } |
@@ -71,19 +71,19 @@ |
||
71 | 71 | */ |
72 | 72 | public function reconfigure(Configure $configure) : void |
73 | 73 | { |
74 | - $configure->syncLevel($this->scene, function (string $level) { |
|
74 | + $configure->syncLevel($this->scene, function(string $level) { |
|
75 | 75 | $this->allows = array_slice($this->levels, 0, array_search($level, $this->levels, true) + 1); |
76 | 76 | }); |
77 | 77 | |
78 | - $configure->syncFormatter($this->scene, function (Formatter $formatter) { |
|
78 | + $configure->syncFormatter($this->scene, function(Formatter $formatter) { |
|
79 | 79 | $this->formatter = $formatter; |
80 | 80 | }); |
81 | 81 | |
82 | - $configure->syncOutputter($this->scene, function (Outputter $outputter) { |
|
82 | + $configure->syncOutputter($this->scene, function(Outputter $outputter) { |
|
83 | 83 | $this->outputter = $outputter; |
84 | 84 | }); |
85 | 85 | |
86 | - $configure->syncReplicator($this->scene, function (Replicated $replicated = null) { |
|
86 | + $configure->syncReplicator($this->scene, function(Replicated $replicated = null) { |
|
87 | 87 | $this->replicator = $replicated; |
88 | 88 | }); |
89 | 89 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function hosting(Address $address, Closure $connector) : Outputter |
31 | 31 | { |
32 | 32 | return |
33 | - $this->connected[$cid = (string)$address] ?? |
|
33 | + $this->connected[$cid = (string) $address] ?? |
|
34 | 34 | $this->connected[$cid] = $this->watch($cid, $connector($address)) |
35 | 35 | ; |
36 | 36 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | private function watch(string $cid, Closeable $conn) : Closeable |
44 | 44 | { |
45 | - $conn->closed()->then(function () use ($cid) { |
|
45 | + $conn->closed()->then(function() use ($cid) { |
|
46 | 46 | unset($this->connected[$cid]); |
47 | 47 | }); |
48 | 48 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function close(Address $address) : Promised |
57 | 57 | { |
58 | - return ($c = $this->connected[(string)$address] ?? null) ? $c->close() : Promise::resolved(); |
|
58 | + return ($c = $this->connected[(string) $address] ?? null) ? $c->close() : Promise::resolved(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | { |
66 | 66 | $sync(debug() ? LogLevel::DEBUG : LogLevel::INFO); |
67 | 67 | |
68 | - $this->watched[] = $this->cfg->overrides(static function (string $level) use ($sync) { |
|
68 | + $this->watched[] = $this->cfg->overrides(static function(string $level) use ($sync) { |
|
69 | 69 | debug() || $sync($level); |
70 | - }, 'log.level', $scene . '.log.level'); |
|
70 | + }, 'log.level', $scene.'.log.level'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | { |
79 | 79 | $sync($this->getFormatter('text')); |
80 | 80 | |
81 | - $this->watched[] = $this->cfg->overrides(function (string $type) use ($sync) { |
|
81 | + $this->watched[] = $this->cfg->overrides(function(string $type) use ($sync) { |
|
82 | 82 | debug() || $sync($this->getFormatter($type)); |
83 | - }, 'log.format', $scene . '.log.format'); |
|
83 | + }, 'log.format', $scene.'.log.format'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | { |
92 | 92 | $sync($this->getOutputter('stdout://')); |
93 | 93 | |
94 | - $this->watched[] = $this->cfg->overrides(function (string $dsn) use ($sync) { |
|
94 | + $this->watched[] = $this->cfg->overrides(function(string $dsn) use ($sync) { |
|
95 | 95 | debug() || $sync($this->getOutputter($dsn)); |
96 | - }, 'log.addr', $scene . '.log.addr'); |
|
96 | + }, 'log.addr', $scene.'.log.addr'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function syncReplicator(string $scene, Closure $sync) : void |
104 | 104 | { |
105 | - $this->watched[] = $this->cfg->overrides(function (string $dsn = null) use ($sync) { |
|
105 | + $this->watched[] = $this->cfg->overrides(function(string $dsn = null) use ($sync) { |
|
106 | 106 | debug() || $sync($this->getReplicator($dsn)); |
107 | - }, 'log.replica', $scene . '.log.replica'); |
|
107 | + }, 'log.replica', $scene.'.log.replica'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | if ($this->cmg) { |
144 | 144 | return $this->cmg->hosting( |
145 | 145 | new Address($parsed['host'], $parsed['port'] ?? 80), |
146 | - static function (Address $address) { |
|
146 | + static function(Address $address) { |
|
147 | 147 | return new TCP($address); |
148 | 148 | } |
149 | 149 | ); |
@@ -80,14 +80,14 @@ |
||
80 | 80 | $this->endpoint = $endpoint; |
81 | 81 | |
82 | 82 | $this->events = (new Events()) |
83 | - ->attach(Events\Socket::CONNECTED, function () { |
|
83 | + ->attach(Events\Socket::CONNECTED, function() { |
|
84 | 84 | $this->connected(); |
85 | 85 | }) |
86 | - ->attach(Events\Socket::CLOSED, function () { |
|
86 | + ->attach(Events\Socket::CLOSED, function() { |
|
87 | 87 | $this->connecting(); |
88 | 88 | }) |
89 | - ->attach(Events\Socket::ERROR, function () { |
|
90 | - Timer::after(self::RETRY_WAIT, function () { |
|
89 | + ->attach(Events\Socket::ERROR, function() { |
|
90 | + Timer::after(self::RETRY_WAIT, function() { |
|
91 | 91 | $this->connecting(); |
92 | 92 | }); |
93 | 93 | }) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->cmg = $cmg; |
55 | 55 | $this->recv = $recv; |
56 | 56 | |
57 | - $this->pipe = $cmg->hosting($recv, static function (Address $recv) { |
|
57 | + $this->pipe = $cmg->hosting($recv, static function(Address $recv) { |
|
58 | 58 | return new TCP($recv); |
59 | 59 | }); |
60 | 60 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $buf = ''; |
78 | 78 | |
79 | - $node = $this->env->app() . (($t = $this->env->tagged()) ? sprintf(':%s', $t) : ''); |
|
79 | + $node = $this->env->app().(($t = $this->env->tagged()) ? sprintf(':%s', $t) : ''); |
|
80 | 80 | $stream = $scene; |
81 | 81 | |
82 | 82 | if (!isset($this->assets[$node][$stream])) { |