code: public function publish($eventName, $eventOrSubject = null, array $values = array())
      {
          if ($eventOrSubject instanceof Event) {
              $event = $eventOrSubject;
          } else {
              $event = new Event($eventOrSubject, $values);
          }
          $subscribers = $this->getSubscribers($eventName);
          if ($subscribers) {
              $this->doPublish($eventName, $subscribers, $event);
          }
          return $event;
      }
docs: Publish/Trigger/Dispatch event
  
  @param string $eventName      event name
  @param mixed  $eventOrSubject passed to subscribers
  @param array  $values         values to attach to event
  
  @return Event