eee
This commit is contained in:
+7
-31
@@ -54,34 +54,6 @@ class OnRequest implements OnRequestInterface
|
|||||||
public ResponseEmitterInterface $responseEmitter;
|
public ResponseEmitterInterface $responseEmitter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Kiri\Router\Request
|
|
||||||
*/
|
|
||||||
#[Container(RequestInterface::class)]
|
|
||||||
public RequestInterface $request;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var ResponseInterface
|
|
||||||
*/
|
|
||||||
#[Container(ResponseInterface::class)]
|
|
||||||
public ResponseInterface $response;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var DataGrip
|
|
||||||
*/
|
|
||||||
#[Container(DataGrip::class)]
|
|
||||||
public DataGrip $dataGrip;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var ContainerInterface
|
|
||||||
*/
|
|
||||||
#[Container(ContainerInterface::class)]
|
|
||||||
public ContainerInterface $container;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ConstrictResponse
|
* @var ConstrictResponse
|
||||||
*/
|
*/
|
||||||
@@ -90,20 +62,24 @@ class OnRequest implements OnRequestInterface
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @param ResponseInterface $response
|
||||||
|
* @param RequestInterface $request
|
||||||
|
* @param ContainerInterface $container
|
||||||
|
* @param DataGrip $dataGrip
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
public function init(): void
|
public function __construct(public ResponseInterface $response, public RequestInterface $request, public ContainerInterface $container,
|
||||||
|
public DataGrip $dataGrip)
|
||||||
{
|
{
|
||||||
|
$this->responseEmitter = $this->response->emmit;
|
||||||
$exception = $this->request->exception;
|
$exception = $this->request->exception;
|
||||||
if (!in_array(ExceptionHandlerInterface::class, class_implements($exception))) {
|
if (!in_array(ExceptionHandlerInterface::class, class_implements($exception))) {
|
||||||
$exception = ExceptionHandlerDispatcher::class;
|
$exception = ExceptionHandlerDispatcher::class;
|
||||||
}
|
}
|
||||||
$this->exception = $this->container->get($exception);
|
$this->exception = $this->container->get($exception);
|
||||||
$this->router = $this->dataGrip->get(ROUTER_TYPE_HTTP);
|
$this->router = $this->dataGrip->get(ROUTER_TYPE_HTTP);
|
||||||
$this->responseEmitter = $this->response->emmit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user