Files
kiri-router/src/Base/NotFoundController.php
T
2023-09-15 15:58:24 +08:00

26 lines
478 B
PHP

<?php
declare(strict_types=1);
namespace Kiri\Router\Base;
use Psr\Http\Message\ResponseInterface;
class NotFoundController extends Controller
{
/**
* @return ResponseInterface
*/
public function fail(): ResponseInterface
{
if ($this->request->getMethod() == 'OPTIONS') {
return \response()->withStatus(200, "empty content");
} else {
return \response()->withStatus(404, "not found page.");
}
}
}