src/Event/Subscriber/FormSubscriber.php
public function handleForm(FormEvent $event): void
    {
        $admin = $event->getAdmin();
        $action = $admin->getAction();

        if ('delete' === $action->getName()) {
            if (!$admin->hasForm('delete')) {
                return;
            }
            $form = $admin->getForm('delete');
            $this->handleDeleteForm($event->getRequest(), $form, $admin);
        }
    }
public function handleForm(FormEvent $event): void
    {
        $admin = $event->getAdmin();
        $action = $admin->getAction();

        if ('delete' === $action->getName()) {
            if (!$admin->hasForm('delete')) {
                return;
            }
            $form = $admin->getForm('delete');
            $this->handleDeleteForm($event->getRequest(), $form, $admin);
        }
    }
public function handleForm ( FormEvent $ event ) : void { $ admin = $ event -> getAdmin ( ) ; $ action = $ admin -> getAction ( ) ; if ( 'delete' === $ action -> getName ( ) ) { if ( ! $ admin -> hasForm ( 'delete' ) ) { return ; } $ form = $ admin -> getForm ( 'delete' ) ; $ this -> handleDeleteForm ( $ event -> getRequest ( ) , $ form , $ admin ) ; } }
When the HANDLE_FORM event is dispatched, we handle the form according to the current action.

@param FormEvent $event
When the HANDLE_FORM event is dispatched we handle the form according to the current action .