From ada65d3197425d52a0bbeb61df6c5acce54ecc2d Mon Sep 17 00:00:00 2001 From: Deeka Wong Date: Wed, 26 Apr 2023 11:02:31 +0800 Subject: [PATCH] Instead of classes and functions of `Hyperf\Utils` (#5674) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 李铭昕 <715557344@qq.com> --- composer.json | 1 + publish/redis.php | 2 ++ src/Pool/RedisPool.php | 2 ++ src/RedisFactory.php | 2 ++ tests/RedisConnectionTest.php | 2 +- tests/Stub/ContainerStub.php | 2 ++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 07f5fc2..97fbf51 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "ext-redis": "*", "hyperf/contract": "~3.0.0", "hyperf/pool": "~3.0.0", + "hyperf/support": "~3.0.0", "hyperf/tappable": "~3.0.0", "hyperf/utils": "~3.0.0", "psr/container": "^1.0|^2.0" diff --git a/publish/redis.php b/publish/redis.php index a25a1fb..f380f9e 100644 --- a/publish/redis.php +++ b/publish/redis.php @@ -9,6 +9,8 @@ * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use function Hyperf\Support\env; + return [ 'default' => [ 'host' => env('REDIS_HOST', 'localhost'), diff --git a/src/Pool/RedisPool.php b/src/Pool/RedisPool.php index ed80a66..40b6275 100644 --- a/src/Pool/RedisPool.php +++ b/src/Pool/RedisPool.php @@ -20,6 +20,8 @@ use InvalidArgumentException; use Psr\Container\ContainerInterface; +use function Hyperf\Support\make; + class RedisPool extends Pool { protected array $config; diff --git a/src/RedisFactory.php b/src/RedisFactory.php index 8e99248..fb73a50 100644 --- a/src/RedisFactory.php +++ b/src/RedisFactory.php @@ -14,6 +14,8 @@ use Hyperf\Contract\ConfigInterface; use Hyperf\Redis\Exception\InvalidRedisProxyException; +use function Hyperf\Support\make; + class RedisFactory { /** diff --git a/tests/RedisConnectionTest.php b/tests/RedisConnectionTest.php index 33ee000..db46d38 100644 --- a/tests/RedisConnectionTest.php +++ b/tests/RedisConnectionTest.php @@ -21,7 +21,7 @@ use Hyperf\Pool\Pool; use Hyperf\Pool\PoolOption; use Hyperf\Redis\Frequency; -use Hyperf\Utils\Reflection\ClassInvoker; +use Hyperf\Support\Reflection\ClassInvoker; use HyperfTest\Redis\Stub\RedisConnectionStub; use HyperfTest\Redis\Stub\RedisPoolStub; use Mockery; diff --git a/tests/Stub/ContainerStub.php b/tests/Stub/ContainerStub.php index f73ef69..681487c 100644 --- a/tests/Stub/ContainerStub.php +++ b/tests/Stub/ContainerStub.php @@ -25,6 +25,8 @@ use Hyperf\Redis\Redis; use Mockery; +use function Hyperf\Support\value; + class ContainerStub { public static function mockContainer()