From 77b5168880c53af6a458b0c6bdadb59b5d3857a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 15 Sep 2023 15:51:20 +0800 Subject: [PATCH] eee --- src/Base/NotFoundController.php | 4 ++-- src/ControllerInterpreter.php | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Base/NotFoundController.php b/src/Base/NotFoundController.php index e3c2a17..e493379 100644 --- a/src/Base/NotFoundController.php +++ b/src/Base/NotFoundController.php @@ -16,9 +16,9 @@ class NotFoundController extends Controller public function fail(): ResponseInterface { if ($this->request->getMethod() == 'OPTIONS') { - return $this->response->withStatus(200, ""); + return \response()->withStatus(200, ""); } - return $this->response->withStatus(404, "not found page."); + return \response()->withStatus(404, "not found page."); } } diff --git a/src/ControllerInterpreter.php b/src/ControllerInterpreter.php index c7a11dd..87de649 100644 --- a/src/ControllerInterpreter.php +++ b/src/ControllerInterpreter.php @@ -80,11 +80,6 @@ class ControllerInterpreter $reflectionMethod = $reflectionClass->getMethod($reflectionMethod); } - $returnType = $reflectionMethod->getReturnType(); - if (method_exists($returnType, 'getName') && $returnType->getName() !== 'Psr\Http\Message\ResponseInterface') { - die('Request Handler<' . $class::class . '::' . $reflectionMethod->getName() . '> returns must implements on Psr\Http\Message\ResponseInterface'); - } - $container = \Kiri::getDi(); $parameters = $container->getMethodParams($reflectionMethod);