Skip to content

Commit

Permalink
Merge pull request #7619 from kenjis/refactor-config-classname-4.4
Browse files Browse the repository at this point in the history
[4.4] refactor: use ::class to config() param
  • Loading branch information
kenjis authored Jun 26, 2023
2 parents 37b5c21 + e8be829 commit 7d3b36a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
use Config\Modules;
use Config\Pager as PagerConfig;
use Config\Paths;
use Config\Routing;
use Config\Services as AppServices;
use Config\Session as SessionConfig;
use Config\Toolbar as ToolbarConfig;
Expand Down Expand Up @@ -599,7 +600,7 @@ public static function routes(bool $getShared = true)
return static::getSharedInstance('routes');
}

return new RouteCollection(AppServices::locator(), config(Modules::class), config('Routing'));
return new RouteCollection(AppServices::locator(), config(Modules::class), config(Routing::class));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion system/HotReloader/DirectoryHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace CodeIgniter\HotReloader;

use CodeIgniter\Exceptions\FrameworkException;
use Config\Toolbar;
use FilesystemIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
Expand Down Expand Up @@ -40,7 +41,7 @@ public function hashApp(): array
{
$hashes = [];

$watchedDirectories = config('Toolbar')->watchedDirectories;
$watchedDirectories = config(Toolbar::class)->watchedDirectories;

foreach ($watchedDirectories as $directory) {
if (is_dir(ROOTPATH . $directory)) {
Expand Down
3 changes: 2 additions & 1 deletion system/HotReloader/IteratorFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace CodeIgniter\HotReloader;

use Config\Toolbar;
use RecursiveFilterIterator;
use RecursiveIterator;

Expand All @@ -27,7 +28,7 @@ public function __construct(RecursiveIterator $iterator)
{
parent::__construct($iterator);

$this->watchedExtensions = config('Toolbar')->watchedExtensions;
$this->watchedExtensions = config(Toolbar::class)->watchedExtensions;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions system/Security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ public function __construct(App $config)
}

if ($this->isCSRFCookie()) {
/** @var CookieConfig $cookie */
$cookie = config('Cookie');
$cookie = config(CookieConfig::class);

$this->configureCookie($cookie);
} else {
Expand Down

0 comments on commit 7d3b36a

Please sign in to comment.