walkor / GatewayWorker

Distributed realtime messaging framework based on workerman.
MIT License
1.01k stars 294 forks source link

Gateway.php 326行代码问题 #80

Closed twomiao closed 2 years ago

twomiao commented 2 years ago

Gateway进程代码: if ($connection->protocol === '\Workerman\Protocols\Websocket' || $connection->protocol === 'Workerman\Protocols\Websocket') {

问题: 这两个条件写一个就好了,完全重复了呢。

twomiao commented 2 years ago

Gateway进程代码: if ($connection->protocol === '\Workerman\Protocols\Websocket' || $connection->protocol === 'Workerman\Protocols\Websocket') {

问题: 这两个条件写一个就好了,完全重复了呢。

发现不同之处了。

xpader commented 2 years ago

感觉 ltrim($connection->protocol, '\\') === 'Workerman\Protocols\Websocket' 是不是更好一点?