Skip to content

Commit

Permalink
add Event BeforeDtoStart
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2066 committed Mar 12, 2024
1 parent 78cbbf2 commit 44d0967
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BeforeServerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Hyperf\Context\ApplicationContext;
use Hyperf\Contract\ConfigInterface;
use Hyperf\DTO\Event\AfterDtoStart;
use Hyperf\DTO\Event\BeforeDtoStart;
use Hyperf\DTO\Router\TcpRouter;
use Hyperf\DTO\Scan\Scan;
use Hyperf\Event\Contract\ListenerInterface;
Expand All @@ -27,6 +28,7 @@ class BeforeServerListener implements ListenerInterface
public function listen(): array
{
return [
BeforeDtoStart::class,
BeforeServerStart::class,
MainCoroutineServerStart::class,
];
Expand Down
13 changes: 13 additions & 0 deletions src/Event/BeforeDtoStart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Hyperf\DTO\Event;

/**
* 主要用于自动化测试时,手动触发DTO
*/
class BeforeDtoStart
{
public function __construct(public string $name = 'http') {}
}

0 comments on commit 44d0967

Please sign in to comment.