botman / driver-slack

BotMan Slack Driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Too few arguments to function Devristo\Phpws\Protocol\WebSocketTransport::Devristo\Phpws\Protocol\{closure}()

e2haining opened this issue · comments

I have following problem when using Slack driver

[19-Jan-2018 14:15:08 Asia/Tokyo] Too few arguments to function Devristo\Phpws\Protocol\WebSocketTransport::Devristo\Phpws\Protocol\{closure}(), 0 passed in /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php on line 123 and exactly 1 expected
[19-Jan-2018 14:15:08 Asia/Tokyo] #0 /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Devristo\Phpws\Protocol\WebSocketTransport->Devristo\Phpws\Protocol\{closure}()
#1 /var/www/bot/vendor/react/stream/src/Util.php(72): Evenement\EventEmitter->emit('close', Array)
#2 /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}()
#3 /var/www/bot/vendor/react/stream/src/DuplexResourceStream.php(138): Evenement\EventEmitter->emit('close')
#4 /var/www/bot/vendor/react/stream/src/DuplexResourceStream.php(197): React\Stream\DuplexResourceStream->close()
#5 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #542, Object(React\EventLoop\StreamSelectLoop))
#6 /var/www/bot/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #542, Object(React\EventLoop\StreamSelectLoop))
#7 /var/www/bot/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#8 /var/www/bot/app/Console/Commands/E2botSlackCommand.php(63): React\EventLoop\StreamSelectLoop->run()
#9 [internal function]: App\Console\Commands\E2botSlackCommand->handle()
#10 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#11 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#13 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#14 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#15 /var/www/bot/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#16 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#17 /var/www/bot/vendor/symfony/console/Application.php(938): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/bot/vendor/symfony/console/Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\E2botSlackCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/bot/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/bot/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/bot/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 {main}

in Devristo\Phpws\Protocol\WebSocketTransport,
$data parameter is not needed in close event ?

        $socket->on("close", function($data) use ($that){
            $that->emit("close", func_get_args());
        });

Hey, were you able to fix this issue? Where is this code from:

$socket->on("close", function($data) use ($that){
    $that->emit("close", func_get_args());
});