mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
apply rector rules: symfony **UP TO** 44
This commit is contained in:
@@ -31,12 +31,12 @@ class StatusController 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_status', ['id' => $entity->getId()]));
|
||||
return $this->redirectToRoute('chill_event_admin_status', ['id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:Status:new.html.twig', [
|
||||
@@ -53,7 +53,7 @@ class StatusController 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\Status::class)->find($id);
|
||||
|
||||
@@ -65,7 +65,7 @@ class StatusController extends AbstractController
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_event_admin_status'));
|
||||
return $this->redirectToRoute('chill_event_admin_status');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,10 +157,10 @@ class StatusController 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_status', ['id' => $id]));
|
||||
return $this->redirectToRoute('chill_event_admin_status', ['id' => $id]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:Status:edit.html.twig', [
|
||||
|
Reference in New Issue
Block a user