Skip to content

Commit b01bb38

Browse files
committed
refactor: use config() instead of new keyword
1 parent 9e4225b commit b01bb38

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎system/Config/Services.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static function cache(?Cache $config = null, bool $getShared = true)
117117
return static::getSharedInstance('cache', $config);
118118
}
119119

120-
$config ??= new Cache();
120+
$config ??= config(Cache::class);
121121

122122
return CacheFactory::getHandler($config);
123123
}

‎system/HTTP/UserAgent.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class UserAgent
102102
*/
103103
public function __construct(?UserAgents $config = null)
104104
{
105-
$this->config = $config ?? new UserAgents();
105+
$this->config = $config ?? config(UserAgents::class);
106106

107107
if (isset($_SERVER['HTTP_USER_AGENT'])) {
108108
$this->agent = trim($_SERVER['HTTP_USER_AGENT']);

0 commit comments

Comments
 (0)