build(rector): 重构命名空间

Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
This commit is contained in:
李东云
2023-12-18 15:50:42 +08:00
parent e67c7aa2ea
commit 1b4df138a3
3 changed files with 15 additions and 7 deletions

View File

@@ -9,6 +9,9 @@ declare(strict_types=1);
* @contact group@hyperf.io * @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE * @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\Event;
use Hyperf\Server\Server; use Hyperf\Server\Server;
use Swoole\Constant; use Swoole\Constant;
@@ -40,8 +43,8 @@ return [
Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024, Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024,
], ],
'callbacks' => [ 'callbacks' => [
Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'], Event::ON_WORKER_START => [WorkerStartCallback::class, 'onWorkerStart'],
Event::ON_PIPE_MESSAGE => [Hyperf\Framework\Bootstrap\PipeMessageCallback::class, 'onPipeMessage'], Event::ON_PIPE_MESSAGE => [PipeMessageCallback::class, 'onPipeMessage'],
Event::ON_WORKER_EXIT => [Hyperf\Framework\Bootstrap\WorkerExitCallback::class, 'onWorkerExit'], Event::ON_WORKER_EXIT => [WorkerExitCallback::class, 'onWorkerExit'],
], ],
]; ];

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Tests; namespace Tests;
use function Hyperf\Config\config;
use Hyperf\Testing\Client; use Hyperf\Testing\Client;
use Lmc\HttpConstants\Header; use Lmc\HttpConstants\Header;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
@@ -55,7 +56,7 @@ abstract class HttpTestCase extends TestCase
sprintf( sprintf(
'%s:%s', '%s:%s',
$uid, $uid,
md5($uid . \Hyperf\Config\config('common.token.basic.salt')) md5($uid . config('common.token.basic.salt'))
) )
) )
); );

View File

@@ -1,6 +1,10 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
use Swoole\Runtime;
use Hyperf\Di\ClassLoader;
use Hyperf\Contract\ApplicationInterface;
/** /**
* This file is part of Hyperf. * This file is part of Hyperf.
* *
@@ -18,12 +22,12 @@ date_default_timezone_set('Asia/Shanghai');
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1)); ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL); ! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
Swoole\Runtime::enableCoroutine(true); Runtime::enableCoroutine(true);
require BASE_PATH . '/vendor/autoload.php'; require BASE_PATH . '/vendor/autoload.php';
Hyperf\Di\ClassLoader::init(); ClassLoader::init();
$container = require BASE_PATH . '/config/container.php'; $container = require BASE_PATH . '/config/container.php';
$container->get(Hyperf\Contract\ApplicationInterface::class); $container->get(ApplicationInterface::class);