src/EventDispatcher.php
/**
     * Dispatches an event based on its category.
     * @param Event $event
     */
Dispatches an event based on its category.
@param Event $event
Dispatches an event based on its category . @param Event $event
public function dispatch(Event $event)
        {
            $message = sprintf(self::FMT_INF_DISPATCHING, $event->getId(), count($this->subscriptions));
            $this->logger->info($message);
            $dispatchCount = 0;
            foreach ($this->subscriptions as $subscription) {
                $result = $this->tryDispatch($subscription, $event);
                $dispatchCount += (int)$result;
            }
            $message = sprintf(self::FMT_INF_DISPATCHED, $event->getId(), $dispatchCount);
            $this->logger->info($message);
            return $dispatchCount;
        }
public function dispatch ( Event $ event ) { $ message = sprintf ( self :: FMT_INF_DISPATCHING , $ event -> getId ( ) , count ( $ this -> subscriptions ) ) ; $ this -> logger -> info ( $ message ) ; $ dispatchCount = 0 ; foreach ( $ this -> subscriptions as $ subscription ) { $ result = $ this -> tryDispatch ( $ subscription , $ event ) ; $ dispatchCount += ( int ) $ result ; } $ message = sprintf ( self :: FMT_INF_DISPATCHED , $ event -> getId ( ) , $ dispatchCount ) ; $ this -> logger -> info ( $ message ) ; return $ dispatchCount ; }
Dispatches an event based on its category.
Dispatches an event based on its category .