diff --git a/function.php b/function.php index 18966543..4e833c02 100644 --- a/function.php +++ b/function.php @@ -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); } diff --git a/kiri-engine/Config/ConfigProvider.php b/kiri-engine/Config/ConfigProvider.php index de7544a8..0fe4ab32 100644 --- a/kiri-engine/Config/ConfigProvider.php +++ b/kiri-engine/Config/ConfigProvider.php @@ -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; } diff --git a/kiri-engine/Redis/Redis.php b/kiri-engine/Redis/Redis.php index fef00cf2..59a236dd 100644 --- a/kiri-engine/Redis/Redis.php +++ b/kiri-engine/Redis/Redis.php @@ -58,9 +58,7 @@ class Redis extends Component /** * @return void - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface - * @throws Exception + * @throws Exception */ public function init(): void {