Issues (49)

src/swoole.php (7 issues)

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
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 ignore-unused  annotation

12
$wbs->on('start', function(/** @scrutinizer ignore-unused */ Server $wbs){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

16
$wbs->on('open', function(Server $wbs, /** @scrutinizer ignore-unused */ Request $req){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

16
$wbs->on('open', function(/** @scrutinizer ignore-unused */ Server $wbs, Request $req){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

20
$wbs->on('message', function(/** @scrutinizer ignore-unused */ Server $wbs, Frame $frame){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

20
$wbs->on('message', function(Server $wbs, /** @scrutinizer ignore-unused */ Frame $frame){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

24
$wbs->on('close', function(Server $server, /** @scrutinizer ignore-unused */ int $fd){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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 ignore-unused  annotation

24
$wbs->on('close', function(/** @scrutinizer ignore-unused */ Server $server, int $fd){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    
26
});
27
28
$wbs->start();