From 562ddf2e89ff28281dec57194df8040420ec6f90 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Thu, 12 Dec 2024 00:07:24 +0800 Subject: [PATCH] refactor: rename `controller` to `Controller` --- phpstan-baseline.php | 6 ------ tests/system/Router/RouteCollectionTest.php | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index ef6bcd43f8d0..45723bc48086 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -16573,12 +16573,6 @@ 'count' => 2, 'path' => __DIR__ . '/tests/system/Router/RouteCollectionTest.php', ]; -$ignoreErrors[] = [ - // identifier: class.nameCase - 'message' => '#^Class CodeIgniter\\\\Controller referenced with incorrect case\\: CodeIgniter\\\\controller\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/tests/system/Router/RouteCollectionTest.php', -]; $ignoreErrors[] = [ // identifier: missingType.return 'message' => '#^Method CodeIgniter\\\\Router\\\\RouteCollectionTest\\:\\:getCollector\\(\\) has no return type specified\\.$#', diff --git a/tests/system/Router/RouteCollectionTest.php b/tests/system/Router/RouteCollectionTest.php index 5e398cfdf2a3..ddee083b3713 100644 --- a/tests/system/Router/RouteCollectionTest.php +++ b/tests/system/Router/RouteCollectionTest.php @@ -14,7 +14,7 @@ namespace CodeIgniter\Router; use App\Controllers\Product; -use CodeIgniter\controller; +use CodeIgniter\Controller; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\Method; use CodeIgniter\Test\CIUnitTestCase; @@ -243,10 +243,10 @@ public function testAddRecognizesCustomNamespaces(): void $routes = $this->getCollector(); $routes->setDefaultNamespace('\CodeIgniter'); - $routes->add('home', 'controller'); + $routes->add('home', 'Controller'); $expects = [ - 'home' => '\\' . controller::class, + 'home' => '\\' . Controller::class, ]; $routes = $routes->getRoutes();