From f8b557d88a443067a103457f098b32d7e685fe52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 24 Oct 2023 17:22:28 +0800 Subject: [PATCH] eee --- Contract/OnReceiveInterface.php | 14 +++++++------- Handler/OnRequest.php | 1 - Handler/OnServer.php | 4 ---- Handler/OnServerManager.php | 8 ++------ Handler/OnServerWorker.php | 10 ++-------- HotReload.php | 1 - ServerCommand.php | 8 -------- Task/Task.php | 6 ------ 8 files changed, 11 insertions(+), 41 deletions(-) diff --git a/Contract/OnReceiveInterface.php b/Contract/OnReceiveInterface.php index 2e2775e..d623258 100644 --- a/Contract/OnReceiveInterface.php +++ b/Contract/OnReceiveInterface.php @@ -12,13 +12,13 @@ interface OnReceiveInterface { - /** - * @param Server $server - * @param int $fd - * @param int $reactor_id - * @param string $data - * @return void - */ + /** + * @param Server $server + * @param int $fd + * @param int $reactor_id + * @param string $data + * @return bool + */ public function onReceive(Server $server, int $fd, int $reactor_id, string $data): bool; diff --git a/Handler/OnRequest.php b/Handler/OnRequest.php index 95aefb9..c7999f9 100644 --- a/Handler/OnRequest.php +++ b/Handler/OnRequest.php @@ -7,7 +7,6 @@ namespace Kiri\Server\Handler; use Exception; use Kiri; use Kiri\Core\Xml; -use Kiri\Core\Json; use Kiri\Di\Inject\Container; use Kiri\Di\Context; use Kiri\Di\Interface\ResponseEmitterInterface; diff --git a/Handler/OnServer.php b/Handler/OnServer.php index 39e9f3b..6719fed 100644 --- a/Handler/OnServer.php +++ b/Handler/OnServer.php @@ -33,8 +33,6 @@ class OnServer extends Server /** * @param SServer $server * @throws ReflectionException - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface */ public function onStart(SServer $server): void { @@ -48,8 +46,6 @@ class OnServer extends Server /** * @param SServer $server - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws ReflectionException */ public function onBeforeShutdown(SServer $server): void diff --git a/Handler/OnServerManager.php b/Handler/OnServerManager.php index f57c76a..b2fdf56 100644 --- a/Handler/OnServerManager.php +++ b/Handler/OnServerManager.php @@ -3,8 +3,6 @@ namespace Kiri\Server\Handler; use Kiri; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; use ReflectionException; use Kiri\Server\Abstracts\Server; use Kiri\Server\Events\OnManagerStart; @@ -21,8 +19,7 @@ class OnServerManager extends Server /** * @param \Swoole\Server $server - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface|ReflectionException + * @throws ReflectionException */ public function onManagerStart(\Swoole\Server $server): void { @@ -35,8 +32,7 @@ class OnServerManager extends Server /** * @param \Swoole\Server $server * @return void - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface|ReflectionException + * @throws ReflectionException */ public function onManagerStop(\Swoole\Server $server): void { diff --git a/Handler/OnServerWorker.php b/Handler/OnServerWorker.php index fff75f0..3296ff9 100644 --- a/Handler/OnServerWorker.php +++ b/Handler/OnServerWorker.php @@ -32,8 +32,6 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server * @param Server $server * @param int $workerId * @return void - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws Exception */ public function onWorkerStart(Server $server, int $workerId): void @@ -71,8 +69,7 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server /** * @param Server $server * @param int $workerId - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface|ReflectionException + * @throws ReflectionException */ public function onWorkerStop(Server $server, int $workerId): void { @@ -84,8 +81,7 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server /** * @param Server $server * @param int $workerId - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface|ReflectionException + * @throws ReflectionException */ public function onWorkerExit(Server $server, int $workerId): void { @@ -99,8 +95,6 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server * @param int $worker_pid * @param int $exit_code * @param int $signal - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws Exception */ public function onWorkerError(Server $server, int $worker_id, int $worker_pid, int $exit_code, int $signal): void diff --git a/HotReload.php b/HotReload.php index 56a3674..1ebc865 100644 --- a/HotReload.php +++ b/HotReload.php @@ -8,7 +8,6 @@ use Kiri\Di\Context; use Kiri\Router\Router; use Kiri\Server\Abstracts\BaseProcess; use Kiri\Server\Events\OnWorkerStart; -use ReflectionException; use Swoole\Coroutine; use Swoole\Event; use Swoole\Process; diff --git a/ServerCommand.php b/ServerCommand.php index 2bed6a5..e938402 100644 --- a/ServerCommand.php +++ b/ServerCommand.php @@ -10,8 +10,6 @@ use Kiri\Events\EventDispatch; use Kiri\Router\Router; use Kiri\Server\Abstracts\AsyncServer; use Kiri\Server\Events\OnShutdown; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; use ReflectionException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -67,8 +65,6 @@ class ServerCommand extends Command * @param InputInterface $input * @param OutputInterface $output * @return int - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws Exception */ public function execute(InputInterface $input, OutputInterface $output): int @@ -86,8 +82,6 @@ class ServerCommand extends Command /** * @param InputInterface $input * @return int - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws ReflectionException */ protected function restart(InputInterface $input): int @@ -100,8 +94,6 @@ class ServerCommand extends Command /** * @return int - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws ReflectionException * @throws Exception */ diff --git a/Task/Task.php b/Task/Task.php index 2dcb095..5086de9 100644 --- a/Task/Task.php +++ b/Task/Task.php @@ -5,12 +5,8 @@ namespace Kiri\Server\Task; use Kiri; use Kiri\Server\Constant; -use Kiri\Server\ServerInterface; -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; use ReflectionException; use Swoole\Server; -use Kiri\Di\Inject\Container; /** * @@ -40,8 +36,6 @@ class Task * @param int $task_id * @param mixed $data * @return void - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface * @throws ReflectionException */ public function onFinish(Server $server, int $task_id, mixed $data): void