Skip to content

Commit

Permalink
refactor: use config() instead of new keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Aug 16, 2023
1 parent 9e4225b commit b01bb38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/UserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit b01bb38

Please sign in to comment.