cboden / Ratchet-examples

Tutorial code and cookbook classes for Ratchet
http://socketo.me
238 stars 73 forks source link

Too few arguments error #17

Open Tubusy opened 4 years ago

Tubusy commented 4 years ago

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())

zhiyong-ft commented 4 years ago

Something like this should fix it.

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