Skip to content

Commit 8dbf8bb

Browse files
authored
Format code (#5172)
1 parent d3144e5 commit 8dbf8bb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/Context.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212
namespace Hyperf\WebSocketServer;
1313

14+
use Closure;
1415
use Hyperf\Context\Context as CoContext;
1516
use Hyperf\Utils\Arr;
1617

@@ -61,7 +62,7 @@ public static function copy(int $fromFd, array $keys = []): void
6162
self::$container[$fd] = ($keys ? Arr::only($from, $keys) : $from);
6263
}
6364

64-
public static function override(string $id, \Closure $closure)
65+
public static function override(string $id, Closure $closure)
6566
{
6667
$value = null;
6768
if (self::has($id)) {

src/Listener/OnPipeMessageListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Hyperf\WebSocketServer\Sender;
1919
use Hyperf\WebSocketServer\SenderPipeMessage;
2020
use Psr\Container\ContainerInterface;
21+
use Throwable;
2122

2223
class OnPipeMessageListener implements ListenerInterface
2324
{
@@ -48,7 +49,7 @@ public function process(object $event): void
4849
try {
4950
[$fd, $method] = $this->sender->getFdAndMethodFromProxyMethod($message->name, $message->arguments);
5051
$this->sender->proxy($fd, $method, $message->arguments);
51-
} catch (\Throwable $exception) {
52+
} catch (Throwable $exception) {
5253
$formatter = $this->container->get(FormatterInterface::class);
5354
$this->logger->warning($formatter->format($exception));
5455
}

src/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function onMessage($server, $frame): void
203203

204204
try {
205205
$instance->onMessage($server, $frame);
206-
} catch (\Throwable $exception) {
206+
} catch (Throwable $exception) {
207207
$this->logger->error((string) $exception);
208208
}
209209
}
@@ -228,7 +228,7 @@ public function onClose($server, int $fd, int $reactorId): void
228228
if ($instance instanceof OnCloseInterface) {
229229
try {
230230
$instance->onClose($server, $fd, $reactorId);
231-
} catch (\Throwable $exception) {
231+
} catch (Throwable $exception) {
232232
$this->logger->error((string) $exception);
233233
}
234234
}

0 commit comments

Comments
 (0)