public function handle(EventListenerInterface $listener)
    {
        if (!$listener->getListeners()) {
            return;
        }

        $content = $this->request->getContent();

        try {
            $options = Serializer::parse($content);
        } catch (\InvalidArgumentException $e) {
            $options = [];
        }

        foreach ($listener->getListeners() as $namespace => $callable) {
            $event = new $namespace($options);
            if ($event->isValid()) {
                $listener->trigger($namespace, $event);
                break;
            }
        }
    }
public function handle(EventListenerInterface $listener)
    {
        if (!$listener->getListeners()) {
            return;
        }

        $content = $this->request->getContent();

        try {
            $options = Serializer::parse($content);
        } catch (\InvalidArgumentException $e) {
            $options = [];
        }

        foreach ($listener->getListeners() as $namespace => $callable) {
            $event = new $namespace($options);
            if ($event->isValid()) {
                $listener->trigger($namespace, $event);
                break;
            }
        }
    }
public function handle ( EventListenerInterface $ listener ) { if ( ! $ listener -> getListeners ( ) ) { return ; } $ content = $ this -> request -> getContent ( ) ; try { $ options = Serializer :: parse ( $ content ) ; } catch ( \ InvalidArgumentException $ e ) { $ options = [ ] ; } foreach ( $ listener -> getListeners ( ) as $ namespace => $ callable ) { $ event = new $ namespace ( $ options ) ; if ( $ event -> isValid ( ) ) { $ listener -> trigger ( $ namespace , $ event ) ; break ; } } }
handle event via request.
handle event via request .