From 1b4df138a3d1d7795fe49af81aab060150d41533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=B8=9C=E4=BA=91?= Date: Mon, 18 Dec 2023 15:50:42 +0800 Subject: [PATCH] =?UTF-8?q?build(rector):=20=E9=87=8D=E6=9E=84=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李东云 --- config/autoload/server.php | 9 ++++++--- tests/HttpTestCase.php | 3 ++- tests/bootstrap.php | 10 +++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/config/autoload/server.php b/config/autoload/server.php index 0b66401..87c5717 100644 --- a/config/autoload/server.php +++ b/config/autoload/server.php @@ -9,6 +9,9 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Framework\Bootstrap\WorkerStartCallback; +use Hyperf\Framework\Bootstrap\PipeMessageCallback; +use Hyperf\Framework\Bootstrap\WorkerExitCallback; use Hyperf\Server\Event; use Hyperf\Server\Server; use Swoole\Constant; @@ -40,8 +43,8 @@ return [ Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024, ], 'callbacks' => [ - Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'], - Event::ON_PIPE_MESSAGE => [Hyperf\Framework\Bootstrap\PipeMessageCallback::class, 'onPipeMessage'], - Event::ON_WORKER_EXIT => [Hyperf\Framework\Bootstrap\WorkerExitCallback::class, 'onWorkerExit'], + Event::ON_WORKER_START => [WorkerStartCallback::class, 'onWorkerStart'], + Event::ON_PIPE_MESSAGE => [PipeMessageCallback::class, 'onPipeMessage'], + Event::ON_WORKER_EXIT => [WorkerExitCallback::class, 'onWorkerExit'], ], ]; diff --git a/tests/HttpTestCase.php b/tests/HttpTestCase.php index d38358a..d1cdb81 100644 --- a/tests/HttpTestCase.php +++ b/tests/HttpTestCase.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Tests; +use function Hyperf\Config\config; use Hyperf\Testing\Client; use Lmc\HttpConstants\Header; use PHPUnit\Framework\TestCase; @@ -55,7 +56,7 @@ abstract class HttpTestCase extends TestCase sprintf( '%s:%s', $uid, - md5($uid . \Hyperf\Config\config('common.token.basic.salt')) + md5($uid . config('common.token.basic.salt')) ) ) ); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 8396ecb..fe158b5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,10 @@ get(Hyperf\Contract\ApplicationInterface::class); +$container->get(ApplicationInterface::class);