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')) { if (!function_exists('config')) {
/** /**
* @param $key * @param $key
* @param null $default * @param null $default
* @return array|string|null * @return array|string|int|float|bool|null
*/ */
function config($key, $default = NULL): null|array|string function config($key, $default = NULL): null|array|string|int|float|bool
{ {
return make(ConfigProvider::class)->get($key, $default); return make(ConfigProvider::class)->get($key, $default);
} }
+1 -1
View File
@@ -31,7 +31,7 @@ class ConfigProvider
{ {
$keys = explode($key, '.'); $keys = explode($key, '.');
$hashMap = $this->hashMap->get(array_unshift($keys)); $hashMap = $this->hashMap->get(array_shift($keys));
if (is_null($hashMap)) { if (is_null($hashMap)) {
return $default; return $default;
} }
+1 -3
View File
@@ -58,9 +58,7 @@ class Redis extends Component
/** /**
* @return void * @return void
* @throws ContainerExceptionInterface * @throws Exception
* @throws NotFoundExceptionInterface
* @throws Exception
*/ */
public function init(): void public function init(): void
{ {