/** * * @param WebHook $webHook The WebHook entity * * @return Form The form */ private function createClearNotificationsForm(WebHook $webHook = null) { if ($webHook) { $data = ['id' => $webHook->getId()]; } else { $data = null; } return $this->createFormBuilder($data)->setAction($this->generateUrl('webhook_clear_notification'))->add('id', HiddenType::class)->setMethod('DELETE')->getForm(); }