/**
  * Filters events that are not user-specific or are from users with
  * specified modes.
  *
  * @param \Phergie\Irc\Event\EventInterface $event
  * @return boolean|null TRUE if the event originated from a user with a matching mode
  *         associated with this filter, FALSE if the event originated from a user
  *         without a matching mode, or NULL if the event did not originate from a user.
  */
 public function filter(EventInterface $event)
 {
     if (!$event instanceof UserEventInterface) {
         return null;
     }
     $channels = $this->getChannels($event);
     $nick = $event->getNick();
     if (empty($channels) || $nick === null) {
         return null;
     }
     $connection = $event->getConnection();
     foreach ($channels as $channel) {
         $userModes = $this->userMode->getUserModes($connection, $channel, $nick);
         $commonModes = array_intersect($userModes, $this->modes);
         if ($commonModes) {
             return true;
         }
     }
     return false;
 }
 /**
  * Tests that getSubscribedEvents() returns an array.
  */
 public function testGetSubscribedEvents()
 {
     $this->assertInternalType('array', $this->plugin->getSubscribedEvents());
 }