Skip to content

Commit ffe1ad4

Browse files
committed
clean up config, re-run rector, and set alias to Config\ClassName when lastname is exists in use statements
1 parent 511286b commit ffe1ad4

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

rector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2929
use Rector\Config\RectorConfig;
3030
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
31-
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
3231
use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector;
3332
use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector;
3433
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
@@ -80,9 +79,6 @@
8079
JsonThrowOnErrorRector::class,
8180
StringifyStrNeedlesRector::class,
8281

83-
// requires php 8
84-
RemoveUnusedPromotedPropertyRector::class,
85-
8682
RemoveUnusedPrivateMethodRector::class => [
8783
// private method called via getPrivateMethodInvoker
8884
__DIR__ . '/tests/system/Test/ReflectionHelperTest.php',

system/CodeIgniter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use CodeIgniter\Router\Router;
3030
use Config\App;
3131
use Config\Cache;
32+
use Config\Kint as KintConfig;
3233
use Config\Services;
3334
use Exception;
3435
use Kint;
@@ -258,7 +259,7 @@ protected function initializeKint()
258259
/**
259260
* Config\Kint
260261
*/
261-
$config = config('Config\Kint');
262+
$config = config(KintConfig::class);
262263

263264
Kint::$depth_limit = $config->maxDepth;
264265
Kint::$display_called_from = $config->displayCalledFrom;

system/Test/Mock/MockLogger.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace CodeIgniter\Test\Mock;
1313

14+
use Tests\Support\Log\Handlers\TestHandler;
15+
1416
class MockLogger
1517
{
1618
/*
@@ -81,7 +83,7 @@ class MockLogger
8183
*/
8284
public $handlers = [
8385
// File Handler
84-
'Tests\Support\Log\Handlers\TestHandler' => [
86+
TestHandler::class => [
8587
// The log levels that this handler will handle.
8688
'handles' => [
8789
'critical',

system/Test/bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Config\Autoload;
1616
use Config\Modules;
1717
use Config\Paths;
18+
use Config\Services as ServicesConfig;
1819

1920
error_reporting(E_ALL);
2021
ini_set('display_errors', '1');
@@ -78,7 +79,7 @@
7879

7980
// Use Config\Services as CodeIgniter\Services
8081
if (! class_exists('CodeIgniter\Services', false)) {
81-
class_alias('Config\Services', 'CodeIgniter\Services');
82+
class_alias(ServicesConfig::class, 'CodeIgniter\Services');
8283
}
8384

8485
// Initialize and register the loader with the SPL autoloader stack.

system/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
* files can use the path constants.
9090
*/
9191

92-
if (! class_exists('Config\Autoload', false)) {
92+
if (! class_exists(Autoload::class, false)) {
9393
require_once SYSTEMPATH . 'Config/AutoloadConfig.php';
9494
require_once APPPATH . 'Config/Autoload.php';
9595
require_once SYSTEMPATH . 'Modules/Modules.php';
@@ -103,7 +103,7 @@
103103

104104
// Use Config\Services as CodeIgniter\Services
105105
if (! class_exists('CodeIgniter\Services', false)) {
106-
class_alias('Config\Services', 'CodeIgniter\Services');
106+
class_alias(Services::class, 'CodeIgniter\Services');
107107
}
108108

109109
// Initialize and register the loader with the SPL autoloader stack.

0 commit comments

Comments
 (0)