This commit is contained in:
xl
2023-05-26 10:26:13 +08:00
parent a1c0da9688
commit fff3211e61
3 changed files with 8 additions and 10 deletions
+6 -6
View File
@@ -928,12 +928,12 @@ if (!function_exists('env')) {
if (!function_exists('config')) {
/**
* @param $key
* @param null $default
* @return array|string|null
*/
function config($key, $default = NULL): null|array|string
/**
* @param $key
* @param null $default
* @return array|string|int|float|bool|null
*/
function config($key, $default = NULL): null|array|string|int|float|bool
{
return make(ConfigProvider::class)->get($key, $default);
}
+1 -1
View File
@@ -31,7 +31,7 @@ class ConfigProvider
{
$keys = explode($key, '.');
$hashMap = $this->hashMap->get(array_unshift($keys));
$hashMap = $this->hashMap->get(array_shift($keys));
if (is_null($hashMap)) {
return $default;
}
+1 -3
View File
@@ -58,9 +58,7 @@ class Redis extends Component
/**
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
* @throws Exception
*/
public function init(): void
{