feat: make Redis Adapter can be extended#121
feat: make Redis Adapter can be extended#121minororange wants to merge 1 commit intoPromPHP:mainfrom
Conversation
Signed-off-by: yangchenzhuo <yangchenzhuo@icsoc.net>
| * @throws StorageException|\RedisException | ||
| */ | ||
| public static function fromExistingConnection(\Redis $redis): self | ||
| public static function fromExistingConnection($redis): self |
There was a problem hiding this comment.
Why did you remove the explicit type here?
There was a problem hiding this comment.
yes, in Hyperf program,Redis instance is not \Redis,but functions are same.
There was a problem hiding this comment.
By looking at the documentation it states hyperf returns a proxy object to \Redis: https://hyperf.wiki/3.1/#/en/redis?id=usage
Looks like the implementation, is still typeable by using \Hyperf\Redis\Redis. Would you mind adding that type side-by-side \Redis|\Hyperf\Redis\Redis?
Union types where added in php 8.0, this library still supports 7.2. @LKaemmerling do you mind dropping support for outdated and unmaintained php versions, too? I'd like to create a PR right away.
LKaemmerling
left a comment
There was a problem hiding this comment.
Hey, thank you for your contribution. I have one small suggested change/question about a change!
redis connection instance can be custom made,such as Swoole program
see: https://github.com/hyperf/metric/blob/master/src/Adapter/Prometheus/Redis.php