Skip to content

Commit 6bbf117

Browse files
committed
sign commits
1 parent 770351f commit 6bbf117

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

system/Common.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
use CodeIgniter\Cache\CacheInterface;
13+
use CodeIgniter\Config\BaseConfig;
1314
use CodeIgniter\Config\Factories;
1415
use CodeIgniter\Cookie\Cookie;
1516
use CodeIgniter\Cookie\CookieStore;
@@ -47,8 +48,7 @@
4748
*/
4849
function app_timezone(): string
4950
{
50-
/** @var App $config */
51-
$config = config('App');
51+
$config = config(App::class);
5252

5353
return $config->appTimezone;
5454
}
@@ -203,7 +203,11 @@ function command(string $command)
203203
/**
204204
* More simple way of getting config instances from Factories
205205
*
206-
* @return object|null
206+
* @template T of BaseConfig
207+
*
208+
* @param class-string<T> $name
209+
*
210+
* @return T
207211
*/
208212
function config(string $name, bool $getShared = true)
209213
{
@@ -495,7 +499,7 @@ function force_https(int $duration = 31_536_000, ?RequestInterface $request = nu
495499
Services::session(null, true)->regenerate(); // @codeCoverageIgnore
496500
}
497501

498-
$baseURL = config('App')->baseURL;
502+
$baseURL = config(App::class)->baseURL;
499503

500504
if (strpos($baseURL, 'https://') === 0) {
501505
$authority = substr($baseURL, strlen('https://'));
@@ -885,7 +889,7 @@ function redirect(?string $route = null): RedirectResponse
885889
*/
886890
function _solidus(): string
887891
{
888-
if (config('DocTypes')->html5 ?? false) {
892+
if (config(\Config\DocTypes::class)->html5 ?? false) {
889893
return '';
890894
}
891895

@@ -973,10 +977,9 @@ function route_to(string $method, ...$params)
973977
* session()->set('foo', 'bar');
974978
* $foo = session('bar');
975979
*
976-
* @param string $val
980+
* @param string|null $val
977981
*
978982
* @return array|bool|float|int|object|Session|string|null
979-
* @phpstan-return ($val is null ? Session : array|bool|float|int|object|string|null)
980983
*/
981984
function session(?string $val = null)
982985
{
@@ -1064,7 +1067,7 @@ function single_service(string $name, ...$params)
10641067
*/
10651068
function slash_item(string $item): ?string
10661069
{
1067-
$config = config('App');
1070+
$config = config(App::class);
10681071

10691072
if (! property_exists($config, $item)) {
10701073
return null;
@@ -1166,10 +1169,8 @@ function timer(?string $name = null, ?callable $callable = null)
11661169
*/
11671170
function view(string $name, array $data = [], array $options = []): string
11681171
{
1169-
/** @var CodeIgniter\View\View $renderer */
11701172
$renderer = Services::renderer();
11711173

1172-
/** @var \CodeIgniter\Config\View $config */
11731174
$config = config(View::class);
11741175
$saveData = $config->saveData;
11751176

0 commit comments

Comments
 (0)