-
Notifications
You must be signed in to change notification settings - Fork 1.9k
refactor: remove Cookie config items in Config\App #7011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cookie::setDefaults(config('Cookie')); | ||
|
||
/** @var CookieConfig $cookie */ | ||
$cookie = config('Cookie'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenjis, is there a special reason why you didn't write as below?
$cookie = config(Cookie::class);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it is convention.
But there are a few lines using ::class
.
Targets
Occurrences of ' config(' in Directory /Users/kenji/work/codeigniter/official/CodeIgniter4/system
Found Occurrences in Directory /Users/kenji/work/codeigniter/official/CodeIgniter4/system
BaseCommand.php
$config = config('Exceptions');
BaseConfig.php
static::$moduleConfig = config('Modules');
BaseHandler.php
$reserved = config('Cache')->reservedCharacters ?? self::RESERVED_CHARACTERS;
BaseHandler.php
$config ??= config('Encryption');
BaseHandler.php
$session = config('Session');
$cookie = config('Cookie');
BaseService.php
$config = config('Modules');
$config = config('Modules');
CIUnitTestCase.php
$config = config('App');
ClearCache.php
$config = config('Cache');
CodeIgniter.php
$config = config(KintConfig::class);
$multipleFiltersEnabled = config('Feature')->multipleFilters ?? false;
$multipleFiltersEnabled = config('Feature')->multipleFilters ?? false;
Common.php
$config = config('App');
function config(string $name, bool $getShared = true)
$baseURL = config('App')->baseURL;
$config = config('App');
$config = config(View::class);
Config.php
$dbConfig = config('Database');
$config = config('Database');
Config.php
$config = config('App');
ContentSecurityPolicy.php
$appConfig = config('App');
Controller.php
$validation = config('Validation');
ControllerTester.php
$this->appConfig = config('App');
ControllerTestTrait.php
$this->appConfig = config('App');
cookie_helper.php
$cookie = config('Cookie');
CreateDatabase.php
$config = config('Database');
CURLRequest.php
$configCURLRequest = config('CURLRequest');
Database.php
$config = config('Toolbar');
DatabaseHandler.php
$session = config('Session');
$this->DBGroup = $session->DBGroup ?? config(Database::class)->defaultGroup;
$this->DBGroup = $config->sessionDBGroup ?? config(Database::class)->defaultGroup;
Events.php
$config = config('Modules');
Fabricator.php
$locale = config('App')->defaultLocale;
Factories.php
* @method static BaseConfig|null config(...$arguments)
: config('Factory')->{$component} ?? [];
FeatureTestCase.php
$config = config('App');
FeatureTestTrait.php
$config = config(App::class);
FilterCollector.php
$config = config('Filters');
FilterFinder.php
$multipleFiltersEnabled = config('Feature')->multipleFilters ?? false;
Filters.php
$this->modules = $modules ?? config('Modules');
FilterTestTrait.php
$this->filtersConfig ??= config('Filters');
form_helper.php
$config = config('App');
$config = config('Validation');
$config = config('Validation');
InfoCache.php
$config = config('Cache');
MemcachedHandler.php
$session = config('Session');
Migration.php
$this->forge = $forge ?? Database::forge($this->DBGroup ?? config('Database')->defaultGroup);
MigrationGenerator.php
$data['DBDriver'] = config('Database')->{$data['DBGroup']}['DBDriver'];
$config = config('App');
$session = config('Session');
MigrationRunner.php
$config = config('Database');
$group = $instance->getDBGroup() ?? config('Database')->defaultGroup;
Publisher.php
$this->restrictions = config('Publisher')->restrictions;
RedisHandler.php
$session = config('Session');
RequestTrait.php
$proxyIPs = $this->proxyIPs ?? config('App')->proxyIPs;
Response.php
$cookie = config('Cookie');
ResponseTrait.php
$cookieConfig = config('Cookie');
RouteCollection.php
$config = config('App');
Router.php
$autoRoutesImproved = config('Feature')->autoRoutesImproved ?? false;
$multipleFiltersEnabled = config('Feature')->multipleFilters ?? false;
&& ! in_array($matched['locale'], config('App')->supportedLocales, true)) {
Routes.php
$autoRoutesImproved = config('Feature')->autoRoutesImproved ?? false;
Security.php
$security = config('Security');
$cookie = config('Cookie');
Services.php
$config ??= config('App');
$config ??= config('App');
$config ??= config('ContentSecurityPolicy');
$config ??= config('App');
$config = config('Email');
$config ??= config('Encryption');
$config ??= config('Exceptions');
$config ??= config('Filters');
$config ??= config('Format');
$config ??= config('Honeypot');
$config ??= config('Images');
$config ??= config('Migrations');
$config ??= config('Pager');
$viewPath = $viewPath ?: config('Paths')->viewDirectory;
$config ??= config('View');
$viewPath = $viewPath ?: config('Paths')->viewDirectory;
$config ??= config('View');
$config ??= config('App');
$config ??= config('App');
$config ??= config('App');
return new RouteCollection(AppServices::locator(), config('Modules'));
$config ??= config('App');
$config ??= config('App');
$sessionConfig = config('Session');
$DBGroup = $sessionConfig->DBGroup ?? $config->sessionDBGroup ?? config(Database::class)->defaultGroup;
$config ??= config('Toolbar');
$config ??= config('Validation');
Session.php
$session = config('Session');
$cookie = config('Cookie');
SessionMigrationGenerator.php
$data['matchIP'] = config('App')->sessionMatchIP ?? false;
URI.php
$config = config('App');
url_helper.php
$config ??= config('App');
$config = clone config('App');
$config = $altConfig ?? config('App');
$config = $altConfig ?? config('App');
$config = $altConfig ?? config('App');
View.php
$toolbarCollectors = config(Toolbar::class)->collectors;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with the change to use ::class
.
Description
See #7000 (comment)
Checklist: