Skip to content

Commit 3889325

Browse files
committed
refactor: by rector
1 parent f4f1370 commit 3889325

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

system/Config/Factories.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,10 @@ public static function getComponentInstances(string $component): array
342342
];
343343
}
344344

345-
$data = [
345+
return [
346346
'basenames' => static::$basenames[$component],
347347
'instances' => self::$instances[$component],
348348
];
349-
350-
return $data;
351349
}
352350

353351
/**
@@ -369,6 +367,6 @@ public static function setComponentInstances(string $component, array $data)
369367
*/
370368
public static function isUpdated(string $component): bool
371369
{
372-
return isset(self::$updated[$component]) ? true : false;
370+
return isset(self::$updated[$component]);
373371
}
374372
}

tests/system/Config/FactoriesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace CodeIgniter\Config;
1313

1414
use CodeIgniter\Test\CIUnitTestCase;
15+
use Config\Database;
1516
use ReflectionClass;
1617
use stdClass;
1718
use Tests\Support\Models\UserModel;
@@ -271,7 +272,7 @@ class_alias(SomeWidget::class, $class);
271272
public function testGetComponentInstances()
272273
{
273274
Factories::config('App');
274-
Factories::config(\Config\Database::class);
275+
Factories::config(Database::class);
275276

276277
$data = Factories::getComponentInstances('config');
277278

0 commit comments

Comments
 (0)