fix: replace cli with CLI

This commit is contained in:
kenjis 2023-11-20 12:02:33 +09:00
parent 9b07cb5dd6
commit 4df364bd5d
No known key found for this signature in database
GPG Key ID: BD254878922AF198
3 changed files with 3 additions and 3 deletions

View File

@ -453,7 +453,7 @@ class CodeIgniter
*/
protected function handleRequest(?RouteCollectionInterface $routes, Cache $cacheConfig, bool $returnResponse = false)
{
if ($this->request instanceof IncomingRequest && strtolower($this->request->getMethod()) === 'cli') {
if ($this->request instanceof IncomingRequest && $this->request->getMethod() === 'CLI') {
return $this->response->setStatusCode(405)->setBody('Method Not Allowed');
}

View File

@ -120,7 +120,7 @@ final class AutoRouter implements AutoRouterInterface
}
// Ensure routes registered via $routes->cli() are not accessible via web.
if ($this->httpVerb !== 'cli') {
if ($this->httpVerb !== 'CLI') {
$controller = '\\' . $this->defaultNamespace;
$controller .= $this->directory ? str_replace('/', '\\', $this->directory) : '';

View File

@ -137,7 +137,7 @@ class Router implements RouterInterface
);
} else {
$this->autoRouter = new AutoRouter(
$this->collection->getRoutes('cli', false), // @phpstan-ignore-line
$this->collection->getRoutes('CLI', false), // @phpstan-ignore-line
$this->collection->getDefaultNamespace(),
$this->collection->getDefaultController(),
$this->collection->getDefaultMethod(),