Phergie\Irc\Client\React\Client::processInput PHP Method

processInput() protected method

These functions are essential to the client-server relationship: for example, updating the connection's stored nickname, responding to PING events, etc. Any user-level IRC functionality handled internally by the client should be implemented here.
protected processInput ( array $message, Phergie\Irc\Client\React\WriteStream $write, Phergie\Irc\ConnectionInterface $connection )
$message array Parser output
$write Phergie\Irc\Client\React\WriteStream Write stream corresponding to the read stream on which the event occurred
$connection Phergie\Irc\ConnectionInterface Connection on which the event occurred
    protected function processInput(array $message, WriteStream $write, ConnectionInterface $connection)
    {
        switch ($message['command']) {
            // Update connection's internal nickname when changed
            case 'NICK':
                if ($connection->getNickname() === $message['nick']) {
                    $connection->setNickname($message['params']['nickname']);
                }
                break;
                // Play client-server ping-pong
            // Play client-server ping-pong
            case 'PING':
                $write->ircPong($message['params']['server1']);
                break;
        }
    }