Files
kiri-router/src/Base/NotFoundController.php
T

25 lines
444 B
PHP
Raw Normal View History

2023-04-15 23:29:27 +08:00
<?php
2023-04-16 01:24:30 +08:00
declare(strict_types=1);
2023-04-15 23:29:27 +08:00
2023-04-15 23:31:16 +08:00
namespace Kiri\Router\Base;
2023-04-15 23:29:27 +08:00
2023-04-16 01:24:30 +08:00
use Psr\Http\Message\ResponseInterface;
2023-04-15 23:29:27 +08:00
class NotFoundController extends Controller
{
2023-09-15 09:13:59 +08:00
/**
* @return ResponseInterface
*/
public function fail(): ResponseInterface
{
if ($this->request->getMethod() == 'OPTIONS') {
2023-09-15 15:51:20 +08:00
return \response()->withStatus(200, "");
2023-09-15 09:13:59 +08:00
}
2023-09-15 15:51:20 +08:00
return \response()->withStatus(404, "not found page.");
2023-09-15 09:13:59 +08:00
}
2023-04-15 23:29:27 +08:00
}