From 576dd6853c0d4fae37be4bc63607c6e40d96eaf2 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 16 Oct 2023 06:59:56 +0700 Subject: [PATCH] [Rector] Enable $rectorConfig->removeUnusedImports() --- rector.php | 1 + system/Router/RouteCollection.php | 1 - system/Session/Session.php | 1 - system/Test/FeatureTestCase.php | 2 -- system/Validation/FileRules.php | 1 - tests/system/Helpers/URLHelper/SiteUrlTest.php | 1 - tests/system/Test/FilterTestTraitTest.php | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) diff --git a/rector.php b/rector.php index c2b76343dfff..c1cd2674548a 100644 --- a/rector.php +++ b/rector.php @@ -112,6 +112,7 @@ // auto import fully qualified class names $rectorConfig->importNames(); + $rectorConfig->removeUnusedImports(); $rectorConfig->rule(UnderscoreToCamelCaseVariableNameRector::class); $rectorConfig->rule(SimplifyUselessVariableRector::class); diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index e484129a77b1..b3bb96e9fa2b 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -19,7 +19,6 @@ use Config\Routing; use Config\Services; use InvalidArgumentException; -use Locale; /** * @todo Implement nested resource routing (See CakePHP) diff --git a/system/Session/Session.php b/system/Session/Session.php index ba4388472c3e..4e4a01581ba2 100644 --- a/system/Session/Session.php +++ b/system/Session/Session.php @@ -13,7 +13,6 @@ use CodeIgniter\Cookie\Cookie; use CodeIgniter\I18n\Time; -use Config\App; use Config\Cookie as CookieConfig; use Config\Services; use Config\Session as SessionConfig; diff --git a/system/Test/FeatureTestCase.php b/system/Test/FeatureTestCase.php index 02835391ca48..3d4cb0f426a0 100644 --- a/system/Test/FeatureTestCase.php +++ b/system/Test/FeatureTestCase.php @@ -15,10 +15,8 @@ use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\Exceptions\RedirectException; use CodeIgniter\HTTP\IncomingRequest; -use CodeIgniter\HTTP\Request; use CodeIgniter\HTTP\URI; use CodeIgniter\HTTP\UserAgent; -use CodeIgniter\Router\RouteCollection; use Config\App; use Config\Services; use Exception; diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index 756c7c7536b6..ce0ed8140d42 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -13,7 +13,6 @@ use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\IncomingRequest; -use CodeIgniter\HTTP\Request; use CodeIgniter\HTTP\RequestInterface; use Config\Mimes; use Config\Services; diff --git a/tests/system/Helpers/URLHelper/SiteUrlTest.php b/tests/system/Helpers/URLHelper/SiteUrlTest.php index 1a03d80f3521..529d1e6872a4 100644 --- a/tests/system/Helpers/URLHelper/SiteUrlTest.php +++ b/tests/system/Helpers/URLHelper/SiteUrlTest.php @@ -15,7 +15,6 @@ use CodeIgniter\Config\Services; use CodeIgniter\HTTP\IncomingRequest; use CodeIgniter\HTTP\SiteURIFactory; -use CodeIgniter\HTTP\URI; use CodeIgniter\HTTP\UserAgent; use CodeIgniter\Superglobals; use CodeIgniter\Test\CIUnitTestCase; diff --git a/tests/system/Test/FilterTestTraitTest.php b/tests/system/Test/FilterTestTraitTest.php index 32ebef106457..e2d5a423637f 100644 --- a/tests/system/Test/FilterTestTraitTest.php +++ b/tests/system/Test/FilterTestTraitTest.php @@ -11,7 +11,6 @@ namespace CodeIgniter\Test; -use CodeIgniter\Filters\Filters; use CodeIgniter\HTTP\RequestInterface; use Tests\Support\Filters\Customfilter;