for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Antidot\React\Socket;
use Ratchet\Http\HttpServer;
use Ratchet\Server\IoServer;
use Ratchet\Wamp\WampServer;
use Ratchet\WebSocket\WsServer;
use React\EventLoop\Factory;
class Server
{
public function __invoke(array $config): void
$loop = Factory::create();
$application = new Application();
$loop->addTimer(0.001, function($timer) use ($config) {
$timer
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$loop->addTimer(0.001, function(/** @scrutinizer ignore-unused */ $timer) use ($config) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
echo \sprintf("Socket server listening to tcp://%s.\n", $config['uri']);
});
$webSocket = new \React\Socket\Server($config['uri'], $loop);
$server = new IoServer(
$server
new HttpServer(
new WsServer(
new WampServer(
$application
)
),
$webSocket
);
$loop->run();
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.