This commit is contained in:
2023-04-16 02:41:03 +08:00
parent af9a14dfdc
commit d3897d3337
2 changed files with 9 additions and 18 deletions
+3 -8
View File
@@ -2,6 +2,7 @@
namespace Kiri\Server\Handler; namespace Kiri\Server\Handler;
use Kiri\Di\Inject\Container;
use Kiri\Events\EventDispatch; use Kiri\Events\EventDispatch;
use Kiri\Exception\ConfigException; use Kiri\Exception\ConfigException;
use Kiri\Server\Events\OnAfterReload; use Kiri\Server\Events\OnAfterReload;
@@ -24,14 +25,8 @@ class OnServer extends Server
{ {
/** #[Container(EventDispatch::class)]
* @param EventDispatch $dispatch public EventDispatch $dispatch;
* @throws \Exception
*/
public function __construct(public EventDispatch $dispatch)
{
parent::__construct();
}
/** /**
+6 -10
View File
@@ -3,6 +3,7 @@
namespace Kiri\Server\Handler; namespace Kiri\Server\Handler;
use Kiri; use Kiri;
use Kiri\Di\Inject\Container;
use Kiri\Events\EventDispatch; use Kiri\Events\EventDispatch;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
@@ -20,20 +21,16 @@ use Kiri\Server\Events\OnManagerStop;
class OnServerManager extends Server class OnServerManager extends Server
{ {
/** #[Container(EventDispatch::class)]
* @param EventDispatch $dispatch public EventDispatch $dispatch;
* @throws \Exception
*/
public function __construct(public EventDispatch $dispatch)
{
parent::__construct();
}
/** /**
* @param \Swoole\Server $server * @param \Swoole\Server $server
* @throws ConfigException * @throws ConfigException
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface|ReflectionException * @throws NotFoundExceptionInterface
*/ */
public function onManagerStart(\Swoole\Server $server) public function onManagerStart(\Swoole\Server $server)
{ {
@@ -48,7 +45,6 @@ class OnServerManager extends Server
* @return void * @return void
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
* @throws ReflectionException
*/ */
public function onManagerStop(\Swoole\Server $server): void public function onManagerStop(\Swoole\Server $server): void
{ {