apply rector rules: symfony **UP TO** 44

This commit is contained in:
2023-07-28 01:52:53 +02:00
parent b6a094aeee
commit c20f65eebb
88 changed files with 211 additions and 320 deletions

View File

@@ -49,7 +49,7 @@ class CustomFieldsGroupController extends AbstractController
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
@@ -57,7 +57,7 @@ class CustomFieldsGroupController extends AbstractController
$this->addFlash('success', $this->translator
->trans('The custom fields group has been created'));
return $this->redirect($this->generateUrl('customfieldsgroup_show', ['id' => $entity->getId()]));
return $this->redirectToRoute('customfieldsgroup_show', ['id' => $entity->getId()]);
}
$this->addFlash('error', $this->translator
@@ -157,7 +157,7 @@ class CustomFieldsGroupController extends AbstractController
$this->addFlash('success', $this->translator
->trans('The default custom fields group has been changed'));
return $this->redirect($this->generateUrl('customfieldsgroup'));
return $this->redirectToRoute('customfieldsgroup');
}
/**
@@ -261,13 +261,13 @@ class CustomFieldsGroupController extends AbstractController
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
if ($editForm->isSubmitted() && $editForm->isValid()) {
$em->flush();
$this->addFlash('success', $this->translator
->trans('The custom fields group has been updated'));
return $this->redirect($this->generateUrl('customfieldsgroup_edit', ['id' => $id]));
return $this->redirectToRoute('customfieldsgroup_edit', ['id' => $id]);
}
$this->addFlash('error', $this->translator