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

@@ -281,7 +281,7 @@ final class ActivityController extends AbstractController
'element_class' => Activity::class,
'action' => 'list',
]);
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
$this->eventDispatcher->dispatch($event, PrivacyEvent::PERSON_PRIVACY_EVENT);
$view = 'ChillActivityBundle:Activity:listPerson.html.twig';
} elseif ($accompanyingPeriod instanceof AccompanyingPeriod) {

View File

@@ -31,12 +31,12 @@ class ActivityReasonCategoryController 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_activity_activityreasoncategory_show', ['id' => $entity->getId()]));
return $this->redirectToRoute('chill_activity_activityreasoncategory_show', ['id' => $entity->getId()]);
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', [
@@ -128,10 +128,10 @@ class ActivityReasonCategoryController 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_activity_activityreasoncategory_edit', ['id' => $id]));
return $this->redirectToRoute('chill_activity_activityreasoncategory_edit', ['id' => $id]);
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', [

View File

@@ -37,12 +37,12 @@ class ActivityReasonController 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_activity_activityreason', ['id' => $entity->getId()]));
return $this->redirectToRoute('chill_activity_activityreason', ['id' => $entity->getId()]);
}
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', [
@@ -134,10 +134,10 @@ class ActivityReasonController 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_activity_activityreason', ['id' => $id]));
return $this->redirectToRoute('chill_activity_activityreason', ['id' => $id]);
}
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', [

View File

@@ -38,11 +38,6 @@ class TranslatableActivityReasonCategoryType extends AbstractType
);
}
public function getBlockPrefix()
{
return 'translatable_activity_reason_category';
}
public function getParent()
{
return EntityType::class;

View File

@@ -260,7 +260,7 @@ final class ActivityControllerTest extends WebTestCase
}
/**
* @return \Symfony\Component\BrowserKit\Client
* @return \Symfony\Component\BrowserKit\AbstractBrowser
*/
private function getAuthenticatedClient(mixed $username = 'center a_social')
{