This commit is contained in:
xl
2024-08-29 17:01:08 +08:00
parent 337c52c744
commit c435af1156
15 changed files with 61 additions and 167 deletions
+1 -11
View File
@@ -7,22 +7,12 @@ use Kiri\Di\Interface\ResponseEmitterInterface;
use Kiri\Events\EventDispatch;
use Kiri\Events\EventProvider;
use Kiri\Server\Events\OnAfterRequest;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
use ReflectionException;
use SplPriorityQueue;
class SwowHttpResponseEmitter implements ResponseEmitterInterface
{
/**
* @var EventProvider
*/
#[Container(EventProvider::class)]
public EventProvider $provider;
/**
* @var EventDispatch
*/
@@ -48,7 +38,7 @@ class SwowHttpResponseEmitter implements ResponseEmitterInterface
public function init(): void
{
$this->afterRequest = new OnAfterRequest();
$this->events = $this->provider->getListenersForEvent($this->afterRequest);
$this->events = di(EventProvider::class)->getListenersForEvent($this->afterRequest);
}