@@ -47,9 +47,9 @@ public function getDefaultDriver(): ?string
4747 * @param mixed|null $default 默认值
4848 * @return mixed
4949 */
50- public function getConfig (string $ name = null , mixed $ default = null ): mixed
50+ public function getConfig (string $ name = '' , mixed $ default = null ): mixed
5151 {
52- if (! is_null ( $ name) ) {
52+ if ($ name ) {
5353 return config ("think-cache. $ name " , $ default );
5454 }
5555
@@ -63,10 +63,10 @@ public function getConfig(string $name = null, mixed $default = null): mixed
6363 * @param mixed|null $default
6464 * @return mixed
6565 */
66- public function getStoreConfig (string $ store , string $ name = null , mixed $ default = null ): mixed
66+ public function getStoreConfig (string $ store , string $ name = '' , mixed $ default = null ): mixed
6767 {
6868 if ($ config = $ this ->getConfig ("stores. {$ store }" )) {
69- return Arr::get ($ config , $ name , $ default );
69+ return $ name ? Arr::get ($ config , $ name , $ default ) : $ config ;
7070 }
7171
7272 throw new \InvalidArgumentException ("Store [ $ store] not found. " );
@@ -97,7 +97,7 @@ protected function resolveConfig(string $name): mixed
9797 * @return Driver
9898 * @throws ReflectionException
9999 */
100- public function store (string $ name = null ): Driver
100+ public function store (string $ name = '' ): Driver
101101 {
102102 return $ this ->driver ($ name );
103103 }
0 commit comments