/** * Injects the event loop of the bot's client into the plugin if it implements * \Phergie\Irc\Bot\React\LoopInterface. * * @param \Phergie\Irc\Bot\React\PluginInterface $plugin Loaded plugin * @param \Phergie\Irc\Bot\React\Bot $bot Bot that loaded the plugin */ public function process(PluginInterface $plugin, Bot $bot) { $client = $bot->getClient(); if ($plugin instanceof LoopAwareInterface && $client instanceof LoopAccessorInterface) { $plugin->setLoop($client->getLoop()); } }