Closed Renegade334 closed 5 years ago
EventQueue::ircPrivmsg('#channel', '0');
currently yields:
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Phergie\Irc\Client\React\WriteStream::ircPrivmsg(), 1 passed and exactly 2 expected in /truncated/vendor/phergie/phergie-irc-client-react/src/WriteStream.php:432 Stack trace: #0 [internal function]: Phergie\Irc\Client\React\WriteStream->ircPrivmsg('#channel') #1 /truncated/vendor/phergie/phergie-irc-bot-react/src/Bot.php(533): call_user_func_array(Array, Array) #2 /truncated/vendor/phergie/phergie-irc-bot-react/src/Bot.php(498): Phergie\Irc\Bot\React\Bot->processOutgoingEvents(Object(Phergie\Irc\Connection), Object(Phergie\Irc\Client\React\WriteStream)) #3 /truncated/vendor/phergie/phergie-irc-bot-react/src/Bot.php(466): Phergie\Irc\Bot\React\Bot->processClientEvent('irc.sent', Array, Object(Phergie\Irc\Connection), Object(Phergie\Irc\Client\React\WriteStream)) #4 /truncated/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Phergie\Irc\Bot\React\Bot->Phergie\Irc\Bot\React\{closure}(' in /truncated/vendor/phergie/phergie-irc-client-react/src/WriteStream.php on line 432
due to the following line in EventQueue::queueRequest:
EventQueue::queueRequest
$event->setParams(array_filter($params));
which filters any string that casts to boolean false.
false
Using the callback strlen mitigates against this, by filtering out empty variables and zero-length strings, but not '0'.
strlen
'0'
Thanks for the fix!
currently yields:
due to the following line in
EventQueue::queueRequest
:which filters any string that casts to boolean
false
.Using the callback
strlen
mitigates against this, by filtering out empty variables and zero-length strings, but not'0'
.