diff --git a/system/Config/Services.php b/system/Config/Services.php index ffca4fa804ff..6bd16cc30213 100644 --- a/system/Config/Services.php +++ b/system/Config/Services.php @@ -117,7 +117,7 @@ public static function cache(?Cache $config = null, bool $getShared = true) return static::getSharedInstance('cache', $config); } - $config ??= new Cache(); + $config ??= config(Cache::class); return CacheFactory::getHandler($config); } diff --git a/system/HTTP/UserAgent.php b/system/HTTP/UserAgent.php index 4b579229d88f..1ccc2109c119 100644 --- a/system/HTTP/UserAgent.php +++ b/system/HTTP/UserAgent.php @@ -102,7 +102,7 @@ class UserAgent */ public function __construct(?UserAgents $config = null) { - $this->config = $config ?? new UserAgents(); + $this->config = $config ?? config(UserAgents::class); if (isset($_SERVER['HTTP_USER_AGENT'])) { $this->agent = trim($_SERVER['HTTP_USER_AGENT']);