Ratchet-examples icon indicating copy to clipboard operation
Ratchet-examples copied to clipboard

Too few arguments error

Open Tubusy opened this issue 5 years ago • 1 comments

Is there a way to fix this?

`php website-chatroom.php

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function React\Socket\Server::__construct(), 1 passed in /Ratchet-examples/bin/website-chatroom.php on line 45 and at least 2 expected in /Ratchet-examples/vendor/react/socket/src/Server.php:13 Stack trace: #0 /Ratchet-examples/bin/website-chatroom.php(45): React\Socket\Server->__construct() #1 {main} thrown in /Ratchet-examples/vendor/react/socket/src/Server.php on line 13 `

Which is refering to

public function __construct($uri, LoopInterface $loop, array $context = array())

Tubusy avatar Jul 08 '20 17:07 Tubusy

Something like this should fix it.

$webSock = new Reactor('127.0.0.1:80', $loop);

zhiyong-ft avatar Sep 12 '20 23:09 zhiyong-ft