优化代码

main
gzydong 2021-08-30 22:27:10 +08:00
parent 3c75070234
commit 603f7a8866
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ abstract class AbstractRedis
*/ */
protected function redis() protected function redis()
{ {
return redis(); return di()->get(Redis::class);
} }
/** /**
@ -52,7 +52,7 @@ abstract class AbstractRedis
protected function filter(array $params = []): string protected function filter(array $params = []): string
{ {
foreach ($params as $k => $param) { foreach ($params as $k => $param) {
$params[$k] = trim($param, ':'); $params[$k] = trim((string)$param, ':');
} }
return implode(':', array_filter($params)); return implode(':', array_filter($params));