qqq
This commit is contained in:
+2
-11
@@ -10,7 +10,7 @@ use Psr\Container\ContainerExceptionInterface;
|
|||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
use Swoole\Server;
|
use Swoole\Server;
|
||||||
|
use Kiri\Di\Inject\Container;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -21,19 +21,10 @@ class Task implements TaskInterface
|
|||||||
/**
|
/**
|
||||||
* @var ServerInterface
|
* @var ServerInterface
|
||||||
*/
|
*/
|
||||||
|
#[Container(ServerInterface::class)]
|
||||||
public ServerInterface $server;
|
public ServerInterface $server;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return void
|
|
||||||
* @throws ReflectionException
|
|
||||||
*/
|
|
||||||
public function init(): void
|
|
||||||
{
|
|
||||||
$this->server = Kiri::getDi()->get(ServerInterface::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Server $server
|
* @param Server $server
|
||||||
* @return void
|
* @return void
|
||||||
|
|||||||
Reference in New Issue
Block a user