<?php declare(strict_types=1); /** * This file is part of Hyperf. * * @link https://www.hyperf.io * @document https://hyperf.wiki * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ namespace App\Service; use Hyperf\Di\Annotation\Inject; use Psr\Container\ContainerInterface; abstract class RedisInterface { protected $redis; #[Inject] protected ContainerInterface $container; public function __construct() { /** * 生成图片验证码 * @return string * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface * @throws \RedisException */ $this->redis = $this->container->get(\Hyperf\Redis\Redis::class); } }