public function handle(FormInterface $form, ServerRequestInterface $request, ResponseInterface &$response, Authorization $authorization) { if ('POST' !== $request->getMethod()) { return false; } $httpFoundationFactory = new HttpFoundationFactory(); $symfony_request = $httpFoundationFactory->createRequest($request); $form->submit($symfony_request); if (!$form->isValid()) { return false; } $button = $form->get('accept'); if (!$button instanceof ClickableInterface) { throw new InvalidArgumentException('Unable to find the button named "accept".'); } $authorization->setAuthorized($button->isClicked()); $this->endpoint->authorize($authorization, $response); }