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

@@ -31,15 +31,12 @@ class RoleController 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();
return $this->redirect($this->generateUrl(
'chill_event_admin_role',
['id' => $entity->getId()]
));
return $this->redirectToRoute('chill_event_admin_role', ['id' => $entity->getId()]);
}
return $this->render('ChillEventBundle:Role:new.html.twig', [
@@ -56,7 +53,7 @@ class RoleController extends AbstractController
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
@@ -68,7 +65,7 @@ class RoleController extends AbstractController
$em->flush();
}
return $this->redirect($this->generateUrl('chill_event_admin_role'));
return $this->redirectToRoute('chill_event_admin_role');
}
/**
@@ -160,13 +157,10 @@ class RoleController extends AbstractController
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
if ($editForm->isSubmitted() && $editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl(
'chill_event_admin_role',
['id' => $id]
));
return $this->redirectToRoute('chill_event_admin_role', ['id' => $id]);
}
return $this->render('ChillEventBundle:Role:edit.html.twig', [