mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
apply rector rules: symfony **UP TO** 44
This commit is contained in:
@@ -205,7 +205,7 @@ class EventController extends AbstractController
|
||||
'element_class' => Participation::class,
|
||||
'action' => 'list',
|
||||
]);
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $privacyEvent);
|
||||
$this->eventDispatcher->dispatch($privacyEvent, PrivacyEvent::PERSON_PRIVACY_EVENT);
|
||||
|
||||
$addEventParticipationByPersonForm = $this->createAddEventParticipationByPersonForm($person);
|
||||
|
||||
@@ -252,7 +252,7 @@ class EventController extends AbstractController
|
||||
$this->addFlash('success', $this->get('translator')
|
||||
->trans('The event was created'));
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_event__event_show', ['event_id' => $entity->getId()]));
|
||||
return $this->redirectToRoute('chill_event__event_show', ['event_id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:Event:new.html.twig', [
|
||||
@@ -363,7 +363,7 @@ class EventController extends AbstractController
|
||||
$this->addFlash('success', $this->get('translator')
|
||||
->trans('The event was updated'));
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_event__event_edit', ['event_id' => $event_id]));
|
||||
return $this->redirectToRoute('chill_event__event_edit', ['event_id' => $event_id]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:Event:edit.html.twig', [
|
||||
|
@@ -31,15 +31,12 @@ class EventTypeController 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_eventtype_admin',
|
||||
['id' => $entity->getId()]
|
||||
));
|
||||
return $this->redirectToRoute('chill_eventtype_admin', ['id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:EventType:new.html.twig', [
|
||||
@@ -56,7 +53,7 @@ class EventTypeController 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\EventType::class)->find($id);
|
||||
|
||||
@@ -68,7 +65,7 @@ class EventTypeController extends AbstractController
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_eventtype_admin'));
|
||||
return $this->redirectToRoute('chill_eventtype_admin');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,13 +157,10 @@ class EventTypeController 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_eventtype_admin',
|
||||
['id' => $id]
|
||||
));
|
||||
return $this->redirectToRoute('chill_eventtype_admin', ['id' => $id]);
|
||||
}
|
||||
|
||||
return $this->render('ChillEventBundle:EventType:edit.html.twig', [
|
||||
|
@@ -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', [
|
||||
|
@@ -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