Skip to content

Commit

Permalink
composer analyse
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2066 committed Nov 22, 2024
1 parent 43e9557 commit e72f0f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
excludes_analyse:
- 'src/Router/TcpRouter.php'
- 'src/Router/JsonRpcHttpRouter.php'
- 'src/Router/JsonRpcTcpRouter.php'
- 'src/Scan/PropertyEnum.php'
- 'src/JsonMapper.php'
- 'src/Serializer/ObjectDtoNormalizer.php'
Expand Down
6 changes: 2 additions & 4 deletions src/BeforeServerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use Hyperf\Framework\Event\BeforeServerStart;
use Hyperf\HttpServer\Router\DispatcherFactory;
use Hyperf\HttpServer\Router\Handler;
use Hyperf\JsonRpc\HttpServer;
use Hyperf\JsonRpc\TcpServer;
use Hyperf\Server\Event\MainCoroutineServerStart;
use Psr\EventDispatcher\EventDispatcherInterface;
use RuntimeException;
Expand Down Expand Up @@ -53,15 +51,15 @@ public function process(object $event): void
$scanAnnotation = $container->get(Scan::class);
$serverConfig = collect($config->get('server.servers'))->where('name', $serverName)->first();

if (($serverConfig['callbacks']['receive'][0] ?? '') == TcpServer::class) {
if (($serverConfig['callbacks']['receive'][0] ?? '') == 'Hyperf\JsonRpc\TcpServer') {
try {
$tcpRouter = $container->get(JsonRpcTcpRouter::class);
$router = $tcpRouter->getRouter($serverName);
} catch (Throwable $throwable) {
$logger->warning($throwable);
return;
}
} elseif (($serverConfig['callbacks']['request'][0] ?? '') == HttpServer::class) {
} elseif (($serverConfig['callbacks']['request'][0] ?? '') == 'Hyperf\JsonRpc\HttpServer') {
try {
$tcpRouter = $container->get(JsonRpcHttpRouter::class);
$router = $tcpRouter->getRouter($serverName);
Expand Down

0 comments on commit e72f0f8

Please sign in to comment.