/** * @param \FSi\Bundle\AdminBundle\Event\AdminEvent $event * @return \FSi\Bundle\AdminBundle\Event\FormEvent * @throws \FSi\Bundle\AdminBundle\Exception\RequestHandlerException */ protected function validateEvent(AdminEvent $event) { if (!$event instanceof FormEvent) { throw new RequestHandlerException(sprintf("%s require FormEvent", get_class($this))); } if (!$event->getElement() instanceof RedirectableElement) { throw new RequestHandlerException(sprintf("%s require RedirectableElement", get_class($this))); } return $event; }