diff --git a/Task/Task.php b/Task/Task.php index 386d17b..f77e633 100644 --- a/Task/Task.php +++ b/Task/Task.php @@ -10,7 +10,7 @@ use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use ReflectionException; use Swoole\Server; - +use Kiri\Di\Inject\Container; /** * @@ -21,19 +21,10 @@ class Task implements TaskInterface /** * @var ServerInterface */ + #[Container(ServerInterface::class)] public ServerInterface $server; - /** - * @return void - * @throws ReflectionException - */ - public function init(): void - { - $this->server = Kiri::getDi()->get(ServerInterface::class); - } - - /** * @param Server $server * @return void