public function handleDaddyMessage(Event $event, EventQueue $queue)
 {
     if ($event instanceof UserEvent) {
         $nick = $event->getNick();
         $channel = $event->getSource();
         $params = $event->getParams();
         $text = $params['text'];
         $matched = preg_match("/\\s*who'?s (?:your|ya) ([^?]+)[?]?/i", $text, $matches);
         if ($matched) {
             $msg = "You're my " . $matches[1] . ', ' . $nick . '!';
             $queue->ircPrivmsg($channel, $msg);
         }
     }
 }
 /**
  * Tests that iterating over the event queue does not truncate its contents.
  */
 public function testNonDestructiveIteration()
 {
     $this->assertNull($this->queue->extract());
     $this->queue->ircQuit();
     $contents = [];
     foreach ($this->queue as $value) {
         $contents[] = $value;
     }
     $event = $this->queue->extract();
     $this->assertInstanceOf('\\Phergie\\Irc\\Event\\EventInterface', $event);
     $this->assertEquals('QUIT', $event->getCommand());
     $this->assertEmpty($event->getParams());
     $this->assertEquals([$event], $contents);
 }
 /**
  * @param Url $url
  * @param UserEvent $event
  * @param EventQueue $queue
  */
 protected function sendMessage(Url $url, UserEvent $event, EventQueue $queue)
 {
     $message = $this->getHandler()->handle($url);
     $queue->ircPrivmsg($event->getSource(), $message);
 }