Example #1
0
 /**
  * Fires the event
  * 
  * @access  private
  * @param   \DavidRockin\Podiya\Event   $event  The Event object to be fired
  * @param   array   $subscriber The subscriber that will be handling the event
  * @param   mixed   $result The previous result to add to the Event object, if any
  * @return  mixed   The return value of the called subscriber, if any
  * @since   2.0
  */
 private function fire(Event &$event, array &$subscriber, $result = null)
 {
     // check if the subscriber is a timer
     if (isset($subscriber['interval'])) {
         if (self::currentTimeMillis() > $subscriber['nextcalltime']) {
             $subscriber['nextcalltime'] += $subscriber['interval'];
         } else {
             return;
         }
     }
     // fire the event off to the subscriber
     $event->addPreviousResult($result);
     return call_user_func($subscriber['callback'], $event);
 }