This commit is contained in:
2023-09-15 15:51:20 +08:00
parent 2d00a571d5
commit 77b5168880
2 changed files with 2 additions and 7 deletions
+2 -2
View File
@@ -16,9 +16,9 @@ class NotFoundController extends Controller
public function fail(): ResponseInterface public function fail(): ResponseInterface
{ {
if ($this->request->getMethod() == 'OPTIONS') { 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.");
} }
} }
-5
View File
@@ -80,11 +80,6 @@ class ControllerInterpreter
$reflectionMethod = $reflectionClass->getMethod($reflectionMethod); $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(); $container = \Kiri::getDi();
$parameters = $container->getMethodParams($reflectionMethod); $parameters = $container->getMethodParams($reflectionMethod);