diff --git a/system/Common.php b/system/Common.php index bdc937af2aa7..18ea76d14e14 100644 --- a/system/Common.php +++ b/system/Common.php @@ -10,7 +10,6 @@ */ use CodeIgniter\Cache\CacheInterface; -use CodeIgniter\Config\BaseConfig; use CodeIgniter\Config\Factories; use CodeIgniter\Cookie\Cookie; use CodeIgniter\Cookie\CookieStore; @@ -27,7 +26,6 @@ use CodeIgniter\HTTP\Response; use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\URI; -use CodeIgniter\Model; use CodeIgniter\Session\Session; use CodeIgniter\Test\TestLogger; use Config\App; @@ -202,16 +200,15 @@ function command(string $command) if (! function_exists('config')) { /** - * More simple way of getting config instances from Factories + * Simpler way of getting config instances from Factories * - * @template ConfigTemplate of BaseConfig + * @template T of object * - * @param class-string|string $name + * @param class-string|non-empty-string $name * - * @return ConfigTemplate|null - * @phpstan-return ($name is class-string ? ConfigTemplate : object|null) + * @phpstan-return ($name is class-string ? T : null) */ - function config(string $name, bool $getShared = true) + function config(string $name, bool $getShared = true): ?object { return Factories::config($name, ['getShared' => $getShared]); } @@ -811,16 +808,15 @@ function log_message(string $level, string $message, array $context = []) if (! function_exists('model')) { /** - * More simple way of getting model instances from Factories + * Simpler way of getting model instances from Factories * - * @template ModelTemplate of Model + * @template T of object * - * @param class-string|string $name + * @param class-string|non-empty-string $name * - * @return ModelTemplate|null - * @phpstan-return ($name is class-string ? ModelTemplate : object|null) + * @phpstan-return ($name is class-string ? T : null) */ - function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null) + function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null): ?object { return Factories::models($name, ['getShared' => $getShared], $conn); } diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index 17e67aa8eb94..f00ad09bd122 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -365,7 +365,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r return; } - $toolbar = Services::toolbar(config(self::class)); + $toolbar = Services::toolbar(config(ToolbarConfig::class)); $stats = $app->getPerformanceStats(); $data = $toolbar->run( $stats['startTime'],