public function fireEvent($event, $source, $data = [])
    {
        if ($this->_listeners) {
            list($p1, $p2) = explode(':', $event, 2);
            if (isset($this->_listeners[$p1])) {
                foreach ($this->_listeners[$p1] as $k => $v) {
                    /**@var \ManaPHP\Event\Listener $listener */
                    if (is_int($v)) {
                        $this->_listeners[$p1][$k] = $listener = $this->_di->getShared($k);
                    } else {
                        $listener = $v;
                    }

                    $listener->process($p2, $source, $data);
                }
            }
        }

        foreach ($this->_peekers as $handler) {
            if ($handler instanceof \Closure) {
                $handler($event, $source, $data);
            } else {
                $handler[0]->{$handler[1]}($event, $source, $data);
            }
        }

        if (!isset($this->_events[$event])) {
            return;
        }

        foreach ($this->_events[$event] as $handler) {
            if ($handler instanceof \Closure) {
                $handler($source, $data, $event);
            } else {
                $handler[0]->{$handler[1]}($source, $data, $event);
            }
        }
    }
public function fireEvent($event, $source, $data = [])
    {
        if ($this->_listeners) {
            list($p1, $p2) = explode(':', $event, 2);
            if (isset($this->_listeners[$p1])) {
                foreach ($this->_listeners[$p1] as $k => $v) {
                    /**@var \ManaPHP\Event\Listener $listener */
                    if (is_int($v)) {
                        $this->_listeners[$p1][$k] = $listener = $this->_di->getShared($k);
                    } else {
                        $listener = $v;
                    }

                    $listener->process($p2, $source, $data);
                }
            }
        }

        foreach ($this->_peekers as $handler) {
            if ($handler instanceof \Closure) {
                $handler($event, $source, $data);
            } else {
                $handler[0]->{$handler[1]}($event, $source, $data);
            }
        }

        if (!isset($this->_events[$event])) {
            return;
        }

        foreach ($this->_events[$event] as $handler) {
            if ($handler instanceof \Closure) {
                $handler($source, $data, $event);
            } else {
                $handler[0]->{$handler[1]}($source, $data, $event);
            }
        }
    }
public function fireEvent ( $ event , $ source , $ data = [ ] ) { if ( $ this -> _listeners ) { list ( $ p1 , $ p2 ) = explode ( ':' , $ event , 2 ) ; if ( isset ( $ this -> _listeners [ $ p1 ] ) ) { foreach ( $ this -> _listeners [ $ p1 ] as $ k => $ v ) { /**@var \ManaPHP\Event\Listener $listener */ if ( is_int ( $ v ) ) { $ this -> _listeners [ $ p1 ] [ $ k ] = $ listener = $ this -> _di -> getShared ( $ k ) ; } else { $ listener = $ v ; } $ listener -> process ( $ p2 , $ source , $ data ) ; } } } foreach ( $ this -> _peekers as $ handler ) { if ( $ handler instanceof \ Closure ) { $ handler ( $ event , $ source , $ data ) ; } else { $ handler [ 0 ] -> { $ handler [ 1 ] } ( $ event , $ source , $ data ) ; } } if ( ! isset ( $ this -> _events [ $ event ] ) ) { return ; } foreach ( $ this -> _events [ $ event ] as $ handler ) { if ( $ handler instanceof \ Closure ) { $ handler ( $ source , $ data , $ event ) ; } else { $ handler [ 0 ] -> { $ handler [ 1 ] } ( $ source , $ data , $ event ) ; } } }
Fires an event in the events manager causing that active listeners be notified about it

@param string $event
@param mixed  $source
@param array  $data

@return void
Fires an event in the events manager causing that active listeners be notified about it