1 | <?php |
||||||
2 | declare (strict_types=1); |
||||||
3 | if (!extension_loaded('swoole')) { |
||||||
4 | dl('swoole.so'); |
||||||
5 | } |
||||||
6 | |||||||
7 | use Swoole\WebSocket\Server; |
||||||
8 | use Swoole\Http\Request; |
||||||
9 | use Swoole\WebSocket\Frame; |
||||||
10 | |||||||
11 | $wbs = new Server("0.0.0.0",8080); |
||||||
12 | $wbs->on('start', function(Server $wbs){ |
||||||
0 ignored issues
–
show
|
|||||||
13 | |||||||
14 | }); |
||||||
15 | |||||||
16 | $wbs->on('open', function(Server $wbs, Request $req){ |
||||||
0 ignored issues
–
show
The parameter
$req is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$wbs is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
17 | |||||||
18 | }); |
||||||
19 | |||||||
20 | $wbs->on('message', function(Server $wbs, Frame $frame){ |
||||||
0 ignored issues
–
show
The parameter
$wbs is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$frame is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
21 | |||||||
22 | }); |
||||||
23 | |||||||
24 | $wbs->on('close', function(Server $server, int $fd){ |
||||||
0 ignored issues
–
show
The parameter
$fd is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$server is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
25 | |||||||
26 | }); |
||||||
27 | |||||||
28 | $wbs->start(); |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.