Issues (49)

src/swoole.php (10 issues)

1
<?php
2
declare (strict_types=1);
3
if (!extension_loaded('swoole')) {
4
    dl('swoole.so');
5
}
6
7
use Swoole\WebSocket\Server;
0 ignored issues
show
The type Swoole\WebSocket\Server was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Swoole\Http\Request;
0 ignored issues
show
The type Swoole\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Swoole\WebSocket\Frame;
0 ignored issues
show
The type Swoole\WebSocket\Frame was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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();