These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace CapMousse\ReactRestify; |
||
4 | |||
5 | use React\EventLoop\Factory; |
||
6 | use React\Socket\Server as SocketServer; |
||
7 | use React\Http\Server as HttpServer; |
||
8 | |||
9 | class Runner |
||
10 | { |
||
11 | private $app; |
||
12 | |||
13 | public function __construct($app) |
||
14 | { |
||
15 | $this->app = $app; |
||
16 | } |
||
17 | |||
18 | public function listen($port, $host = '127.0.0.1') |
||
0 ignored issues
–
show
|
|||
19 | { |
||
20 | $loop = Factory::create(); |
||
21 | $this->register($loop); |
||
0 ignored issues
–
show
|
|||
22 | $loop->run(); |
||
23 | } |
||
24 | |||
25 | public function register($loop, $port, $host = '127.0.0.1') |
||
26 | { |
||
27 | $socket = new SocketServer($loop); |
||
28 | $http = new HttpServer($socket); |
||
29 | |||
30 | $http->on('request', $this->app); |
||
31 | echo("Server running on {$host}:{$port}\n"); |
||
32 | |||
33 | $socket->listen($port, $host); |
||
34 | } |
||
35 | } |
||
36 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.