diff --git a/rector.php b/rector.php index 8c614d14e..12b6ba572 100644 --- a/rector.php +++ b/rector.php @@ -24,7 +24,7 @@ return static function (RectorConfig $rectorConfig): void { Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class => __DIR__.'src/Bundle/ChillMainBundle/Service/Notifier/LegacyOvhCloudFactory.php', ]); - $rectorConfig->symfonyContainerXml(__DIR__.'/var/cache/dev/test/App_KernelTestDebugContainer.xml '); +// $rectorConfig->symfonyContainerXml(__DIR__.'/var/cache/dev/test/App_KernelTestDebugContainer.xml '); $rectorConfig->symfonyContainerPhp(__DIR__.'/tests/symfony-container.php'); // $rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class); @@ -53,6 +53,9 @@ return static function (RectorConfig $rectorConfig): void { Rector\Symfony\Set\SymfonySetList::SYMFONY_60, Rector\Symfony\Set\SymfonySetList::SYMFONY_61, Rector\Symfony\Set\SymfonySetList::SYMFONY_62, + Rector\Symfony\Set\SymfonySetList::SYMFONY_63, + Rector\Symfony\Set\SymfonySetList::SYMFONY_64, + Rector\Symfony\Set\SymfonySetList::SYMFONY_70, Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, ]); diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 07cced0e6..213e8b919 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -74,7 +74,7 @@ final class ActivityController extends AbstractController /** * Deletes a Activity entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])] public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $view = null; @@ -134,7 +134,7 @@ final class ActivityController extends AbstractController return $this->render($view, [ 'activity' => $activity, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'person' => $person, 'accompanyingCourse' => $accompanyingPeriod, ]); @@ -143,7 +143,7 @@ final class ActivityController extends AbstractController /** * Displays a form to edit an existing Activity entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/edit', name: 'chill_activity_activity_edit', methods: ['GET', 'POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/{id}/edit', name: 'chill_activity_activity_edit', methods: ['GET', 'POST', 'PUT'])] public function editAction(int $id, Request $request): Response { $view = null; @@ -226,8 +226,8 @@ final class ActivityController extends AbstractController return $this->render($view, [ 'entity' => $entity, - 'edit_form' => $form->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $form, + 'delete_form' => $deleteForm, 'person' => $person, 'accompanyingCourse' => $accompanyingPeriod, 'activity_json' => $activity_array, @@ -237,7 +237,7 @@ final class ActivityController extends AbstractController /** * Lists all Activity entities. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/', name: 'chill_activity_activity_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/', name: 'chill_activity_activity_list')] public function listAction(Request $request): Response { $view = null; @@ -341,7 +341,7 @@ final class ActivityController extends AbstractController return $filterBuilder->build(); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/new', name: 'chill_activity_activity_new', methods: ['POST', 'GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/new', name: 'chill_activity_activity_new', methods: ['POST', 'GET'])] public function newAction(Request $request): Response { $view = null; @@ -516,13 +516,13 @@ final class ActivityController extends AbstractController 'person' => $person, 'accompanyingCourse' => $accompanyingPeriod, 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, 'activity_json' => $activity_array, 'default_location' => $defaultLocation, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/select-type', name: 'chill_activity_activity_select_type')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/select-type', name: 'chill_activity_activity_select_type')] public function selectTypeAction(Request $request): Response { $view = null; @@ -567,7 +567,7 @@ final class ActivityController extends AbstractController ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/show', name: 'chill_activity_activity_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/activity/{id}/show', name: 'chill_activity_activity_show')] public function showAction(Request $request, int $id): Response { $entity = $this->activityRepository->find($id); @@ -611,7 +611,7 @@ final class ActivityController extends AbstractController 'person' => $person, 'accompanyingCourse' => $accompanyingPeriod, 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), + 'delete_form' => $deleteForm, ]); } diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php index e9f9f8b92..dc7c48b74 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php @@ -27,7 +27,7 @@ class ActivityReasonCategoryController extends AbstractController /** * Creates a new ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new ActivityReasonCategory(); @@ -44,14 +44,14 @@ class ActivityReasonCategoryController extends AbstractController return $this->render('@ChillActivity/ActivityReasonCategory/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Displays a form to edit an existing ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -66,14 +66,14 @@ class ActivityReasonCategoryController extends AbstractController return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } /** * Lists all ActivityReasonCategory entities. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -88,7 +88,7 @@ class ActivityReasonCategoryController extends AbstractController /** * Displays a form to create a new ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new ActivityReasonCategory(); @@ -96,14 +96,14 @@ class ActivityReasonCategoryController extends AbstractController return $this->render('@ChillActivity/ActivityReasonCategory/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -122,7 +122,7 @@ class ActivityReasonCategoryController extends AbstractController /** * Edits an existing ActivityReasonCategory entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -144,7 +144,7 @@ class ActivityReasonCategoryController extends AbstractController return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index 53caf7cba..944db64b1 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -29,7 +29,7 @@ class ActivityReasonController extends AbstractController /** * Creates a new ActivityReason entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new ActivityReason(); @@ -46,14 +46,14 @@ class ActivityReasonController extends AbstractController return $this->render('@ChillActivity/ActivityReason/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Displays a form to edit an existing ActivityReason entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -68,14 +68,14 @@ class ActivityReasonController extends AbstractController return $this->render('@ChillActivity/ActivityReason/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } /** * Lists all ActivityReason entities. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -90,7 +90,7 @@ class ActivityReasonController extends AbstractController /** * Displays a form to create a new ActivityReason entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new ActivityReason(); @@ -98,14 +98,14 @@ class ActivityReasonController extends AbstractController return $this->render('@ChillActivity/ActivityReason/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a ActivityReason entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -124,7 +124,7 @@ class ActivityReasonController extends AbstractController /** * Edits an existing ActivityReason entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -146,7 +146,7 @@ class ActivityReasonController extends AbstractController return $this->render('@ChillActivity/ActivityReason/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillActivityBundle/Controller/AdminController.php b/src/Bundle/ChillActivityBundle/Controller/AdminController.php index 2ff97e290..a0198dcd9 100644 --- a/src/Bundle/ChillActivityBundle/Controller/AdminController.php +++ b/src/Bundle/ChillActivityBundle/Controller/AdminController.php @@ -18,14 +18,14 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; */ class AdminController extends AbstractController { - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')] public function indexActivityAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillActivity/Admin/layout_activity.html.twig'); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])] - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')] public function redirectToAdminIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse { return $this->redirectToRoute('chill_main_admin_central'); diff --git a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php index 2a39c019c..543472ef1 100644 --- a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php +++ b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php @@ -41,7 +41,7 @@ class TimelineActivityProvider implements TimelineProviderInterface $this->user = $storage->getToken()->getUser(); } - public function fetchQuery($context, array $args) + public function fetchQuery($context, array $args): \Chill\MainBundle\Timeline\TimelineSingleQuery { if ('center' === $context) { return TimelineSingleQuery::fromArray($this->aclAwareRepository diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AdminController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AdminController.php index 21b7ac9d1..5f1ffd4cd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AdminController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AdminController.php @@ -19,7 +19,7 @@ use Symfony\Component\Routing\Annotation\Route; */ class AdminController extends AbstractController { - #[Route(path: '/{_locale}/admin/aside-activity', name: 'chill_aside_activity_admin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/aside-activity', name: 'chill_aside_activity_admin')] public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillAsideActivity/Admin/index.html.twig'); diff --git a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php index 933259785..6b652eb54 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php @@ -82,7 +82,7 @@ abstract class AbstractElementController extends AbstractController return $this->render($template, [ 'element' => $element, - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } @@ -124,7 +124,7 @@ abstract class AbstractElementController extends AbstractController return $this->render($template, [ 'element' => $element, - 'form' => $form->createView(), + 'form' => $form, $entityStr => $entity, ]); } @@ -168,7 +168,7 @@ abstract class AbstractElementController extends AbstractController } return $this->render($template, [ - 'form' => $form->createView(), + 'form' => $form, $entityStr => $entity, 'element' => $element, ]); diff --git a/src/Bundle/ChillBudgetBundle/Controller/Admin/AdminController.php b/src/Bundle/ChillBudgetBundle/Controller/Admin/AdminController.php index 0ddb1e370..5c900c069 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/Admin/AdminController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/Admin/AdminController.php @@ -16,7 +16,7 @@ use Symfony\Component\Routing\Annotation\Route; class AdminController extends AbstractController { - #[Route(path: '/{_locale}/admin/budget', name: 'chill_admin_budget')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/budget', name: 'chill_admin_budget')] public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillBudget/Admin/index.html.twig'); diff --git a/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php b/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php index edcdb3f78..c397d2798 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php @@ -21,7 +21,7 @@ use Symfony\Component\Routing\Annotation\Route; class ChargeController extends AbstractElementController { - #[Route(path: '{_locale}/budget/charge/{id}/delete', name: 'chill_budget_charge_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/{id}/delete', name: 'chill_budget_charge_delete')] public function deleteAction(Request $request, #[MapEntity(id: 'id')] Charge $charge): \Symfony\Component\HttpFoundation\Response { return $this->_delete( @@ -32,7 +32,7 @@ class ChargeController extends AbstractElementController ); } - #[Route(path: '{_locale}/budget/charge/{id}/edit', name: 'chill_budget_charge_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/{id}/edit', name: 'chill_budget_charge_edit')] public function editAction(Request $request, #[MapEntity(id: 'id')] Charge $charge): \Symfony\Component\HttpFoundation\Response { return $this->_edit( @@ -46,7 +46,7 @@ class ChargeController extends AbstractElementController /** * @return \Symfony\Component\HttpFoundation\Response */ - #[Route(path: '{_locale}/budget/charge/by-person/{id}/new', name: 'chill_budget_charge_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/by-person/{id}/new', name: 'chill_budget_charge_new')] public function newAction(Request $request, #[MapEntity(id: 'id')] Person $person) { return $this->_new( @@ -60,7 +60,7 @@ class ChargeController extends AbstractElementController /** * @return \Symfony\Component\HttpFoundation\Response */ - #[Route(path: '{_locale}/budget/charge/by-household/{id}/new', name: 'chill_budget_charge_household_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/by-household/{id}/new', name: 'chill_budget_charge_household_new')] public function newHouseholdAction(Request $request, #[MapEntity(id: 'id')] Household $household) { return $this->_new( @@ -74,8 +74,8 @@ class ChargeController extends AbstractElementController /** * @return \Symfony\Component\HttpFoundation\Response */ - #[Route(path: '{_locale}/budget/charge/{id}/view', name: 'chill_budget_charge_view')] - public function viewAction(#[MapEntity(id: 'id')] Charge $charge) + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/charge/{id}/view', name: 'chill_budget_charge_view')] + public function viewAction(#[MapEntity(id: 'id')] Charge $charge): \Symfony\Component\HttpFoundation\Response { return $this->_view($charge, '@ChillBudget/Charge/view.html.twig'); } diff --git a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php index 7f887f227..94d7b1ba2 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php @@ -25,7 +25,7 @@ class ElementController extends AbstractController { public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) {} - #[Route(path: '{_locale}/budget/elements/by-person/{id}', name: 'chill_budget_elements_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/elements/by-person/{id}', name: 'chill_budget_elements_index')] public function indexAction(#[MapEntity(id: 'id')] Person $person): \Symfony\Component\HttpFoundation\Response { $this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $person); @@ -47,7 +47,7 @@ class ElementController extends AbstractController ]); } - #[Route(path: '{_locale}/budget/elements/by-household/{id}', name: 'chill_budget_elements_household_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/elements/by-household/{id}', name: 'chill_budget_elements_household_index')] public function indexHouseholdAction(#[MapEntity(id: 'id')] Household $household): \Symfony\Component\HttpFoundation\Response { $this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $household); diff --git a/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php b/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php index a7e732537..dd9e53865 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php @@ -22,7 +22,7 @@ use Symfony\Component\Routing\Annotation\Route; class ResourceController extends AbstractElementController { - #[Route(path: '{_locale}/budget/resource/{id}/delete', name: 'chill_budget_resource_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/resource/{id}/delete', name: 'chill_budget_resource_delete')] public function deleteAction(Request $request, #[MapEntity(id: 'id')] Resource $resource): Response { return $this->_delete( @@ -33,7 +33,7 @@ class ResourceController extends AbstractElementController ); } - #[Route(path: '{_locale}/budget/resource/{id}/edit', name: 'chill_budget_resource_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/resource/{id}/edit', name: 'chill_budget_resource_edit')] public function editAction(Request $request, #[MapEntity(id: 'id')] Resource $resource): Response { return $this->_edit( @@ -47,7 +47,7 @@ class ResourceController extends AbstractElementController /** * Create a new budget element for a person. */ - #[Route(path: '{_locale}/budget/resource/by-person/{id}/new', name: 'chill_budget_resource_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/resource/by-person/{id}/new', name: 'chill_budget_resource_new')] public function newAction(Request $request, #[MapEntity(id: 'id')] Person $person): Response { return $this->_new( @@ -61,7 +61,7 @@ class ResourceController extends AbstractElementController /** * Create new budget element for a household. */ - #[Route(path: '{_locale}/budget/resource/by-household/{id}/new', name: 'chill_budget_resource_household_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/resource/by-household/{id}/new', name: 'chill_budget_resource_household_new')] public function newHouseholdAction(Request $request, #[MapEntity(id: 'id')] Household $household): Response { return $this->_new( @@ -72,7 +72,7 @@ class ResourceController extends AbstractElementController ); } - #[Route(path: '{_locale}/budget/resource/{id}/view', name: 'chill_budget_resource_view')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/budget/resource/{id}/view', name: 'chill_budget_resource_view')] public function viewAction(#[MapEntity(id: 'id')] Resource $resource): Response { return $this->_view($resource, '@ChillBudget/Resource/view.html.twig'); diff --git a/src/Bundle/ChillCalendarBundle/Controller/AdminController.php b/src/Bundle/ChillCalendarBundle/Controller/AdminController.php index 6bae05179..08f1190b3 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/AdminController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/AdminController.php @@ -19,7 +19,7 @@ class AdminController extends AbstractController /** * Calendar admin. */ - #[Route(path: '/{_locale}/admin/calendar', name: 'chill_calendar_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/calendar', name: 'chill_calendar_admin_index')] public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillCalendar/Admin/index.html.twig'); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php index eb5812b4d..baba553f4 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php @@ -25,7 +25,7 @@ class CalendarAPIController extends ApiController { public function __construct(private readonly CalendarRepository $calendarRepository) {} - #[Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])] public function listByUser(User $user, Request $request, string $_format): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 734f6fc00..eb78826dc 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -65,7 +65,7 @@ class CalendarController extends AbstractController /** * Delete a calendar item. */ - #[Route(path: '/{_locale}/calendar/{id}/delete', name: 'chill_calendar_calendar_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/{id}/delete', name: 'chill_calendar_calendar_delete')] public function deleteAction(Request $request, Calendar $entity) { $em = $this->managerRegistry->getManager(); @@ -105,7 +105,7 @@ class CalendarController extends AbstractController return $this->render($view, [ 'calendar' => $entity, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'accompanyingCourse' => $accompanyingPeriod, 'person' => $person, ]); @@ -114,7 +114,7 @@ class CalendarController extends AbstractController /** * Edit a calendar item. */ - #[Route(path: '/{_locale}/calendar/calendar/{id}/edit', name: 'chill_calendar_calendar_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/{id}/edit', name: 'chill_calendar_calendar_edit')] public function editAction(Calendar $entity, Request $request): Response { $this->denyAccessUnlessGranted(CalendarVoter::EDIT, $entity); @@ -182,7 +182,7 @@ class CalendarController extends AbstractController return $this->render($view, [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, 'accompanyingCourse' => $entity->getAccompanyingPeriod(), 'person' => $entity->getPerson(), 'entity_json' => $entity_array, @@ -193,7 +193,7 @@ class CalendarController extends AbstractController /** * Lists all Calendar entities. */ - #[Route(path: '/{_locale}/calendar/calendar/by-period/{id}', name: 'chill_calendar_calendar_list_by_period')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/by-period/{id}', name: 'chill_calendar_calendar_list_by_period')] public function listActionByCourse(AccompanyingPeriod $accompanyingPeriod): Response { $this->denyAccessUnlessGranted(CalendarVoter::SEE, $accompanyingPeriod); @@ -226,7 +226,7 @@ class CalendarController extends AbstractController /** * Lists all Calendar entities on a person. */ - #[Route(path: '/{_locale}/calendar/calendar/by-person/{id}', name: 'chill_calendar_calendar_list_by_person')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/by-person/{id}', name: 'chill_calendar_calendar_list_by_person')] public function listActionByPerson(Person $person): Response { $this->denyAccessUnlessGranted(CalendarVoter::SEE, $person); @@ -256,7 +256,7 @@ class CalendarController extends AbstractController ]); } - #[Route(path: '/{_locale}/calendar/calendar/my', name: 'chill_calendar_calendar_list_my')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/my', name: 'chill_calendar_calendar_list_my')] public function myCalendar(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -279,7 +279,7 @@ class CalendarController extends AbstractController /** * Create a new calendar item. */ - #[Route(path: '/{_locale}/calendar/calendar/new', name: 'chill_calendar_calendar_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/new', name: 'chill_calendar_calendar_new')] public function newAction(Request $request): Response { if (!$this->remoteCalendarConnector->isReady()) { @@ -370,7 +370,7 @@ class CalendarController extends AbstractController 'person' => $person, 'accompanyingCourse' => $accompanyingPeriod, 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, 'entity_json' => $entity_array, 'templates' => $templates, ]); @@ -379,7 +379,7 @@ class CalendarController extends AbstractController /** * Show a calendar item. */ - #[Route(path: '/{_locale}/calendar/calendar/{id}/show', name: 'chill_calendar_calendar_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/{id}/show', name: 'chill_calendar_calendar_show')] public function showAction(Request $request, int $id): Response { throw new \Exception('not implemented'); @@ -447,7 +447,7 @@ class CalendarController extends AbstractController ]); } - #[Route(path: '/{_locale}/calendar/calendar/{id}/to-activity', name: 'chill_calendar_calendar_to_activity')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar/{id}/to-activity', name: 'chill_calendar_calendar_to_activity')] public function toActivity(Request $request, Calendar $calendar): RedirectResponse { $this->denyAccessUnlessGranted(CalendarVoter::SEE, $calendar); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php index fbfe94a49..cbd9eb705 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php @@ -37,7 +37,7 @@ final readonly class CalendarDocController private UrlGeneratorInterface $urlGenerator, ) {} - #[Route(path: '/{_locale}/calendar/calendar-doc/{id}/new', name: 'chill_calendar_calendardoc_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar-doc/{id}/new', name: 'chill_calendar_calendardoc_new')] public function create(Calendar $calendar, Request $request): Response { $calendarDoc = (new CalendarDoc($calendar, null))->setCalendar($calendar); @@ -94,7 +94,7 @@ final readonly class CalendarDocController ); } - #[Route(path: '/{_locale}/calendar/calendar-doc/{id}/delete', name: 'chill_calendar_calendardoc_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar-doc/{id}/delete', name: 'chill_calendar_calendardoc_delete')] public function delete(CalendarDoc $calendarDoc, Request $request): Response { if (!$this->security->isGranted(CalendarDocVoter::EDIT, $calendarDoc)) { @@ -152,7 +152,7 @@ final readonly class CalendarDocController ); } - #[Route(path: '/{_locale}/calendar/calendar-doc/{id}/edit', name: 'chill_calendar_calendardoc_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/calendar/calendar-doc/{id}/edit', name: 'chill_calendar_calendardoc_edit')] public function edit(CalendarDoc $calendarDoc, Request $request): Response { if (!$this->security->isGranted(CalendarDocVoter::EDIT, $calendarDoc)) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php index 3774f4226..373f132db 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php @@ -25,7 +25,7 @@ class CalendarRangeAPIController extends ApiController { public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) {} - #[Route(path: '/api/1.0/calendar/calendar-range-available/{id}.{_format}', name: 'chill_api_single_calendar_range_available', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/calendar/calendar-range-available/{id}.{_format}', name: 'chill_api_single_calendar_range_available', requirements: ['_format' => 'json'])] public function availableRanges(User $user, Request $request, string $_format): JsonResponse { // return new JsonResponse(['ok' => true], 200, [], false); diff --git a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php index aaa61f927..ffc91534d 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php @@ -39,7 +39,7 @@ class InviteApiController /** * Give an answer to a calendar invite. */ - #[Route(path: '/api/1.0/calendar/calendar/{id}/answer/{answer}.json', methods: ['post'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/calendar/calendar/{id}/answer/{answer}.json', methods: ['post'])] public function answer(Calendar $calendar, string $answer): Response { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php index 8790617ed..489a4a367 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php @@ -32,7 +32,7 @@ class RemoteCalendarConnectAzureController { public function __construct(private readonly ClientRegistry $clientRegistry, private readonly OnBehalfOfUserTokenStorage $MSGraphTokenStorage) {} - #[Route(path: '/{_locale}/connect/azure', name: 'chill_calendar_remote_connect_azure')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/connect/azure', name: 'chill_calendar_remote_connect_azure')] public function connectAzure(Request $request): Response { $request->getSession()->set('azure_return_path', $request->query->get('returnPath', '/')); @@ -42,7 +42,7 @@ class RemoteCalendarConnectAzureController ->redirect(['https://graph.microsoft.com/.default', 'offline_access'], []); } - #[Route(path: '/connect/azure/check', name: 'chill_calendar_remote_connect_azure_check')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/connect/azure/check', name: 'chill_calendar_remote_connect_azure_check')] public function connectAzureCheck(Request $request): Response { /** @var Azure $client */ diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php index 3faefeb00..2e867787c 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php @@ -29,7 +29,7 @@ class RemoteCalendarMSGraphSyncController { public function __construct(private readonly MessageBusInterface $messageBus) {} - #[Route(path: '/public/incoming-hook/calendar/msgraph/events/{userId}', name: 'chill_calendar_remote_msgraph_incoming_webhook_events', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/public/incoming-hook/calendar/msgraph/events/{userId}', name: 'chill_calendar_remote_msgraph_incoming_webhook_events', methods: ['POST'])] public function webhookCalendarReceiver(int $userId, Request $request): Response { if ($request->query->has('validationToken')) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php index 647c6e444..f9cd64055 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php @@ -36,7 +36,7 @@ class RemoteCalendarProxyController { public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly SerializerInterface $serializer) {} - #[Route(path: 'api/1.0/calendar/proxy/calendar/by-user/{id}/events')] + #[\Symfony\Component\Routing\Attribute\Route(path: 'api/1.0/calendar/proxy/calendar/by-user/{id}/events')] public function listEventForCalendar(User $user, Request $request): Response { if (!$request->query->has('dateFrom')) { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php index 9b4daf626..b61e2292e 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php @@ -137,7 +137,7 @@ class CalendarSyncer } foreach ($calendar->getUsers() as $user) { - if (!\in_array(strtolower($user->getEmailCanonical()), $emails, true)) { + if (!\in_array(strtolower((string) $user->getEmailCanonical()), $emails, true)) { $calendar->removeUser($user); } } diff --git a/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php b/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php index 67214814d..dad74cfd8 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php @@ -69,7 +69,7 @@ final class RemoteCalendarMSGraphSyncControllerTest extends WebTestCase $this->assertResponseIsSuccessful(); $this->assertResponseStatusCodeSame(202); - /** @var InMemoryTransport $transport */ + /** @var \Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport $transport */ $transport = self::getContainer()->get('messenger.transport.async'); $this->assertCount(1, $transport->getSent()); } diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/AdminController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/AdminController.php index 525df57ee..e886055b3 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/AdminController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/AdminController.php @@ -21,7 +21,7 @@ use Symfony\Component\Routing\Annotation\Route; */ class AdminController extends AbstractController { - #[Route(path: '/{_locale}/admin/customfield/', name: 'customfield_section')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfield/', name: 'customfield_section')] public function indexAction(): Response { return $this->render('@ChillCustomFields/Admin/layout.html.twig'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php index b8235c0c6..35dc4cfc9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php @@ -34,7 +34,7 @@ class CustomFieldController extends AbstractController /** * Creates a new CustomField entity. */ - #[Route(path: '/{_locale}/admin/customfield/new', name: 'customfield_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfield/new', name: 'customfield_create')] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new CustomField(); @@ -57,14 +57,14 @@ class CustomFieldController extends AbstractController return $this->render('@ChillCustomFields/CustomField/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Displays a form to edit an existing CustomField entity. */ - #[Route(path: '/{_locale}/admin/customfield/edit', name: 'customfield_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfield/edit', name: 'customfield_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -79,14 +79,14 @@ class CustomFieldController extends AbstractController return $this->render('@ChillCustomFields/CustomField/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } /** * Displays a form to create a new CustomField entity. */ - #[Route(path: '/{_locale}/admin/customfield/new', name: 'customfield_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfield/new', name: 'customfield_new')] public function newAction(Request $request): \Symfony\Component\HttpFoundation\Response { $entity = new CustomField(); @@ -109,14 +109,14 @@ class CustomFieldController extends AbstractController return $this->render('@ChillCustomFields/CustomField/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Edits an existing CustomField entity. */ - #[Route(path: '/{_locale}/admin/customfield/update', name: 'customfield_update')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfield/update', name: 'customfield_update')] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -144,7 +144,7 @@ class CustomFieldController extends AbstractController return $this->render('@ChillCustomFields/CustomField/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index 0461528a8..e9db2264e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -45,7 +45,7 @@ class CustomFieldsGroupController extends AbstractController /** * Creates a new CustomFieldsGroup entity. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/create', name: 'customfieldsgroup_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/create', name: 'customfieldsgroup_create')] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new CustomFieldsGroup(); @@ -68,14 +68,14 @@ class CustomFieldsGroupController extends AbstractController return $this->render('@ChillCustomFields/CustomFieldsGroup/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Displays a form to edit an existing CustomFieldsGroup entity. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/{id}/edit', name: 'customfieldsgroup_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/{id}/edit', name: 'customfieldsgroup_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -90,14 +90,14 @@ class CustomFieldsGroupController extends AbstractController return $this->render('@ChillCustomFields/CustomFieldsGroup/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } /** * Lists all CustomFieldsGroup entities. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/', name: 'customfieldsgroup')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/', name: 'customfieldsgroup')] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -123,7 +123,7 @@ class CustomFieldsGroupController extends AbstractController /** * Set the CustomField Group with id $cFGroupId as default. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/makedefault', name: 'customfieldsgroup_makedefault')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/makedefault', name: 'customfieldsgroup_makedefault')] public function makeDefaultAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse { $form = $this->createMakeDefaultForm(null); @@ -167,7 +167,7 @@ class CustomFieldsGroupController extends AbstractController /** * Displays a form to create a new CustomFieldsGroup entity. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/new', name: 'customfieldsgroup_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/new', name: 'customfieldsgroup_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new CustomFieldsGroup(); @@ -175,7 +175,7 @@ class CustomFieldsGroupController extends AbstractController return $this->render('@ChillCustomFields/CustomFieldsGroup/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -224,14 +224,14 @@ class CustomFieldsGroupController extends AbstractController return $this ->render('@test/CustomField/simple_form_render.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a CustomFieldsGroup entity. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/{id}/show', name: 'customfieldsgroup_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/{id}/show', name: 'customfieldsgroup_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -254,7 +254,7 @@ class CustomFieldsGroupController extends AbstractController /** * Edits an existing CustomFieldsGroup entity. */ - #[Route(path: '/{_locale}/admin/customfieldsgroup/{id}/update', name: 'customfieldsgroup_update')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/customfieldsgroup/{id}/update', name: 'customfieldsgroup_update')] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -282,7 +282,7 @@ class CustomFieldsGroupController extends AbstractController return $this->render('@ChillCustomFields/CustomFieldsGroup/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index 04fa9ce07..781963d43 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -58,7 +58,7 @@ class AdminDocGeneratorTemplateController extends CRUDController return parent::new($request); } - #[Route(path: '{_locale}/admin/docgen/template/pick-context', name: 'chill_docgen_admin_template_pick-context')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/admin/docgen/template/pick-context', name: 'chill_docgen_admin_template_pick-context')] public function pickContext(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_ADMIN'); diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php index 7bcd6f6d5..af032d70b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php @@ -51,7 +51,7 @@ final class DocGeneratorTemplateController extends AbstractController private readonly ChillSecurity $security, ) {} - #[Route(path: '{_locale}/admin/doc/gen/generate/test/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_test_generate_from_template')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/admin/doc/gen/generate/test/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_test_generate_from_template')] public function adminTestGenerateDocFromTemplateAction( DocGeneratorTemplate $template, string $entityClassName, @@ -66,7 +66,7 @@ final class DocGeneratorTemplateController extends AbstractController ); } - #[Route(path: '{_locale}/doc/gen/generate/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_generate_from_template')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/doc/gen/generate/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_generate_from_template')] public function generateDocFromTemplateAction( DocGeneratorTemplate $template, string $entityClassName, @@ -81,7 +81,7 @@ final class DocGeneratorTemplateController extends AbstractController ); } - #[Route(path: '/api/1.0/docgen/templates/by-entity/{entityClassName}', name: 'chill_docgenerator_templates_for_entity_api')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/docgen/templates/by-entity/{entityClassName}', name: 'chill_docgenerator_templates_for_entity_api')] public function listTemplateApiAction(string $entityClassName): Response { $nb = $this->docGeneratorTemplateRepository->countByEntity($entityClassName); @@ -103,7 +103,7 @@ final class DocGeneratorTemplateController extends AbstractController /** * @return void */ - #[Route(path: '{_locale}/admin/doc/gen/generate/test/redirect', name: 'chill_docgenerator_test_generate_redirect')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/admin/doc/gen/generate/test/redirect', name: 'chill_docgenerator_test_generate_redirect')] public function redirectToTestGenerate(Request $request): RedirectResponse { $template = $request->query->getInt('template'); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/AdminController.php b/src/Bundle/ChillDocStoreBundle/Controller/AdminController.php index cf00cdd5e..8a73751cc 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/AdminController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/AdminController.php @@ -21,7 +21,7 @@ class AdminController extends AbstractController /** * @return \Symfony\Component\HttpFoundation\Response */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/document', name: 'chill_docstore_admin', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/document', name: 'chill_docstore_admin', options: [null])] public function indexAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillDocStore/Admin/layout.html.twig'); @@ -30,7 +30,7 @@ class AdminController extends AbstractController /** * @return \Symfony\Component\HttpFoundation\RedirectResponse */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/document_redirect_to_main', name: 'chill_docstore_admin_redirect_to_admin_index', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/document_redirect_to_main', name: 'chill_docstore_admin_redirect_to_admin_index', options: [null])] public function redirectToAdminIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse { return $this->redirectToRoute('chill_main_admin_central'); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/AsyncUploadController.php b/src/Bundle/ChillDocStoreBundle/Controller/AsyncUploadController.php index 17ddad842..af5158b03 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/AsyncUploadController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/AsyncUploadController.php @@ -35,7 +35,7 @@ final readonly class AsyncUploadController private LoggerInterface $chillLogger, ) {} - #[Route(path: '/api/1.0/doc-store/async-upload/temp_url/{uuid}/generate/post', name: 'chill_docstore_asyncupload_getsignedurlpost')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/doc-store/async-upload/temp_url/{uuid}/generate/post', name: 'chill_docstore_asyncupload_getsignedurlpost')] public function getSignedUrlPost(Request $request, StoredObject $storedObject): JsonResponse { if (!$this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject)) { @@ -64,7 +64,7 @@ final readonly class AsyncUploadController ); } - #[Route(path: '/api/1.0/doc-store/async-upload/temp_url/{uuid}/generate/{method}', name: 'chill_docstore_asyncupload_getsignedurlget', requirements: ['method' => 'get|head'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/doc-store/async-upload/temp_url/{uuid}/generate/{method}', name: 'chill_docstore_asyncupload_getsignedurlget', requirements: ['method' => 'get|head'])] public function getSignedUrlGet(Request $request, StoredObject $storedObject, string $method): JsonResponse { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php index 018d6cb8f..7d77bfb5b 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; -#[Route(path: '/{_locale}/parcours/{course}/document')] +#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{course}/document')] class DocumentAccompanyingCourseController extends AbstractController { /** @@ -38,7 +38,7 @@ class DocumentAccompanyingCourseController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[Route(path: '/{id}/delete', name: 'chill_docstore_accompanying_course_document_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/delete', name: 'chill_docstore_accompanying_course_document_delete')] public function delete(Request $request, AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response { $this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::DELETE, $document); @@ -65,13 +65,13 @@ class DocumentAccompanyingCourseController extends AbstractController '@ChillDocStore/AccompanyingCourseDocument/delete.html.twig', [ 'document' => $document, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'accompanyingCourse' => $course, ] ); } - #[Route(path: '/{id}/edit', name: 'accompanying_course_document_edit', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/edit', name: 'accompanying_course_document_edit', methods: 'GET|POST')] public function edit(Request $request, AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response { $this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::UPDATE, $document); @@ -104,13 +104,13 @@ class DocumentAccompanyingCourseController extends AbstractController '@ChillDocStore/AccompanyingCourseDocument/edit.html.twig', [ 'document' => $document, - 'form' => $form->createView(), + 'form' => $form, 'accompanyingCourse' => $course, ] ); } - #[Route(path: '/new', name: 'accompanying_course_document_new', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/new', name: 'accompanying_course_document_new', methods: 'GET|POST')] public function new(Request $request, AccompanyingPeriod $course): Response { if (null === $course) { @@ -149,12 +149,12 @@ class DocumentAccompanyingCourseController extends AbstractController return $this->render('@ChillDocStore/AccompanyingCourseDocument/new.html.twig', [ 'document' => $document, - 'form' => $form->createView(), + 'form' => $form, 'accompanyingCourse' => $course, ]); } - #[Route(path: '/{id}', name: 'accompanying_course_document_show', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}', name: 'accompanying_course_document_show', methods: 'GET')] public function show(AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response { $this->denyAccessUnlessGranted(AccompanyingCourseDocumentVoter::SEE_DETAILS, $document); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseDuplicateController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseDuplicateController.php index a80420602..8ddac1dd0 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseDuplicateController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseDuplicateController.php @@ -33,7 +33,7 @@ final readonly class DocumentAccompanyingCourseDuplicateController private UrlGeneratorInterface $urlGenerator, ) {} - #[Route('/{_locale}/doc-store/accompanying-course-document/{id}/duplicate', name: 'chill_doc_store_accompanying_course_document_duplicate')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/doc-store/accompanying-course-document/{id}/duplicate', name: 'chill_doc_store_accompanying_course_document_duplicate')] public function __invoke(AccompanyingCourseDocument $document, Request $request, Session $session): Response { if (!$this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $document)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php index 061ce5330..8edfe264d 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php @@ -20,12 +20,12 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -#[Route(path: '/{_locale}/admin/document/category')] +#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/document/category')] class DocumentCategoryController extends AbstractController { public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[Route(path: '/{bundleId}/{idInsideBundle}', name: 'document_category_delete', methods: 'DELETE')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{bundleId}/{idInsideBundle}', name: 'document_category_delete', methods: 'DELETE')] public function delete(Request $request, mixed $bundleId, mixed $idInsideBundle): Response { $em = $this->managerRegistry->getManager(); @@ -43,7 +43,7 @@ class DocumentCategoryController extends AbstractController return $this->redirectToRoute('document_category_index'); } - #[Route(path: '/{bundleId}/{idInsideBundle}/edit', name: 'document_category_edit', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{bundleId}/{idInsideBundle}/edit', name: 'document_category_edit', methods: 'GET|POST')] public function edit(Request $request, mixed $bundleId, mixed $idInsideBundle): Response { $em = $this->managerRegistry->getManager(); @@ -66,12 +66,12 @@ class DocumentCategoryController extends AbstractController return $this->render('@ChillDocStore/DocumentCategory/edit.html.twig', [ 'document_category' => $documentCategory, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[Route(path: '/', name: 'document_category_index', methods: 'GET')] - #[Route(path: '/', name: 'chill_docstore_category_admin', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/', name: 'document_category_index', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/', name: 'chill_docstore_category_admin', methods: 'GET')] public function index(): Response { $em = $this->managerRegistry->getManager(); @@ -85,7 +85,7 @@ class DocumentCategoryController extends AbstractController ); } - #[Route(path: '/new', name: 'document_category_new', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/new', name: 'document_category_new', methods: 'GET|POST')] public function new(Request $request): Response { $em = $this->managerRegistry->getManager(); @@ -118,11 +118,11 @@ class DocumentCategoryController extends AbstractController return $this->render('@ChillDocStore/DocumentCategory/new.html.twig', [ 'document_category' => $documentCategory, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[Route(path: '/{bundleId}/{idInsideBundle}', name: 'document_category_show', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{bundleId}/{idInsideBundle}', name: 'document_category_show', methods: 'GET')] public function show(mixed $bundleId, mixed $idInsideBundle): Response { $em = $this->managerRegistry->getManager(); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php index 2fd231aec..ae732a604 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php @@ -32,7 +32,7 @@ use Chill\DocStoreBundle\Service\StoredObjectManagerInterface; /** * Class DocumentPersonController. */ -#[Route(path: '/{_locale}/person/{person}/document')] // TODO faire un controller abstrait ? +#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person}/document')] // TODO faire un controller abstrait ? class DocumentPersonController extends AbstractController { /** @@ -47,7 +47,7 @@ class DocumentPersonController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[Route(path: '/{id}/delete', name: 'chill_docstore_person_document_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/delete', name: 'chill_docstore_person_document_delete')] public function delete(Request $request, Person $person, PersonDocument $document): Response { $this->denyAccessUnlessGranted(PersonDocumentVoter::DELETE, $document); @@ -74,13 +74,13 @@ class DocumentPersonController extends AbstractController '@ChillDocStore/PersonDocument/delete.html.twig', [ 'document' => $document, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'person' => $person, ] ); } - #[Route(path: '/{id}/edit', name: 'person_document_edit', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/edit', name: 'person_document_edit', methods: 'GET|POST')] public function edit(Request $request, Person $person, PersonDocument $document): Response { $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); @@ -131,13 +131,13 @@ class DocumentPersonController extends AbstractController '@ChillDocStore/PersonDocument/edit.html.twig', [ 'document' => $document, - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, ] ); } - #[Route(path: '/new', name: 'person_document_new', methods: 'GET|POST')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/new', name: 'person_document_new', methods: 'GET|POST')] public function new(Request $request, Person $person): Response { if (null === $person) { @@ -178,12 +178,12 @@ class DocumentPersonController extends AbstractController return $this->render('@ChillDocStore/PersonDocument/new.html.twig', [ 'document' => $document, - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, ]); } - #[Route(path: '/{id}', name: 'person_document_show', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}', name: 'person_document_show', methods: 'GET')] public function show(Person $person, PersonDocument $document): Response { $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php index 9b974e2fb..808071df1 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php @@ -34,7 +34,7 @@ final readonly class GenericDocForAccompanyingPeriodController /** * @throws \Doctrine\DBAL\Exception */ - #[Route(path: '/{_locale}/doc-store/generic-doc/by-period/{id}/index', name: 'chill_docstore_generic-doc_by-period_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/doc-store/generic-doc/by-period/{id}/index', name: 'chill_docstore_generic-doc_by-period_index')] public function list(AccompanyingPeriod $accompanyingPeriod): Response { if (!$this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodListApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodListApiController.php index 6a76d8ff2..fdf631534 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodListApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodListApiController.php @@ -35,7 +35,7 @@ final readonly class GenericDocForAccompanyingPeriodListApiController private SerializerInterface $serializer, ) {} - #[Route('/api/1.0/doc-store/generic-doc/by-period/{id}/index', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/doc-store/generic-doc/by-period/{id}/index', methods: ['GET'])] public function __invoke(AccompanyingPeriod $accompanyingPeriod): JsonResponse { if (!$this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php index 891a8fa86..07ad032f0 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php @@ -34,7 +34,7 @@ final readonly class GenericDocForPerson /** * @throws \Doctrine\DBAL\Exception */ - #[Route(path: '/{_locale}/doc-store/generic-doc/by-person/{id}/index', name: 'chill_docstore_generic-doc_by-person_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/doc-store/generic-doc/by-person/{id}/index', name: 'chill_docstore_generic-doc_by-person_index')] public function list(Person $person): Response { if (!$this->security->isGranted(PersonDocumentVoter::SEE, $person)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php index cdc5f1059..1c1a3ff19 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php @@ -45,7 +45,7 @@ class SignatureRequestController private readonly EntityManagerInterface $entityManager, ) {} - #[Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')] public function processSignature(EntityWorkflowStepSignature $signature, Request $request): JsonResponse { if (!$this->security->isGranted(EntityWorkflowStepSignatureVoter::SIGN, $signature)) { @@ -96,7 +96,7 @@ class SignatureRequestController return new JsonResponse(null, JsonResponse::HTTP_OK, []); } - #[Route('/api/1.0/document/workflow/{id}/check-signature', name: 'chill_docstore_check_signature')] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/document/workflow/{id}/check-signature', name: 'chill_docstore_check_signature')] public function checkSignature(EntityWorkflowStepSignature $signature): JsonResponse { $entityWorkflow = $signature->getStep()->getEntityWorkflow(); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php index 4bde437cc..5e9d7b910 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php @@ -40,7 +40,7 @@ class StoredObjectApiController extends ApiController * * @throws AccessDeniedHttpException if the user does not have the necessary role to create a stored object */ - #[Route('/api/1.0/doc-store/stored-object/create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/doc-store/stored-object/create', methods: ['POST'])] public function createStoredObject(): JsonResponse { if (!($this->security->isGranted('ROLE_ADMIN') || $this->security->isGranted('ROLE_USER'))) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectContentToLocalStorageController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectContentToLocalStorageController.php index 1d7fdf8b4..12d95fa97 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectContentToLocalStorageController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectContentToLocalStorageController.php @@ -31,7 +31,7 @@ final readonly class StoredObjectContentToLocalStorageController private TempUrlLocalStorageGenerator $tempUrlLocalStorageGenerator, ) {} - #[Route('/public/stored-object/post', name: 'chill_docstore_storedobject_post', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/public/stored-object/post', name: 'chill_docstore_storedobject_post', methods: ['POST'])] public function postContent(Request $request): Response { $prefix = $request->query->get('prefix', ''); @@ -88,7 +88,7 @@ final readonly class StoredObjectContentToLocalStorageController return new Response(status: Response::HTTP_NO_CONTENT); } - #[Route('/public/stored-object/operate', name: 'chill_docstore_stored_object_operate', methods: ['GET', 'HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route('/public/stored-object/operate', name: 'chill_docstore_stored_object_operate', methods: ['GET', 'HEAD'])] public function contentOperate(Request $request): Response { if ('' === $objectName = $request->query->get('object_name', '')) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectRestoreVersionApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectRestoreVersionApiController.php index 0d0386665..699560b9a 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectRestoreVersionApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectRestoreVersionApiController.php @@ -27,7 +27,7 @@ final readonly class StoredObjectRestoreVersionApiController { public function __construct(private Security $security, private StoredObjectRestoreInterface $storedObjectRestore, private EntityManagerInterface $entityManager, private SerializerInterface $serializer) {} - #[Route('/api/1.0/doc-store/stored-object/restore-from-version/{id}', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/doc-store/stored-object/restore-from-version/{id}', methods: ['POST'])] public function restoreStoredObjectVersion(StoredObjectVersion $storedObjectVersion): JsonResponse { if (!$this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObjectVersion->getStoredObject())) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectStatusApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectStatusApiController.php index be036e937..1e72a4479 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectStatusApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectStatusApiController.php @@ -22,7 +22,7 @@ class StoredObjectStatusApiController { public function __construct(private readonly Security $security) {} - #[Route(path: '/api/1.0/doc-store/stored-object/{uuid}/is-ready')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/doc-store/stored-object/{uuid}/is-ready')] public function isDocumentReady(StoredObject $storedObject): Response { if (!$this->security->isGranted('ROLE_USER')) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectVersionApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectVersionApiController.php index ba505a70a..19411effd 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectVersionApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectVersionApiController.php @@ -42,7 +42,7 @@ final readonly class StoredObjectVersionApiController * * @throws AccessDeniedHttpException if the user is not allowed to see the stored object */ - #[Route('/api/1.0/doc-store/stored-object/{uuid}/versions', name: 'chill_doc_store_stored_object_versions_list')] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/doc-store/stored-object/{uuid}/versions', name: 'chill_doc_store_stored_object_versions_list')] public function listVersions(StoredObject $storedObject): JsonResponse { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { diff --git a/src/Bundle/ChillDocStoreBundle/Controller/WebdavController.php b/src/Bundle/ChillDocStoreBundle/Controller/WebdavController.php index 87fc21c12..4407c4acb 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/WebdavController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/WebdavController.php @@ -48,7 +48,7 @@ final readonly class WebdavController $this->requestAnalyzer = new PropfindRequestAnalyzer(); } - #[Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['GET', 'HEAD'], name: 'chill_docstore_dav_directory_get')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['GET', 'HEAD'], name: 'chill_docstore_dav_directory_get')] public function getDirectory(StoredObject $storedObject, string $access_token): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -63,7 +63,7 @@ final readonly class WebdavController ); } - #[Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['OPTIONS'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['OPTIONS'])] public function optionsDirectory(StoredObject $storedObject): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -80,7 +80,7 @@ final readonly class WebdavController return $response; } - #[Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['PROPFIND'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/', methods: ['PROPFIND'])] public function propfindDirectory(StoredObject $storedObject, string $access_token, Request $request): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -115,7 +115,7 @@ final readonly class WebdavController return $response; } - #[Route(path: '/dav/{access_token}/get/{uuid}/d', name: 'chill_docstore_dav_document_get', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/d', name: 'chill_docstore_dav_document_get', methods: ['GET'])] public function getDocument(StoredObject $storedObject): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -126,7 +126,7 @@ final readonly class WebdavController ->setEtag($this->storedObjectManager->etag($storedObject)); } - #[Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['HEAD'])] public function headDocument(StoredObject $storedObject): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -146,7 +146,7 @@ final readonly class WebdavController return $response; } - #[Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['OPTIONS'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['OPTIONS'])] public function optionsDocument(StoredObject $storedObject): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -162,7 +162,7 @@ final readonly class WebdavController return $response; } - #[Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['PROPFIND'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['PROPFIND'])] public function propfindDocument(StoredObject $storedObject, string $access_token, Request $request): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::SEE->value, $storedObject)) { @@ -194,7 +194,7 @@ final readonly class WebdavController return $response; } - #[Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/dav/{access_token}/get/{uuid}/d', methods: ['PUT'])] public function putDocument(StoredObject $storedObject, Request $request): Response { if (!$this->security->isGranted(StoredObjectRoleEnum::EDIT->value, $storedObject)) { diff --git a/src/Bundle/ChillEventBundle/Controller/AdminController.php b/src/Bundle/ChillEventBundle/Controller/AdminController.php index 3423bdc11..9272a215d 100644 --- a/src/Bundle/ChillEventBundle/Controller/AdminController.php +++ b/src/Bundle/ChillEventBundle/Controller/AdminController.php @@ -23,7 +23,7 @@ class AdminController extends AbstractController /** * Event admin. */ - #[Route(path: '/{_locale}/admin/event', name: 'chill_event_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event', name: 'chill_event_admin_index')] public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillEvent/Admin/index.html.twig'); diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 5aeb0dfc5..73474ba3e 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -61,7 +61,7 @@ final class EventController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/delete', name: 'chill_event__event_delete', requirements: ['event_id' => '\d+'], methods: ['GET', 'POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/{event_id}/delete', name: 'chill_event__event_delete', requirements: ['event_id' => '\d+'], methods: ['GET', 'POST', 'DELETE'])] public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|Response { $em = $this->managerRegistry->getManager(); @@ -104,7 +104,7 @@ final class EventController extends AbstractController return $this->render('@ChillEvent/Event/confirm_delete.html.twig', [ 'event_id' => $event->getId(), - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } @@ -113,7 +113,7 @@ final class EventController extends AbstractController * * @throws \Doctrine\ORM\NonUniqueResultException */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{person_id}/list', name: 'chill_event__list_by_person', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/{person_id}/list', name: 'chill_event__list_by_person', methods: ['GET'])] public function listByPersonAction($person_id): Response { $em = $this->managerRegistry->getManager(); @@ -155,11 +155,11 @@ final class EventController extends AbstractController 'participations' => $participations, 'person' => $person, 'paginator' => $paginator, - 'form_add_event_participation_by_person' => $addEventParticipationByPersonForm->createView(), + 'form_add_event_participation_by_person' => $addEventParticipationByPersonForm, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/most_recent', name: 'chill_event_list_most_recent', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/most_recent', name: 'chill_event_list_most_recent', options: [null])] public function mostRecentIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse { return $this->redirectToRoute('chill_main_search', [ @@ -170,7 +170,7 @@ final class EventController extends AbstractController /** * Displays a form to create a new Event entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/new', name: 'chill_event__event_new', methods: ['GET', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/new', name: 'chill_event__event_new', methods: ['GET', 'POST'])] public function newAction(?Center $center, Request $request): Response { $user = $this->security->getUser(); @@ -204,14 +204,14 @@ final class EventController extends AbstractController return $this->render('@ChillEvent/Event/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * First step of new Event form. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/new/pick-center', name: 'chill_event__event_new_pickcenter', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/new/pick-center', name: 'chill_event__event_new_pickcenter', options: [null])] public function newPickCenterAction(): Response { $role = 'CHILL_EVENT_CREATE'; @@ -247,7 +247,7 @@ final class EventController extends AbstractController ->getForm(); return $this->render('@ChillEvent/Event/newPickCenter.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -260,7 +260,7 @@ final class EventController extends AbstractController * * @throws \PhpOffice\PhpSpreadsheet\Exception */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/show', name: 'chill_event__event_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/{event_id}/show', name: 'chill_event__event_show')] public function showAction(Event $event, Request $request) { if (!$event) { @@ -283,7 +283,7 @@ final class EventController extends AbstractController return $this->render('@ChillEvent/Event/show.html.twig', [ 'event' => $event, - 'form_add_participation_by_person' => $addParticipationByPersonForm->createView(), + 'form_add_participation_by_person' => $addParticipationByPersonForm, 'form_export' => $exportParticipationsList['form']->createView(), ]); } @@ -291,7 +291,7 @@ final class EventController extends AbstractController /** * Edits an existing Event entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/edit', name: 'chill_event__event_edit', methods: ['GET', 'POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/event/{event_id}/edit', name: 'chill_event__event_edit', methods: ['GET', 'POST', 'PUT'])] public function updateAction(Request $request, $event_id): \Symfony\Component\HttpFoundation\RedirectResponse|Response { $em = $this->managerRegistry->getManager(); @@ -322,7 +322,7 @@ final class EventController extends AbstractController return $this->render('@ChillEvent/Event/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillEventBundle/Controller/EventListController.php b/src/Bundle/ChillEventBundle/Controller/EventListController.php index 692611adc..d21bd461a 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventListController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventListController.php @@ -42,7 +42,7 @@ final readonly class EventListController private UrlGeneratorInterface $urlGenerator, ) {} - #[Route(path: '{_locale}/event/event/list', name: 'chill_event_event_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/event/event/list', name: 'chill_event_event_list')] public function __invoke(): Response { $filter = $this->buildFilterOrder(); diff --git a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php index 89e0a9003..bc1a9a9dd 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php @@ -28,7 +28,7 @@ class EventTypeController extends AbstractController /** * Creates a new EventType entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/create', name: 'chill_eventtype_admin_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/create', name: 'chill_eventtype_admin_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new EventType(); @@ -45,14 +45,14 @@ class EventTypeController extends AbstractController return $this->render('@ChillEvent/EventType/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Deletes a EventType entity. */ - #[Route(path: '/{_locale}/admin/event/event_type/{id}/delete', name: 'chill_eventtype_admin_delete', methods: ['POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/{id}/delete', name: 'chill_eventtype_admin_delete', methods: ['POST', 'DELETE'])] public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse { $form = $this->createDeleteForm($id); @@ -76,7 +76,7 @@ class EventTypeController extends AbstractController /** * Displays a form to edit an existing EventType entity. */ - #[Route(path: '/{_locale}/admin/event/event_type/{id}/edit', name: 'chill_eventtype_admin_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/{id}/edit', name: 'chill_eventtype_admin_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -92,15 +92,15 @@ class EventTypeController extends AbstractController return $this->render('@ChillEvent/EventType/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } /** * Lists all EventType entities. */ - #[Route(path: '/{_locale}/admin/event/event_type/', name: 'chill_eventtype_admin', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/', name: 'chill_eventtype_admin', options: [null])] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -115,7 +115,7 @@ class EventTypeController extends AbstractController /** * Displays a form to create a new EventType entity. */ - #[Route(path: '/{_locale}/admin/event/event_type/new', name: 'chill_eventtype_admin_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/new', name: 'chill_eventtype_admin_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new EventType(); @@ -123,14 +123,14 @@ class EventTypeController extends AbstractController return $this->render('@ChillEvent/EventType/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a EventType entity. */ - #[Route(path: '/{_locale}/admin/event/event_type/{id}/show', name: 'chill_eventtype_admin_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/{id}/show', name: 'chill_eventtype_admin_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -145,14 +145,14 @@ class EventTypeController extends AbstractController return $this->render('@ChillEvent/EventType/show.html.twig', [ 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), + 'delete_form' => $deleteForm, ]); } /** * Edits an existing EventType entity. */ - #[Route(path: '/{_locale}/admin/event/event_type/{id}/update', name: 'chill_eventtype_admin_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/event_type/{id}/update', name: 'chill_eventtype_admin_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -175,8 +175,8 @@ class EventTypeController extends AbstractController return $this->render('@ChillEvent/EventType/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 562b224cd..4c458eb3d 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -44,7 +44,7 @@ final class ParticipationController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/create', name: 'chill_event_participation_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/create', name: 'chill_event_participation_create')] public function createAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { // test the request is correct @@ -195,7 +195,7 @@ final class ParticipationController extends AbstractController } return $this->render('@ChillEvent/Participation/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, ]); } @@ -233,7 +233,7 @@ final class ParticipationController extends AbstractController } return $this->render('@ChillEvent/Participation/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, 'ignored_participations' => [], ]); @@ -242,7 +242,7 @@ final class ParticipationController extends AbstractController /** * @param int $participation_id */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'], methods: ['GET', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/{participation_id}/delete', name: 'chill_event_participation_delete', requirements: ['participation_id' => '\d+'], methods: ['GET', 'DELETE'])] public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { $em = $this->managerRegistry->getManager(); @@ -280,7 +280,7 @@ final class ParticipationController extends AbstractController return $this->render('@ChillEvent/Participation/confirm_delete.html.twig', [ 'event_id' => $event->getId(), - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } @@ -290,7 +290,7 @@ final class ParticipationController extends AbstractController * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException if the participation is not found * @throws \Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException if the user is not allowed to edit the participation */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/edit', name: 'chill_event_participation_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/{participation_id}/edit', name: 'chill_event_participation_edit')] public function editAction(int $participation_id): Response { /** @var Participation $participation */ @@ -311,7 +311,7 @@ final class ParticipationController extends AbstractController $form = $this->createEditForm($participation); return $this->render('@ChillEvent/Participation/edit.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, ]); } @@ -321,7 +321,7 @@ final class ParticipationController extends AbstractController * * @param int $event_id */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{event_id}/edit_multiple', name: 'chill_event_participation_edit_multiple')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/{event_id}/edit_multiple', name: 'chill_event_participation_edit_multiple')] public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse { $event = $this->managerRegistry->getRepository(Event::class) @@ -366,7 +366,7 @@ final class ParticipationController extends AbstractController return $this->render('@ChillEvent/Participation/edit-multiple.html.twig', [ 'event' => $event, 'participations' => $event->getParticipations(), - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -377,7 +377,7 @@ final class ParticipationController extends AbstractController * and decide if it should process a single or multiple participation. Depending * on this, the appropriate layout and form. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/new', name: 'chill_event_participation_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/new', name: 'chill_event_participation_new')] public function newAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { // test the request is correct @@ -410,7 +410,7 @@ final class ParticipationController extends AbstractController ."'persons_ids' argument in query"); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/update', name: 'chill_event_participation_update', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/{participation_id}/update', name: 'chill_event_participation_update', methods: ['POST'])] public function updateAction(int $participation_id, Request $request): Response { /** @var Participation $participation */ @@ -447,12 +447,12 @@ final class ParticipationController extends AbstractController } return $this->render('@ChillEvent/Participation/edit.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{event_id}/update_multiple', name: 'chill_event_participation_update_multiple', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/event/participation/{event_id}/update_multiple', name: 'chill_event_participation_update_multiple', methods: ['POST'])] public function updateMultipleAction(mixed $event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { /** @var Event $event */ @@ -493,7 +493,7 @@ final class ParticipationController extends AbstractController return $this->render('@ChillEvent/Participation/edit-multiple.html.twig', [ 'event' => $event, 'participations' => $event->getParticipations(), - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -664,7 +664,7 @@ final class ParticipationController extends AbstractController return $this->render( '@ChillEvent/Participation/new-multiple.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participations' => $newParticipations, 'ignored_participations' => $ignoredParticipations, ] @@ -677,7 +677,7 @@ final class ParticipationController extends AbstractController return $this->render( '@ChillEvent/Participation/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, 'ignored_participations' => $ignoredParticipations, ] @@ -705,7 +705,7 @@ final class ParticipationController extends AbstractController $form = $this->createCreateForm($participation, $returnPath); return $this->render('@ChillEvent/Participation/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'participation' => $participation, 'ignored_participations' => [], // this is required, see self::newMultiple ]); diff --git a/src/Bundle/ChillEventBundle/Controller/RoleController.php b/src/Bundle/ChillEventBundle/Controller/RoleController.php index 2762ed813..2f01968ef 100644 --- a/src/Bundle/ChillEventBundle/Controller/RoleController.php +++ b/src/Bundle/ChillEventBundle/Controller/RoleController.php @@ -28,7 +28,7 @@ class RoleController extends AbstractController /** * Creates a new Role entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/create', name: 'chill_event_admin_role_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/create', name: 'chill_event_admin_role_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new Role(); @@ -45,14 +45,14 @@ class RoleController extends AbstractController return $this->render('@ChillEvent/Role/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Deletes a Role entity. */ - #[Route(path: '/{_locale}/admin/event/role/{id}/delete', name: 'chill_event_admin_role_delete', methods: ['POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/{id}/delete', name: 'chill_event_admin_role_delete', methods: ['POST', 'DELETE'])] public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse { $form = $this->createDeleteForm($id); @@ -76,7 +76,7 @@ class RoleController extends AbstractController /** * Displays a form to edit an existing Role entity. */ - #[Route(path: '/{_locale}/admin/event/role/{id}/edit', name: 'chill_event_admin_role_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/{id}/edit', name: 'chill_event_admin_role_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -92,15 +92,15 @@ class RoleController extends AbstractController return $this->render('@ChillEvent/Role/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } /** * Lists all Role entities. */ - #[Route(path: '/{_locale}/admin/event/role/', name: 'chill_event_admin_role', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/', name: 'chill_event_admin_role', options: [null])] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -115,7 +115,7 @@ class RoleController extends AbstractController /** * Displays a form to create a new Role entity. */ - #[Route(path: '/{_locale}/admin/event/role/new', name: 'chill_event_admin_role_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/new', name: 'chill_event_admin_role_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new Role(); @@ -123,14 +123,14 @@ class RoleController extends AbstractController return $this->render('@ChillEvent/Role/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a Role entity. */ - #[Route(path: '/{_locale}/admin/event/role/{id}/show', name: 'chill_event_admin_role_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/{id}/show', name: 'chill_event_admin_role_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -145,14 +145,14 @@ class RoleController extends AbstractController return $this->render('@ChillEvent/Role/show.html.twig', [ 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), + 'delete_form' => $deleteForm, ]); } /** * Edits an existing Role entity. */ - #[Route(path: '/{_locale}/admin/event/role/{id}/update', name: 'chill_event_admin_role_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/role/{id}/update', name: 'chill_event_admin_role_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -175,8 +175,8 @@ class RoleController extends AbstractController return $this->render('@ChillEvent/Role/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } diff --git a/src/Bundle/ChillEventBundle/Controller/StatusController.php b/src/Bundle/ChillEventBundle/Controller/StatusController.php index 975b884df..74d492f03 100644 --- a/src/Bundle/ChillEventBundle/Controller/StatusController.php +++ b/src/Bundle/ChillEventBundle/Controller/StatusController.php @@ -28,7 +28,7 @@ class StatusController extends AbstractController /** * Creates a new Status entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/create', name: 'chill_event_admin_status_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/create', name: 'chill_event_admin_status_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $entity = new Status(); @@ -45,14 +45,14 @@ class StatusController extends AbstractController return $this->render('@ChillEvent/Status/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Deletes a Status entity. */ - #[Route(path: '/{_locale}/admin/event/status/{id}/delete', name: 'chill_event_admin_status_delete', methods: ['POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/{id}/delete', name: 'chill_event_admin_status_delete', methods: ['POST', 'DELETE'])] public function deleteAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse { $form = $this->createDeleteForm($id); @@ -76,7 +76,7 @@ class StatusController extends AbstractController /** * Displays a form to edit an existing Status entity. */ - #[Route(path: '/{_locale}/admin/event/status/{id}/edit', name: 'chill_event_admin_status_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/{id}/edit', name: 'chill_event_admin_status_edit')] public function editAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -92,15 +92,15 @@ class StatusController extends AbstractController return $this->render('@ChillEvent/Status/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } /** * Lists all Status entities. */ - #[Route(path: '/{_locale}/admin/event/status/', name: 'chill_event_admin_status', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/', name: 'chill_event_admin_status', options: [null])] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -115,7 +115,7 @@ class StatusController extends AbstractController /** * Displays a form to create a new Status entity. */ - #[Route(path: '/{_locale}/admin/event/status/new', name: 'chill_event_admin_status_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/new', name: 'chill_event_admin_status_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $entity = new Status(); @@ -123,14 +123,14 @@ class StatusController extends AbstractController return $this->render('@ChillEvent/Status/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a Status entity. */ - #[Route(path: '/{_locale}/admin/event/status/{id}/show', name: 'chill_event_admin_status_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/{id}/show', name: 'chill_event_admin_status_show')] public function showAction(mixed $id): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -145,14 +145,14 @@ class StatusController extends AbstractController return $this->render('@ChillEvent/Status/show.html.twig', [ 'entity' => $entity, - 'delete_form' => $deleteForm->createView(), + 'delete_form' => $deleteForm, ]); } /** * Edits an existing Status entity. */ - #[Route(path: '/{_locale}/admin/event/status/{id}/update', name: 'chill_event_admin_status_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/event/status/{id}/update', name: 'chill_event_admin_status_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, mixed $id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -175,8 +175,8 @@ class StatusController extends AbstractController return $this->render('@ChillEvent/Status/edit.html.twig', [ 'entity' => $entity, - 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), + 'edit_form' => $editForm, + 'delete_form' => $deleteForm, ]); } diff --git a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php index 033bec0fb..7df0d51f5 100644 --- a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php +++ b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php @@ -66,7 +66,7 @@ class TimelineEventProvider implements TimelineProviderInterface * * @throws \Doctrine\ORM\Mapping\MappingException */ - public function fetchQuery($context, array $args) + public function fetchQuery($context, array $args): \Chill\MainBundle\Timeline\TimelineSingleQuery { $this->checkContext($context); diff --git a/src/Bundle/ChillFranceTravailApiBundle/src/Controller/RomeController.php b/src/Bundle/ChillFranceTravailApiBundle/src/Controller/RomeController.php index 5a26d590c..64234bc6d 100644 --- a/src/Bundle/ChillFranceTravailApiBundle/src/Controller/RomeController.php +++ b/src/Bundle/ChillFranceTravailApiBundle/src/Controller/RomeController.php @@ -29,7 +29,7 @@ class RomeController extends AbstractController $this->apiAppellation = $apiAppellation; } - #[Route(path: '/{_locale}/france-travail/appellation/search.{_format}', name: 'chill_france_travail_api_appellation_search')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/france-travail/appellation/search.{_format}', name: 'chill_france_travail_api_appellation_search')] public function appellationSearchAction(Request $request) { if (false === $request->query->has('q')) { diff --git a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php index b51d4a3de..5010fdc76 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php @@ -22,7 +22,7 @@ use Symfony\Component\Routing\Annotation\Route; class CSPersonController extends OneToOneEntityPersonCRUDController { - #[Route(path: '{_locale}/person/job/personal_situation/{id}/edit', name: 'chill_crud_job_personal_situation_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/job/personal_situation/{id}/edit', name: 'chill_crud_job_personal_situation_edit')] public function personalSituationEdit(Request $request, $id): Response { return $this->formEditAction( @@ -33,7 +33,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController ); } - #[Route(path: '{_locale}/person/job/dispositifs/{id}/edit', name: 'chill_crud_job_dispositifs_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/job/dispositifs/{id}/edit', name: 'chill_crud_job_dispositifs_edit')] public function dispositifsEdit(Request $request, $id): \Symfony\Component\HttpFoundation\Response { return $this->formEditAction( @@ -44,13 +44,13 @@ class CSPersonController extends OneToOneEntityPersonCRUDController ); } - #[Route(path: '{_locale}/person/job/{person}/personal_situation', name: 'chill_crud_job_personal_situation_view')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/job/{person}/personal_situation', name: 'chill_crud_job_personal_situation_view')] public function personalSituationView(Request $request, $person): Response { return $this->viewAction('ps_situation_view', $request, $person); } - #[Route(path: '{_locale}/person/job/{person}/dispositifs', name: 'chill_crud_job_dispositifs_view')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/job/{person}/dispositifs', name: 'chill_crud_job_dispositifs_view')] public function dispositifsView(Request $request, $person): Response { return $this->viewAction('dispositifs_view', $request, $person); diff --git a/src/Bundle/ChillJobBundle/src/Controller/CSReportController.php b/src/Bundle/ChillJobBundle/src/Controller/CSReportController.php index 0fb85f89c..513a98e13 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CSReportController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CSReportController.php @@ -26,7 +26,7 @@ class CSReportController extends AbstractController { public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[Route(path: '{_locale}/person/job/{person}/report', name: 'chill_job_report_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/job/{person}/report', name: 'chill_job_report_index')] public function index(Person $person): Response { $this->denyAccessUnlessGranted(PersonVoter::SEE, $person, 'The access to ' diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index 7e24a113e..9cbb1793a 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -39,14 +39,8 @@ abstract class AbstractCRUDController extends AbstractController */ protected array $crudConfig = []; - protected readonly SerializerInterface $serializer; - - protected readonly ManagerRegistry $managerRegistry; - - public function __construct(SerializerInterface $serializer, ManagerRegistry $managerRegistry) + public function __construct(protected readonly SerializerInterface $serializer, protected readonly ManagerRegistry $managerRegistry) { - $this->serializer = $serializer; - $this->managerRegistry = $managerRegistry; } /** diff --git a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php index 27476fcf2..9cc2621b3 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php +++ b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php @@ -66,7 +66,7 @@ class TwigCRUDResolver extends AbstractExtension /** * @return bool */ - public function hasAction($crudName, $action) + public function hasAction($crudName, $action): bool { return $this->resolver->hasAction($crudName, $action); } diff --git a/src/Bundle/ChillMainBundle/Controller/AbsenceController.php b/src/Bundle/ChillMainBundle/Controller/AbsenceController.php index 2a2a90e59..a24ed52d5 100644 --- a/src/Bundle/ChillMainBundle/Controller/AbsenceController.php +++ b/src/Bundle/ChillMainBundle/Controller/AbsenceController.php @@ -21,7 +21,7 @@ class AbsenceController extends AbstractController { public function __construct(private readonly ChillSecurity $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[Route(path: '/{_locale}/absence', name: 'chill_main_user_absence_index', methods: ['GET', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/absence', name: 'chill_main_user_absence_index', methods: ['GET', 'POST'])] public function setAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $user = $this->security->getUser(); @@ -38,11 +38,11 @@ class AbsenceController extends AbstractController return $this->render('@ChillMain/Menu/absence.html.twig', [ 'user' => $user, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[Route(path: '/{_locale}/absence/unset', name: 'chill_main_user_absence_unset', methods: ['GET', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/absence/unset', name: 'chill_main_user_absence_unset', methods: ['GET', 'POST'])] public function unsetAbsence(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillMainBundle/Controller/AddressApiController.php b/src/Bundle/ChillMainBundle/Controller/AddressApiController.php index f967bec86..c359bbb5e 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressApiController.php @@ -33,7 +33,7 @@ class AddressApiController extends ApiController /** * Duplicate an existing address. */ - #[Route(path: '/api/1.0/main/address/{id}/duplicate.json', name: 'chill_api_main_address_duplicate', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/{id}/duplicate.json', name: 'chill_api_main_address_duplicate', methods: ['POST'])] public function duplicate(#[MapEntity(id: 'id')] Address $address): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); diff --git a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php index 5df19bf37..7875e856d 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php @@ -29,7 +29,7 @@ final class AddressReferenceAPIController extends ApiController { public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {} - #[Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')] public function search(#[MapEntity(id: 'id')] PostalCode $postalCode, Request $request): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); diff --git a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php index 262c52b7f..fbba472db 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php @@ -26,7 +26,7 @@ class AddressToReferenceMatcherController { public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) {} - #[Route(path: '/api/1.0/main/address/reference-match/{id}/set/reviewed', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/set/reviewed', methods: ['POST'])] public function markAddressAsReviewed(#[MapEntity(id: 'id')] Address $address): JsonResponse { if (!$this->security->isGranted('ROLE_USER')) { @@ -48,7 +48,7 @@ class AddressToReferenceMatcherController /** * Set an address back to "to review". Only if the address is in "reviewed" state. */ - #[Route(path: '/api/1.0/main/address/reference-match/{id}/set/to_review', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/set/to_review', methods: ['POST'])] public function markAddressAsToReview(#[MapEntity(id: 'id')] Address $address): JsonResponse { if (!$this->security->isGranted('ROLE_USER')) { @@ -71,7 +71,7 @@ class AddressToReferenceMatcherController ); } - #[Route(path: '/api/1.0/main/address/reference-match/{id}/sync-with-reference', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/address/reference-match/{id}/sync-with-reference', methods: ['POST'])] public function syncAddressWithReference(#[MapEntity(id: 'id')] Address $address): JsonResponse { if (null === $address->getAddressReference()) { diff --git a/src/Bundle/ChillMainBundle/Controller/AdminController.php b/src/Bundle/ChillMainBundle/Controller/AdminController.php index a56eb7ce2..229a04f99 100644 --- a/src/Bundle/ChillMainBundle/Controller/AdminController.php +++ b/src/Bundle/ChillMainBundle/Controller/AdminController.php @@ -16,31 +16,31 @@ use Symfony\Component\Routing\Annotation\Route; class AdminController extends AbstractController { - #[Route(path: '/{_locale}/admin', name: 'chill_main_admin_central')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin', name: 'chill_main_admin_central')] public function indexAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Admin/index.html.twig'); } - #[Route(path: '/{_locale}/admin/language', name: 'chill_main_language_admin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/language', name: 'chill_main_language_admin')] public function indexLanguageAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Admin/indexLanguage.html.twig'); } - #[Route(path: '/{_locale}/admin/location', name: 'chill_main_location_admin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/location', name: 'chill_main_location_admin')] public function indexLocationAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Admin/indexLocation.html.twig'); } - #[Route(path: '/{_locale}/admin/user', name: 'chill_main_user_admin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/user', name: 'chill_main_user_admin')] public function indexUserAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Admin/indexUser.html.twig'); } - #[Route(path: '/{_locale}/admin/dashboard', name: 'chill_main_dashboard_admin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/dashboard', name: 'chill_main_dashboard_admin')] public function indexDashboardAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Admin/indexDashboard.html.twig'); diff --git a/src/Bundle/ChillMainBundle/Controller/DashboardApiController.php b/src/Bundle/ChillMainBundle/Controller/DashboardApiController.php index ffc23da81..b92bc4f4f 100644 --- a/src/Bundle/ChillMainBundle/Controller/DashboardApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/DashboardApiController.php @@ -25,7 +25,7 @@ final readonly class DashboardApiController /** * Get user dashboard config (not yet based on user id and still hardcoded for now). */ - #[Route(path: '/api/1.0/main/dashboard-config-item.json', methods: ['get'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/dashboard-config-item.json', methods: ['get'])] public function getDashboardConfiguration(): JsonResponse { $data = []; diff --git a/src/Bundle/ChillMainBundle/Controller/DefaultController.php b/src/Bundle/ChillMainBundle/Controller/DefaultController.php index 4733190dd..3f3f3422f 100644 --- a/src/Bundle/ChillMainBundle/Controller/DefaultController.php +++ b/src/Bundle/ChillMainBundle/Controller/DefaultController.php @@ -18,7 +18,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; */ class DefaultController extends AbstractController { - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/homepage', name: 'chill_main_homepage')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/homepage', name: 'chill_main_homepage')] public function indexAction(): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if ($this->isGranted('ROLE_ADMIN')) { @@ -28,7 +28,7 @@ class DefaultController extends AbstractController return $this->render('@ChillMain/layout.html.twig'); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/homepage', name: 'chill_main_homepage_without_locale')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/homepage', name: 'chill_main_homepage_without_locale')] public function indexWithoutLocaleAction(): \Symfony\Component\HttpFoundation\RedirectResponse { return $this->redirectToRoute('chill_main_homepage'); diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index dc8d1a91a..e15100bab 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -66,7 +66,7 @@ class ExportController extends AbstractController $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - #[Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])] public function downloadResultAction(Request $request, mixed $alias): Response { /** @var ExportManager $exportManager */ @@ -107,7 +107,7 @@ class ExportController extends AbstractController * * @param string $alias */ - #[Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])] public function generateAction(Request $request, $alias): Response { /** @var ExportManager $exportManager */ @@ -128,7 +128,7 @@ class ExportController extends AbstractController /** * @throws \RedisException */ - #[Route(path: '/{_locale}/exports/generate-from-saved/{id}', name: 'chill_main_export_generate_from_saved')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/generate-from-saved/{id}', name: 'chill_main_export_generate_from_saved')] public function generateFromSavedExport(#[MapEntity(id: 'id')] SavedExport $savedExport): RedirectResponse { $this->denyAccessUnlessGranted(SavedExportVoter::GENERATE, $savedExport); @@ -150,7 +150,7 @@ class ExportController extends AbstractController /** * Render the list of available exports. */ - #[Route(path: '/{_locale}/exports/', name: 'chill_main_export_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/', name: 'chill_main_export_index')] public function indexAction(): Response { $exportManager = $this->exportManager; @@ -174,7 +174,7 @@ class ExportController extends AbstractController * 3. 'generate': gather data from session from the previous steps, and * make a redirection to the "generate" action with data in query (HTTP GET) */ - #[Route(path: '/{_locale}/exports/new/{alias}', name: 'chill_main_export_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/new/{alias}', name: 'chill_main_export_new')] public function newAction(Request $request, string $alias): Response { // first check for ACL @@ -198,7 +198,7 @@ class ExportController extends AbstractController }; } - #[Route(path: '/{_locale}/export/saved/update-from-key/{id}/{key}', name: 'chill_main_export_saved_edit_options_from_key')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/export/saved/update-from-key/{id}/{key}', name: 'chill_main_export_saved_edit_options_from_key')] public function editSavedExportOptionsFromKey(#[MapEntity(id: 'id')] SavedExport $savedExport, string $key): Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -218,7 +218,7 @@ class ExportController extends AbstractController return $this->redirectToRoute('chill_main_export_saved_edit', ['id' => $savedExport->getId()]); } - #[Route(path: '/{_locale}/export/save-from-key/{alias}/{key}', name: 'chill_main_export_save_from_key')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/export/save-from-key/{alias}/{key}', name: 'chill_main_export_save_from_key')] public function saveFromKey(string $alias, string $key, Request $request): Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -250,7 +250,7 @@ class ExportController extends AbstractController return $this->render( '@ChillMain/SavedExport/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'saved_export' => $savedExport, ] ); @@ -368,7 +368,7 @@ class ExportController extends AbstractController } return $this->render('@ChillMain/Export/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'export_alias' => $alias, 'export' => $export, 'export_group' => $this->getExportGroup($export), @@ -418,7 +418,7 @@ class ExportController extends AbstractController return $this->render( '@ChillMain/Export/new_formatter_step.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'export' => $export, 'export_group' => $this->getExportGroup($export), ] @@ -560,7 +560,7 @@ class ExportController extends AbstractController return $this->render( '@ChillMain/Export/new_centers_step.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'export' => $export, 'export_group' => $this->getExportGroup($export), ] diff --git a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php index b2e304eb6..7af7267d6 100644 --- a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php @@ -27,7 +27,7 @@ class GeographicalUnitByAddressApiController { public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) {} - #[Route(path: '/api/1.0/main/geographical-unit/by-address/{id}.{_format}', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/geographical-unit/by-address/{id}.{_format}', requirements: ['_format' => 'json'])] public function getGeographicalUnitCoveringAddress(#[MapEntity(id: 'id')] Address $address): JsonResponse { if (!$this->security->isGranted('ROLE_USER')) { diff --git a/src/Bundle/ChillMainBundle/Controller/LoginController.php b/src/Bundle/ChillMainBundle/Controller/LoginController.php index ca4717728..894de1d4f 100644 --- a/src/Bundle/ChillMainBundle/Controller/LoginController.php +++ b/src/Bundle/ChillMainBundle/Controller/LoginController.php @@ -34,7 +34,7 @@ class LoginController extends AbstractController /** * Show a login form. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/login', name: 'login')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/login', name: 'login')] public function loginAction(Request $request): Response { return $this->render('@ChillMain/Login/login.html.twig', [ diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php index e122b7a3b..d27ea898c 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php @@ -30,7 +30,7 @@ class NewsItemApiController /** * Get list of news items filtered on start and end date. */ - #[Route(path: '/api/1.0/main/news/current.json', methods: ['get'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/news/current.json', methods: ['get'])] public function listCurrentNewsItems(): JsonResponse { $total = $this->newsItemRepository->countCurrentNews(); diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php index e914515ea..89963ef24 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php @@ -34,7 +34,7 @@ final readonly class NewsItemHistoryController private readonly Environment $environment, ) {} - #[Route(path: '/{_locale}/news-items/history', name: 'chill_main_news_items_history')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/news-items/history', name: 'chill_main_news_items_history')] public function list(): Response { $filter = $this->buildFilterOrder(); @@ -55,7 +55,7 @@ final readonly class NewsItemHistoryController * @throws RuntimeError * @throws LoaderError */ - #[Route(path: '/{_locale}/news-items/{id}', name: 'chill_main_single_news_item')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/news-items/{id}', name: 'chill_main_single_news_item')] public function showSingleItem(#[MapEntity(id: 'id')] NewsItem $newsItem, Request $request): Response { return new Response($this->environment->render( diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php index 23621ba36..c98e2b46f 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php @@ -27,24 +27,24 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Serializer\SerializerInterface; -#[Route(path: '/api/1.0/main/notification')] +#[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/notification')] class NotificationApiController { public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {} - #[Route(path: '/{id}/mark/read', name: 'chill_api_main_notification_mark_read', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/mark/read', name: 'chill_api_main_notification_mark_read', methods: ['POST'])] public function markAsRead(#[MapEntity(id: 'id')] Notification $notification): JsonResponse { return $this->markAs('read', $notification); } - #[Route(path: '/{id}/mark/unread', name: 'chill_api_main_notification_mark_unread', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/mark/unread', name: 'chill_api_main_notification_mark_unread', methods: ['POST'])] public function markAsUnread(#[MapEntity(id: 'id')] Notification $notification): JsonResponse { return $this->markAs('unread', $notification); } - #[Route(path: '/my/unread')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/my/unread')] public function myUnreadNotifications(Request $request): JsonResponse { $total = $this->notificationRepository->countUnreadByUser($this->security->getUser()); @@ -96,7 +96,7 @@ class NotificationApiController return new JsonResponse(null, JsonResponse::HTTP_ACCEPTED, [], false); } - #[Route(path: '/mark/allread', name: 'chill_api_main_notification_mark_allread', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/mark/allread', name: 'chill_api_main_notification_mark_allread', methods: ['POST'])] public function markAllRead(): JsonResponse { $user = $this->security->getUser(); @@ -110,7 +110,7 @@ class NotificationApiController return new JsonResponse($modifiedNotificationIds); } - #[Route(path: '/mark/undoallread', name: 'chill_api_main_notification_mark_undoallread', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/mark/undoallread', name: 'chill_api_main_notification_mark_undoallread', methods: ['POST'])] public function undoAllRead(Request $request): JsonResponse { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationController.php b/src/Bundle/ChillMainBundle/Controller/NotificationController.php index 02a70f361..10fd32715 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationController.php @@ -36,12 +36,12 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -#[Route(path: '/{_locale}/notification')] +#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/notification')] class NotificationController extends AbstractController { public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly ChillSecurity $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[Route(path: '/create', name: 'chill_main_notification_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/create', name: 'chill_main_notification_create')] public function createAction(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -93,13 +93,13 @@ class NotificationController extends AbstractController } return $this->render('@ChillMain/Notification/create.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'handler' => $handler, 'notification' => $notification, ]); } - #[Route(path: '/{id}/edit', name: 'chill_main_notification_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/edit', name: 'chill_main_notification_edit')] public function editAction(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response { $this->denyAccessUnlessGranted(NotificationVoter::NOTIFICATION_UPDATE, $notification); @@ -121,13 +121,13 @@ class NotificationController extends AbstractController } return $this->render('@ChillMain/Notification/edit.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'handler' => $this->notificationHandlerManager->getHandler($notification), 'notification' => $notification, ]); } - #[Route(path: '/{id}/access_key', name: 'chill_main_notification_grant_access_by_access_key')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/access_key', name: 'chill_main_notification_grant_access_by_access_key')] public function getAccessByAccessKey(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -167,7 +167,7 @@ class NotificationController extends AbstractController return $this->redirectToRoute('chill_main_notification_show', ['id' => $notification->getId()]); } - #[Route(path: '/inbox', name: 'chill_main_notification_my')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/inbox', name: 'chill_main_notification_my')] public function inboxAction(): Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -191,7 +191,7 @@ class NotificationController extends AbstractController ]); } - #[Route(path: '/sent', name: 'chill_main_notification_sent')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/sent', name: 'chill_main_notification_sent')] public function sentAction(): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -215,7 +215,7 @@ class NotificationController extends AbstractController ]); } - #[Route(path: '/{id}/show', name: 'chill_main_notification_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{id}/show', name: 'chill_main_notification_show')] public function showAction(#[MapEntity(id: 'id')] Notification $notification, Request $request): Response { $this->denyAccessUnlessGranted(NotificationVoter::NOTIFICATION_SEE, $notification); diff --git a/src/Bundle/ChillMainBundle/Controller/PasswordController.php b/src/Bundle/ChillMainBundle/Controller/PasswordController.php index deb4d0b10..a5b0f9ae0 100644 --- a/src/Bundle/ChillMainBundle/Controller/PasswordController.php +++ b/src/Bundle/ChillMainBundle/Controller/PasswordController.php @@ -44,13 +44,13 @@ final class PasswordController extends AbstractController /** * @return Response */ - #[Route(path: '/public/{_locale}/password/request-changed', name: 'password_request_recover_changed')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-changed', name: 'password_request_recover_changed')] public function changeConfirmedAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Password/recover_password_changed.html.twig'); } - #[Route(path: '/public/{_locale}/password/recover', name: 'password_recover')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/recover', name: 'password_recover')] public function recoverAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) { @@ -109,7 +109,7 @@ final class PasswordController extends AbstractController } return $this->render('@ChillMain/Password/recover_password_form.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -117,7 +117,7 @@ final class PasswordController extends AbstractController * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - #[Route(path: '/public/{_locale}/password/request-recover', name: 'password_request_recover')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-recover', name: 'password_request_recover')] public function requestRecoverAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) { @@ -182,14 +182,14 @@ final class PasswordController extends AbstractController } return $this->render('@ChillMain/Password/request_recover_password.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } /** * @return Response */ - #[Route(path: '/public/{_locale}/password/request-confirm', name: 'password_request_recover_confirm')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/public/{_locale}/password/request-confirm', name: 'password_request_recover_confirm')] public function requestRecoverConfirmAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillMain/Password/request_recover_password_confirm.html.twig'); @@ -198,7 +198,7 @@ final class PasswordController extends AbstractController /** * @return Response */ - #[Route(path: '/{_locale}/my/password', name: 'change_my_password')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/my/password', name: 'change_my_password')] public function UserPasswordAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if (!$this->security->isGranted('ROLE_USER')) { @@ -239,7 +239,7 @@ final class PasswordController extends AbstractController // render into a template return $this->render('@ChillMain/Password/password.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, ]); } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php index e940fb7ce..1639a46c3 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php @@ -26,7 +26,7 @@ class PermissionApiController extends AbstractController /** * @throws \Symfony\Component\Serializer\Exception\ExceptionInterface */ - #[Route(path: '/api/1.0/main/permissions/info.json', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/permissions/info.json', methods: ['POST'])] public function getPermissions(Request $request): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 602925b67..68a89e8f5 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -50,7 +50,7 @@ final class PermissionsGroupController extends AbstractController private readonly RoleScopeRepository $roleScopeRepository, ) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope', name: 'admin_permissionsgroup_add_role_scope', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope', name: 'admin_permissionsgroup_add_role_scope', methods: ['POST'])] public function addLinkRoleScopeAction(Request $request, int $id): Response { $permissionsGroup = $this->permissionsGroupRepository->find($id); @@ -118,18 +118,18 @@ final class PermissionsGroupController extends AbstractController return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [ 'entity' => $permissionsGroup, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, 'role_scopes_sorted' => $roleScopesSorted, 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), - 'add_role_scopes_form' => $addRoleScopesForm->createView(), + 'add_role_scopes_form' => $addRoleScopesForm, ]); } /** * Creates a new PermissionsGroup entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/create', name: 'admin_permissionsgroup_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/create', name: 'admin_permissionsgroup_create', methods: ['POST'])] public function createAction(Request $request): Response { $permissionsGroup = new PermissionsGroup(); @@ -145,14 +145,14 @@ final class PermissionsGroupController extends AbstractController return $this->render('@ChillMain/PermissionsGroup/new.html.twig', [ 'entity' => $permissionsGroup, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * remove an association between permissionsGroup and roleScope. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/permissionsgroup/{pgid}/delete_link_role_scope/{rsid}', name: 'admin_permissionsgroup_delete_role_scope', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{pgid}/delete_link_role_scope/{rsid}', name: 'admin_permissionsgroup_delete_role_scope', methods: ['POST'])] public function deleteLinkRoleScopeAction(int $pgid, int $rsid): Response { $permissionsGroup = $this->permissionsGroupRepository->find($pgid); @@ -209,7 +209,7 @@ final class PermissionsGroupController extends AbstractController /** * Displays a form to edit an existing PermissionsGroup entity. */ - #[Route(path: '/{_locale}/admin/permissionsgroup/{id}/edit', name: 'admin_permissionsgroup_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/edit', name: 'admin_permissionsgroup_edit')] public function editAction(int $id): Response { $permissionsGroup = $this->permissionsGroupRepository->find($id); @@ -246,17 +246,17 @@ final class PermissionsGroupController extends AbstractController return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [ 'entity' => $permissionsGroup, 'role_scopes_sorted' => $roleScopesSorted, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), - 'add_role_scopes_form' => $addRoleScopesForm->createView(), + 'add_role_scopes_form' => $addRoleScopesForm, ]); } /** * Lists all PermissionsGroup entities. */ - #[Route(path: '/{_locale}/admin/permissionsgroup/', name: 'admin_permissionsgroup')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/', name: 'admin_permissionsgroup')] public function indexAction(): Response { $entities = $this->permissionsGroupRepository->findAllOrderedAlphabetically(); @@ -269,7 +269,7 @@ final class PermissionsGroupController extends AbstractController /** * Displays a form to create a new PermissionsGroup entity. */ - #[Route(path: '/{_locale}/admin/permissionsgroup/new', name: 'admin_permissionsgroup_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/new', name: 'admin_permissionsgroup_new')] public function newAction(): Response { $permissionsGroup = new PermissionsGroup(); @@ -277,14 +277,14 @@ final class PermissionsGroupController extends AbstractController return $this->render('@ChillMain/PermissionsGroup/new.html.twig', [ 'entity' => $permissionsGroup, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Finds and displays a PermissionsGroup entity. */ - #[Route(path: '/{_locale}/admin/permissionsgroup/{id}/show', name: 'admin_permissionsgroup_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/show', name: 'admin_permissionsgroup_show')] public function showAction(int $id): Response { $permissionsGroup = $this->permissionsGroupRepository->find($id); @@ -336,7 +336,7 @@ final class PermissionsGroupController extends AbstractController /** * Edits an existing PermissionsGroup entity. */ - #[Route(path: '/{_locale}/admin/permissionsgroup/{id}/update', name: 'admin_permissionsgroup_update', methods: ['POST', 'PUT'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/permissionsgroup/{id}/update', name: 'admin_permissionsgroup_update', methods: ['POST', 'PUT'])] public function updateAction(Request $request, int $id): Response { $permissionsGroup = $this->permissionsGroupRepository @@ -380,10 +380,10 @@ final class PermissionsGroupController extends AbstractController return $this->render('@ChillMain/PermissionsGroup/edit.html.twig', [ 'entity' => $permissionsGroup, 'role_scopes_sorted' => $roleScopesSorted, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), - 'add_role_scopes_form' => $addRoleScopesForm->createView(), + 'add_role_scopes_form' => $addRoleScopesForm, ]); } diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index cd13ad455..d282957e6 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -28,7 +28,7 @@ final class PostalCodeAPIController extends ApiController { public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {} - #[Route(path: '/api/1.0/main/postal-code/search.json')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/postal-code/search.json')] public function search(Request $request): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php index edd8efda8..731b0b44c 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php @@ -37,7 +37,7 @@ class PostalCodeController extends AbstractController /** * @return JsonResponse */ - #[Route(path: '{_locale}/postalcode/search')] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/postalcode/search')] public function searchAction(Request $request) { $pattern = $request->query->getAlnum('q', ''); diff --git a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php index e1f92ddf8..f8f92f181 100644 --- a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php @@ -37,7 +37,7 @@ class SavedExportController { public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly RequestStack $requestStack, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) {} - #[Route(path: '/{_locale}/exports/saved/{id}/delete', name: 'chill_main_export_saved_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/{id}/delete', name: 'chill_main_export_saved_delete')] public function delete(#[MapEntity(id: 'id')] SavedExport $savedExport, Request $request): Response { if (!$this->security->isGranted(SavedExportVoter::DELETE, $savedExport)) { @@ -70,7 +70,7 @@ class SavedExportController ); } - #[Route(path: '/{_locale}/exports/saved/{id}/edit', name: 'chill_main_export_saved_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/{id}/edit', name: 'chill_main_export_saved_edit')] public function edit(#[MapEntity(id: 'id')] SavedExport $savedExport, Request $request): Response { if (!$this->security->isGranted(SavedExportVoter::EDIT, $savedExport)) { @@ -101,7 +101,7 @@ class SavedExportController ); } - #[Route(path: '/{_locale}/exports/saved/my', name: 'chill_main_export_saved_list_my')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/exports/saved/my', name: 'chill_main_export_saved_list_my')] public function list(): Response { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeController.php b/src/Bundle/ChillMainBundle/Controller/ScopeController.php index e64c31f0f..be61c6d5f 100644 --- a/src/Bundle/ChillMainBundle/Controller/ScopeController.php +++ b/src/Bundle/ChillMainBundle/Controller/ScopeController.php @@ -35,7 +35,7 @@ class ScopeController extends AbstractController /** * Creates a new Scope entity. */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/scope/create', name: 'admin_scope_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/create', name: 'admin_scope_create', methods: ['POST'])] public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $scope = new Scope(); @@ -52,14 +52,14 @@ class ScopeController extends AbstractController return $this->render('@ChillMain/Scope/new.html.twig', [ 'entity' => $scope, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * Displays a form to edit an existing Scope entity. */ - #[Route(path: '/{_locale}/admin/scope/{id}/edit', name: 'admin_scope_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/{id}/edit', name: 'admin_scope_edit')] public function editAction(#[MapEntity(id: 'id')] Scope $scope, Request $request): Response { $editForm = $this->createEditForm($scope); @@ -73,14 +73,14 @@ class ScopeController extends AbstractController return $this->render('@ChillMain/Scope/edit.html.twig', [ 'entity' => $scope, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } /** * Lists all Scope entities. */ - #[Route(path: '/{_locale}/admin/scope/', name: 'admin_scope')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/', name: 'admin_scope')] public function indexAction(): \Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -95,7 +95,7 @@ class ScopeController extends AbstractController /** * Displays a form to create a new Scope entity. */ - #[Route(path: '/{_locale}/admin/scope/new', name: 'admin_scope_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/scope/new', name: 'admin_scope_new')] public function newAction(): \Symfony\Component\HttpFoundation\Response { $scope = new Scope(); @@ -103,7 +103,7 @@ class ScopeController extends AbstractController return $this->render('@ChillMain/Scope/new.html.twig', [ 'entity' => $scope, - 'form' => $form->createView(), + 'form' => $form, ]); } diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index 3e003493c..046178c5e 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -34,7 +34,7 @@ class SearchController extends AbstractController { public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced/{name}', name: 'chill_main_advanced_search')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search/advanced/{name}', name: 'chill_main_advanced_search')] public function advancedSearchAction(mixed $name, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { try { @@ -79,7 +79,7 @@ class SearchController extends AbstractController ); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search/advanced', name: 'chill_main_advanced_search_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search/advanced', name: 'chill_main_advanced_search_list')] public function advancedSearchListAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { /** @var Chill\MainBundle\Search\SearchProvider $variable */ @@ -96,7 +96,7 @@ class SearchController extends AbstractController return $this->render('@ChillMain/Search/choose_list.html.twig'); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/search.{_format}', name: 'chill_main_search', requirements: ['_format' => 'html|json', '_locale' => '[a-z]{1,3}'], defaults: ['_format' => 'html'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/search.{_format}', name: 'chill_main_search', requirements: ['_format' => 'html|json', '_locale' => '[a-z]{1,3}'], defaults: ['_format' => 'html'])] public function searchAction(Request $request, mixed $_format) { $pattern = trim((string) $request->query->get('q', '')); @@ -186,7 +186,7 @@ class SearchController extends AbstractController ); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/api/1.0/search.{_format}', name: 'chill_main_search_global', requirements: ['_format' => 'json'], defaults: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/search.{_format}', name: 'chill_main_search_global', requirements: ['_format' => 'json'], defaults: ['_format' => 'json'])] public function searchApi(Request $request, mixed $_format): JsonResponse { // TODO this is an incomplete implementation diff --git a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php index 254db432c..e1afab222 100644 --- a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php @@ -22,7 +22,7 @@ class TimelineCenterController extends AbstractController { public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) {} - #[Route(path: '/{_locale}/center/timeline', name: 'chill_center_timeline', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/center/timeline', name: 'chill_center_timeline', methods: ['GET'])] public function centerAction(Request $request): \Symfony\Component\HttpFoundation\Response { // collect reachable center for each group diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index 262bfdfde..67d153d2f 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -24,7 +24,7 @@ class UserApiController extends ApiController { public function __construct(private readonly ChillSecurity $security) {} - #[Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])] public function currentLocation(mixed $_format): JsonResponse { if (!$this->isGranted('ROLE_USER')) { @@ -39,7 +39,7 @@ class UserApiController extends ApiController ); } - #[Route(path: '/api/1.0/main/whoami.{_format}', name: 'chill_main_user_whoami', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/whoami.{_format}', name: 'chill_main_user_whoami', requirements: ['_format' => 'json'])] public function whoami(mixed $_format): JsonResponse { return $this->json( diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index 24c505723..73930b4e6 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -53,7 +53,7 @@ class UserController extends CRUDController private readonly ManagerRegistry $managerRegistry, ) {} - #[Route(path: '/{_locale}/admin/main/user/{uid}/add_link_groupcenter', name: 'admin_user_add_groupcenter')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{uid}/add_link_groupcenter', name: 'admin_user_add_groupcenter')] public function addLinkGroupCenterAction(Request $request, mixed $uid): Response { $em = $this->managerRegistry->getManager(); @@ -98,7 +98,7 @@ class UserController extends CRUDController 'entity' => $user, 'access_permissions_group_list' => $this->parameterBag->get('chill_main.access_permissions_group_list'), 'edit_form' => $this->createEditForm($user)->createView(), - 'add_groupcenter_form' => $this->createAddLinkGroupCenterForm($user, $request)->createView(), + 'add_groupcenter_form' => $this->createAddLinkGroupCenterForm($user, $request), 'delete_groupcenter_form' => array_map( static fn (Form $form) => $form->createView(), iterator_to_array($this->getDeleteLinkGroupCenterByUser($user, $request), true) @@ -106,7 +106,7 @@ class UserController extends CRUDController ]); } - #[Route(path: '/{_locale}/admin/main/user/{uid}/delete_link_groupcenter/{gcid}', name: 'admin_user_delete_groupcenter')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{uid}/delete_link_groupcenter/{gcid}', name: 'admin_user_delete_groupcenter')] public function deleteLinkGroupCenterAction(mixed $uid, mixed $gcid, Request $request): RedirectResponse { $em = $this->managerRegistry->getManager(); @@ -204,7 +204,7 @@ class UserController extends CRUDController /** * Displays a form to edit the user current location. */ - #[Route(path: '/{_locale}/main/user/current-location/edit', name: 'chill_main_user_currentlocation_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/user/current-location/edit', name: 'chill_main_user_currentlocation_edit')] public function editCurrentLocationAction(Request $request): RedirectResponse|Response { $user = $this->security->getUser(); @@ -228,14 +228,14 @@ class UserController extends CRUDController return $this->render('@ChillMain/User/edit_current_location.html.twig', [ 'entity' => $user, - 'edit_form' => $form->createView(), + 'edit_form' => $form, ]); } /** * Displays a form to edit the user password. */ - #[Route(path: '/{_locale}/admin/user/{id}/edit_password', name: 'admin_user_edit_password')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/user/{id}/edit_password', name: 'admin_user_edit_password')] public function editPasswordAction(#[MapEntity(id: 'id')] User $user, Request $request): RedirectResponse|Response { $editForm = $this->createEditPasswordForm($user); @@ -263,7 +263,7 @@ class UserController extends CRUDController return $this->render('@ChillMain/User/edit_password.html.twig', [ 'entity' => $user, - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, ]); } diff --git a/src/Bundle/ChillMainBundle/Controller/UserExportController.php b/src/Bundle/ChillMainBundle/Controller/UserExportController.php index c38d89136..9ce130823 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserExportController.php @@ -34,7 +34,7 @@ final readonly class UserExportController * @throws \League\Csv\Exception * @throws \League\Csv\UnavailableStream */ - #[Route(path: '/{_locale}/admin/main/users/export/list.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/users/export/list.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_list')] public function userList(Request $request, string $_format = 'csv'): StreamedResponse { if (!$this->security->isGranted('ROLE_ADMIN')) { @@ -95,7 +95,7 @@ final readonly class UserExportController * @throws \League\Csv\Exception * @throws \League\Csv\UnavailableStream */ - #[Route(path: '/{_locale}/admin/main/users/export/permissions.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_permissions')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/users/export/permissions.{_format}', requirements: ['_format' => 'csv'], name: 'chill_main_users_export_permissions')] public function userPermissionsList(string $_format = 'csv'): StreamedResponse { if (!$this->security->isGranted('ROLE_ADMIN')) { diff --git a/src/Bundle/ChillMainBundle/Controller/UserGroupController.php b/src/Bundle/ChillMainBundle/Controller/UserGroupController.php index c9e0102a3..7b974727f 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserGroupController.php @@ -50,7 +50,7 @@ final readonly class UserGroupController private ChillEntityRenderManagerInterface $chillEntityRenderManager, ) {} - #[Route('/{_locale}/main/user-groups/my', name: 'chill_main_user_groups_my')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-groups/my', name: 'chill_main_user_groups_my')] public function myUserGroups(): Response { if (!$this->security->isGranted('ROLE_USER')) { @@ -80,7 +80,7 @@ final readonly class UserGroupController ])); } - #[Route('/{_locale}/main/user-groups/{id}/append', name: 'chill_main_user_groups_append_users')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-groups/{id}/append', name: 'chill_main_user_groups_append_users')] public function appendUsersToGroup(UserGroup $userGroup, Request $request, Session $session): Response { if (!$this->security->isGranted(UserGroupVoter::APPEND_TO_GROUP, $userGroup)) { @@ -130,7 +130,7 @@ final readonly class UserGroupController /** * @ParamConverter("user", class=User::class, options={"id" = "userId"}) */ - #[Route('/{_locale}/main/user-group/{id}/user/{userId}/remove', name: 'chill_main_user_groups_remove_user')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/user-group/{id}/user/{userId}/remove', name: 'chill_main_user_groups_remove_user')] public function removeUserToGroup(UserGroup $userGroup, User $user, Session $session): Response { if (!$this->security->isGranted(UserGroupVoter::APPEND_TO_GROUP, $userGroup)) { diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php b/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php index c2b76e2c5..444d62c12 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php @@ -24,7 +24,7 @@ class UserJobScopeHistoriesController extends AbstractController private readonly Environment $engine, ) {} - #[Route(path: '/{_locale}/admin/main/user/{id}/job-scope-history', name: 'admin_user_job_scope_history')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/main/user/{id}/job-scope-history', name: 'admin_user_job_scope_history')] public function indexAction(#[MapEntity(id: 'id')] User $user): Response { $jobHistories = $user->getUserJobHistoriesOrdered(); diff --git a/src/Bundle/ChillMainBundle/Controller/UserProfileController.php b/src/Bundle/ChillMainBundle/Controller/UserProfileController.php index de86495c7..4ac9f0095 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserProfileController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserProfileController.php @@ -33,7 +33,7 @@ final class UserProfileController extends AbstractController /** * User profile that allows editing of phonenumber and visualization of certain data. */ - #[Route(path: '/{_locale}/main/user/my-profile', name: 'chill_main_user_profile')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/user/my-profile', name: 'chill_main_user_profile')] public function __invoke(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if (!$this->security->isGranted('ROLE_USER')) { @@ -57,7 +57,7 @@ final class UserProfileController extends AbstractController return $this->render('@ChillMain/User/profile.html.twig', [ 'user' => $user, - 'form' => $editForm->createView(), + 'form' => $editForm, ]); } diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowAddSignatureController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowAddSignatureController.php index 96a0d5c6d..6a724c3ec 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowAddSignatureController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowAddSignatureController.php @@ -38,7 +38,7 @@ final readonly class WorkflowAddSignatureController private Security $security, ) {} - #[Route(path: '/{_locale}/main/workflow/signature/{id}/sign', name: 'chill_main_workflow_signature_add', methods: 'GET')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/signature/{id}/sign', name: 'chill_main_workflow_signature_add', methods: 'GET')] public function __invoke(EntityWorkflowStepSignature $signature, Request $request): Response { if (!$this->security->isGranted(EntityWorkflowStepSignatureVoter::SIGN, $signature)) { diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php index 628911e59..8638488ac 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php @@ -35,7 +35,7 @@ class WorkflowApiController /** * Return a list of workflow which are waiting an action for the user. */ - #[Route(path: '/api/1.0/main/workflow/my', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/my', methods: ['GET'])] public function myWorkflow(Request $request): JsonResponse { if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) { @@ -73,7 +73,7 @@ class WorkflowApiController /** * Return a list of workflow which are waiting an action for the user. */ - #[Route(path: '/api/1.0/main/workflow/my-cc', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/my-cc', methods: ['GET'])] public function myWorkflowCc(Request $request): JsonResponse { if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) { @@ -108,13 +108,13 @@ class WorkflowApiController ); } - #[Route(path: '/api/1.0/main/workflow/{id}/subscribe', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/{id}/subscribe', methods: ['POST'])] public function subscribe(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response { return $this->handleSubscription($entityWorkflow, $request, 'subscribe'); } - #[Route(path: '/api/1.0/main/workflow/{id}/unsubscribe', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/main/workflow/{id}/unsubscribe', methods: ['POST'])] public function unsubscribe(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response { return $this->handleSubscription($entityWorkflow, $request, 'unsubscribe'); diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowAttachmentController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowAttachmentController.php index b8b07573a..b2a73fec9 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowAttachmentController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowAttachmentController.php @@ -37,7 +37,7 @@ class WorkflowAttachmentController private readonly AddAttachmentAction $addAttachmentAction, ) {} - #[Route('/api/1.0/main/workflow/{id}/attachment', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/{id}/attachment', methods: ['POST'])] public function addAttachment(EntityWorkflow $entityWorkflow, Request $request): JsonResponse { if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $entityWorkflow)) { @@ -69,7 +69,7 @@ class WorkflowAttachmentController ); } - #[Route('/api/1.0/main/workflow/attachment/{id}', methods: ['DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/attachment/{id}', methods: ['DELETE'])] public function removeAttachment(EntityWorkflowAttachment $attachment): Response { if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $attachment->getEntityWorkflow())) { @@ -82,7 +82,7 @@ class WorkflowAttachmentController return new Response(null, Response::HTTP_NO_CONTENT); } - #[Route('/api/1.0/main/workflow/{id}/attachment', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/main/workflow/{id}/attachment', methods: ['GET'])] public function listAttachmentsForEntityWorkflow(EntityWorkflow $entityWorkflow): JsonResponse { if (!$this->security->isGranted(EntityWorkflowVoter::SEE, $entityWorkflow)) { diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index 64e66ea17..c27bfcff9 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -57,7 +57,7 @@ class WorkflowController extends AbstractController private readonly EntityWorkflowStepSignatureRepository $entityWorkflowStepSignatureRepository, ) {} - #[Route(path: '/{_locale}/main/workflow/create', name: 'chill_main_workflow_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/create', name: 'chill_main_workflow_create')] public function create(Request $request): Response { if (!$request->query->has('entityClass')) { @@ -101,7 +101,7 @@ class WorkflowController extends AbstractController return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]); } - #[Route(path: '/{_locale}/main/workflow/{id}/delete', name: 'chill_main_workflow_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/delete', name: 'chill_main_workflow_delete')] public function delete(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response { $this->denyAccessUnlessGranted(EntityWorkflowVoter::DELETE, $entityWorkflow); @@ -121,12 +121,12 @@ class WorkflowController extends AbstractController return $this->render('@ChillMain/Workflow/delete.html.twig', [ 'entityWorkflow' => $entityWorkflow, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'handler' => $this->entityWorkflowManager->getHandler($entityWorkflow), ]); } - #[Route(path: '/{_locale}/main/workflow-step/{id}/access_key', name: 'chill_main_workflow_grant_access_by_key')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow-step/{id}/access_key', name: 'chill_main_workflow_grant_access_by_key')] public function getAccessByAccessKey(#[MapEntity(id: 'id')] EntityWorkflowStep $entityWorkflowStep, Request $request): Response { if (null === $accessKey = $request->query->get('accessKey', null)) { @@ -155,7 +155,7 @@ class WorkflowController extends AbstractController /** * Previous workflows where the user has applyed a transition. */ - #[Route(path: '/{_locale}/main/workflow/list/previous_transitionned', name: 'chill_main_workflow_list_previous_transitionned')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/previous_transitionned', name: 'chill_main_workflow_list_previous_transitionned')] public function myPreviousWorkflowsTransitionned(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -184,7 +184,7 @@ class WorkflowController extends AbstractController /** * Previous workflows where the user was mentioned, but did not give any reaction. */ - #[Route(path: '/{_locale}/main/workflow/list/previous_without_reaction', name: 'chill_main_workflow_list_previous_without_reaction')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/previous_without_reaction', name: 'chill_main_workflow_list_previous_without_reaction')] public function myPreviousWorkflowsWithoutReaction(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -210,7 +210,7 @@ class WorkflowController extends AbstractController ); } - #[Route(path: '/{_locale}/main/workflow/list/cc', name: 'chill_main_workflow_list_cc')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/cc', name: 'chill_main_workflow_list_cc')] public function myWorkflowsCc(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -235,7 +235,7 @@ class WorkflowController extends AbstractController ); } - #[Route(path: '/{_locale}/main/workflow/list/dest', name: 'chill_main_workflow_list_dest')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/dest', name: 'chill_main_workflow_list_dest')] public function myWorkflowsDest(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -260,7 +260,7 @@ class WorkflowController extends AbstractController ); } - #[Route(path: '/{_locale}/main/workflow/list/subscribed', name: 'chill_main_workflow_list_subscribed')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/list/subscribed', name: 'chill_main_workflow_list_subscribed')] public function myWorkflowsSubscribed(Request $request): Response { $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); @@ -288,7 +288,7 @@ class WorkflowController extends AbstractController /** * @throws NonUniqueResultException */ - #[Route(path: '/{_locale}/main/workflow/{id}/show', name: 'chill_main_workflow_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/show', name: 'chill_main_workflow_show')] public function show(#[MapEntity(id: 'id')] EntityWorkflow $entityWorkflow, Request $request): Response { $this->denyAccessUnlessGranted(EntityWorkflowVoter::SEE, $entityWorkflow); @@ -372,7 +372,7 @@ class WorkflowController extends AbstractController return $lines; } - #[Route(path: '/{_locale}/main/workflow/signature/{signature_id}/metadata', name: 'chill_main_workflow_signature_metadata')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/signature/{signature_id}/metadata', name: 'chill_main_workflow_signature_metadata')] public function addSignatureMetadata(int $signature_id, Request $request): Response { $signature = $this->entityWorkflowStepSignatureRepository->find($signature_id); @@ -427,7 +427,7 @@ class WorkflowController extends AbstractController return $this->render( '@ChillMain/Workflow/signature_metadata.html.twig', [ - 'metadata_form' => $metadataForm->createView(), + 'metadata_form' => $metadataForm, 'person' => $signature->getSigner(), ] ); diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowOnHoldController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowOnHoldController.php index bcf784d50..56f6b0e15 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowOnHoldController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowOnHoldController.php @@ -35,7 +35,7 @@ class WorkflowOnHoldController private readonly UrlGeneratorInterface $urlGenerator, ) {} - #[Route(path: '/{_locale}/main/workflow/{id}/hold', name: 'chill_main_workflow_on_hold')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/hold', name: 'chill_main_workflow_on_hold')] public function putOnHold(EntityWorkflow $entityWorkflow, Request $request): Response { $currentStep = $entityWorkflow->getCurrentStep(); @@ -65,7 +65,7 @@ class WorkflowOnHoldController ); } - #[Route(path: '/{_locale}/main/workflow/{id}/remove_hold', name: 'chill_main_workflow_remove_hold')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/main/workflow/{id}/remove_hold', name: 'chill_main_workflow_remove_hold')] public function removeOnHold(EntityWorkflowStep $entityWorkflowStep): Response { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowSignatureStateChangeController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowSignatureStateChangeController.php index b2bf23c6f..b05914c01 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowSignatureStateChangeController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowSignatureStateChangeController.php @@ -37,7 +37,7 @@ final readonly class WorkflowSignatureStateChangeController private ChillUrlGeneratorInterface $chillUrlGenerator, ) {} - #[Route('/{_locale}/main/workflow/signature/{id}/cancel', name: 'chill_main_workflow_signature_cancel')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/workflow/signature/{id}/cancel', name: 'chill_main_workflow_signature_cancel')] public function cancelSignature(EntityWorkflowStepSignature $signature, Request $request): Response { return $this->markSignatureAction( @@ -49,7 +49,7 @@ final readonly class WorkflowSignatureStateChangeController ); } - #[Route('/{_locale}/main/workflow/signature/{id}/reject', name: 'chill_main_workflow_signature_reject')] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/main/workflow/signature/{id}/reject', name: 'chill_main_workflow_signature_reject')] public function rejectSignature(EntityWorkflowStepSignature $signature, Request $request): Response { return $this->markSignatureAction( diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php index 9cd4fd6f7..24eb7674d 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowViewSendPublicController.php @@ -40,7 +40,7 @@ final readonly class WorkflowViewSendPublicController private MessageBusInterface $messageBus, ) {} - #[Route('/public/main/workflow/send/{uuid}/view/{verificationKey}', name: 'chill_main_workflow_send_view_public', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route('/public/main/workflow/send/{uuid}/view/{verificationKey}', name: 'chill_main_workflow_send_view_public', methods: ['GET'])] public function __invoke(EntityWorkflowSend $workflowSend, string $verificationKey, Request $request): Response { if (50 < $workflowSend->getNumberOfErrorTrials()) { diff --git a/src/Bundle/ChillMainBundle/Cron/CronManager.php b/src/Bundle/ChillMainBundle/Cron/CronManager.php index 51e560df8..18bf89310 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManager.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManager.php @@ -51,10 +51,10 @@ class CronManager implements CronManagerInterface * @param CronJobInterface[] $jobs */ public function __construct( - private CronJobExecutionRepositoryInterface $cronJobExecutionRepository, - private EntityManagerInterface $entityManager, - private iterable $jobs, - private LoggerInterface $logger, + private readonly CronJobExecutionRepositoryInterface $cronJobExecutionRepository, + private readonly EntityManagerInterface $entityManager, + private readonly iterable $jobs, + private readonly LoggerInterface $logger, ) {} public function run(?string $forceJob = null): void diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index ca9520217..a89b5e0fb 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -92,7 +92,7 @@ final class AccompanyingCourseApiController extends ApiController ]); } - #[Route(path: '/api/1.0/person/accompanying-course/list/by-recent-attributions')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-course/list/by-recent-attributions')] public function findMyRecentCourseAttribution(Request $request): JsonResponse { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -258,7 +258,7 @@ final class AccompanyingCourseApiController extends ApiController return $this->addRemoveSomething('socialissue', $id, $request, $_format, 'socialIssue', SocialIssue::class, ['groups' => ['read']]); } - #[Route(path: '/api/1.0/person/accompanying-course/{id}/referrers-suggested.{_format}', requirements: ['_format' => 'json'], name: 'chill_api_person_accompanying_period_referrers_suggested')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-course/{id}/referrers-suggested.{_format}', requirements: ['_format' => 'json'], name: 'chill_api_person_accompanying_period_referrers_suggested')] public function suggestReferrals(AccompanyingPeriod $period, string $_format = 'json'): JsonResponse { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $period); @@ -287,7 +287,7 @@ final class AccompanyingCourseApiController extends ApiController /** * @ParamConverter("accompanyingCourse", options={"id": "id"}) */ - #[Route(path: '/api/1.0/person/accompanying-course/{id}/confidential.json', name: 'chill_api_person_accompanying_period_confidential')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-course/{id}/confidential.json', name: 'chill_api_person_accompanying_period_confidential')] public function toggleConfidentialApi(AccompanyingPeriod $accompanyingCourse, mixed $id, Request $request): \Symfony\Component\HttpFoundation\JsonResponse { if ('POST' === $request->getMethod()) { @@ -304,7 +304,7 @@ final class AccompanyingCourseApiController extends ApiController /** * @ParamConverter("accompanyingCourse", options={"id": "id"}) */ - #[Route(path: '/api/1.0/person/accompanying-course/{id}/intensity.json', name: 'chill_api_person_accompanying_period_intensity')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-course/{id}/intensity.json', name: 'chill_api_person_accompanying_period_intensity')] public function toggleIntensityApi(AccompanyingPeriod $accompanyingCourse, Request $request): \Symfony\Component\HttpFoundation\JsonResponse { if ('POST' === $request->getMethod()) { @@ -321,7 +321,7 @@ final class AccompanyingCourseApiController extends ApiController /** * @ParamConverter("accompanyingPeriod", options={"id": "id"}) */ - #[Route(path: '/api/1.0/person/accompanying-course/{id}/works.json', name: 'chill_api_person_accompanying_period_works')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-course/{id}/works.json', name: 'chill_api_person_accompanying_period_works')] public function worksByAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): JsonResponse { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingPeriod); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php index f7622953d..43c722607 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php @@ -43,7 +43,7 @@ class AccompanyingCourseCommentController extends AbstractController * * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/comments', name: 'chill_person_accompanying_period_comment_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/comments', name: 'chill_person_accompanying_period_comment_list')] public function commentAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE_DETAILS, $accompanyingCourse); @@ -118,7 +118,7 @@ class AccompanyingCourseCommentController extends AbstractController /** * Delete an existing comment. */ - #[Route(path: '/{_locale}/parcours/comment/{id}/delete', name: 'chill_person_accompanying_period_comment_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/comment/{id}/delete', name: 'chill_person_accompanying_period_comment_delete')] public function deleteAction(AccompanyingPeriod\Comment $comment, Request $request): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodCommentVoter::DELETE, $comment); @@ -149,12 +149,12 @@ class AccompanyingCourseCommentController extends AbstractController return $this->render('@ChillPerson/AccompanyingCourse/Comment/confirm_delete.html.twig', [ 'comment' => $comment, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'accompanyingCourse' => $comment->getAccompanyingPeriod(), ]); } - #[Route(path: '/{_locale}/parcours/comment/{id}/pin', name: 'chill_person_accompanying_period_comment_pin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/comment/{id}/pin', name: 'chill_person_accompanying_period_comment_pin')] public function pinComment(AccompanyingPeriod\Comment $comment): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $comment->getAccompanyingPeriod()); @@ -170,7 +170,7 @@ class AccompanyingCourseCommentController extends AbstractController ]); } - #[Route(path: '/{_locale}/parcours/comment/{id}/unpin', name: 'chill_person_accompanying_period_comment_unpin')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/comment/{id}/unpin', name: 'chill_person_accompanying_period_comment_unpin')] public function unpinComment(AccompanyingPeriod\Comment $comment): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $comment->getAccompanyingPeriod()); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 8504f4c15..0d3cedde3 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -51,7 +51,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle /** * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/close', name: 'chill_person_accompanying_course_close')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/close', name: 'chill_person_accompanying_course_close')] public function closeAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $accompanyingCourse); @@ -87,7 +87,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle } return $this->render('@ChillPerson/AccompanyingCourse/close.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'accompanyingCourse' => $accompanyingCourse, ]); } @@ -97,7 +97,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle * * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/delete', name: 'chill_person_accompanying_course_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/delete', name: 'chill_person_accompanying_course_delete')] public function deleteAction(Request $request, AccompanyingPeriod $accompanyingCourse): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->managerRegistry->getManager(); @@ -141,7 +141,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle return $this->render($view, [ 'accompanyingCourse' => $accompanyingCourse, 'person_id' => $person_id, - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } @@ -152,7 +152,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle * * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/edit', name: 'chill_person_accompanying_course_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/edit', name: 'chill_person_accompanying_course_edit')] public function editAction(AccompanyingPeriod $accompanyingCourse): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $accompanyingCourse); @@ -169,7 +169,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle * * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/history', name: 'chill_person_accompanying_course_history')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/history', name: 'chill_person_accompanying_course_history')] public function historyAction(AccompanyingPeriod $accompanyingCourse): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingCourse); @@ -184,7 +184,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle * * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}', name: 'chill_person_accompanying_course_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}', name: 'chill_person_accompanying_course_index')] public function indexAction(AccompanyingPeriod $accompanyingCourse): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingCourse); @@ -225,7 +225,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle ]); } - #[Route(path: '/{_locale}/person/parcours/new', name: 'chill_person_accompanying_course_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/parcours/new', name: 'chill_person_accompanying_course_new')] public function newAction(Request $request): Response { $user = $this->security->getUser(); @@ -263,7 +263,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle ]); } - #[Route(path: '/{_locale}/person/household/parcours/new', name: 'chill_household_accompanying_course_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/parcours/new', name: 'chill_household_accompanying_course_new')] public function newHouseholdParcoursAction(Request $request): Response { $user = $this->getUser(); @@ -303,7 +303,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle /** * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) */ - #[Route(path: '/{_locale}/parcours/{accompanying_period_id}/open', name: 'chill_person_accompanying_course_reopen')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/parcours/{accompanying_period_id}/open', name: 'chill_person_accompanying_course_reopen')] public function reOpenAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $accompanyingCourse); @@ -325,7 +325,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle } return $this->render('@ChillPerson/AccompanyingCourse/re_open.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'accompanyingCourse' => $accompanyingCourse, ]); } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php index 58ee0e870..863a64699 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php @@ -29,7 +29,7 @@ class AccompanyingCourseWorkApiController extends ApiController private readonly Security $security, ) {} - #[Route(path: '/api/1.0/person/accompanying-period/work/my-near-end')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-period/work/my-near-end')] public function myWorksNearEndDate(Request $request): JsonResponse { $user = $this->security->getUser(); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 91b58f4ad..df871a239 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -43,7 +43,7 @@ final class AccompanyingCourseWorkController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[Route(path: '{_locale}/person/accompanying-period/{id}/work/new', name: 'chill_person_accompanying_period_work_new', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/{id}/work/new', name: 'chill_person_accompanying_period_work_new', methods: ['GET'])] public function createWork(AccompanyingPeriod $period): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodWorkVoter::CREATE, $period); @@ -70,7 +70,7 @@ final class AccompanyingCourseWorkController extends AbstractController ]); } - #[Route(path: '{_locale}/person/accompanying-period/work/{id}/delete', name: 'chill_person_accompanying_period_work_delete', methods: ['GET', 'POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/work/{id}/delete', name: 'chill_person_accompanying_period_work_delete', methods: ['GET', 'POST', 'DELETE'])] public function deleteWork(AccompanyingPeriodWork $work, Request $request): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodWorkVoter::UPDATE, $work); @@ -106,11 +106,11 @@ final class AccompanyingCourseWorkController extends AbstractController return $this->render('@ChillPerson/AccompanyingCourseWork/delete.html.twig', [ 'accompanyingCourse' => $work->getAccompanyingPeriod(), 'work' => $work, - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } - #[Route(path: '{_locale}/person/accompanying-period/work/{id}/edit', name: 'chill_person_accompanying_period_work_edit', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/work/{id}/edit', name: 'chill_person_accompanying_period_work_edit', methods: ['GET'])] public function editWork(AccompanyingPeriodWork $work): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodWorkVoter::UPDATE, $work); @@ -124,7 +124,7 @@ final class AccompanyingCourseWorkController extends AbstractController ]); } - #[Route(path: '{_locale}/person/accompanying-period/{id}/work', name: 'chill_person_accompanying_period_work_list', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/{id}/work', name: 'chill_person_accompanying_period_work_list', methods: ['GET'])] public function listWorkByAccompanyingPeriod(AccompanyingPeriod $period): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodWorkVoter::SEE, $period); @@ -156,7 +156,7 @@ final class AccompanyingCourseWorkController extends AbstractController ]); } - #[Route(path: '{_locale}/person/accompanying-period/work/{id}/show', name: 'chill_person_accompanying_period_work_show', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/work/{id}/show', name: 'chill_person_accompanying_period_work_show', methods: ['GET'])] public function showWork(AccompanyingPeriodWork $work): Response { if (null === $work) { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php index 6d13fdc58..1c2a4248a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php @@ -22,7 +22,7 @@ class AccompanyingCourseWorkEvaluationDocumentController extends AbstractControl { public function __construct(private readonly Security $security) {} - #[Route(path: '{_locale}/person/accompanying-period/work/evaluation/document/{id}/show', name: 'chill_person_accompanying_period_work_evaluation_document_show', methods: ['GET'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '{_locale}/person/accompanying-period/work/evaluation/document/{id}/show', name: 'chill_person_accompanying_period_work_evaluation_document_show', methods: ['GET'])] public function showAccompanyingCourseWork(AccompanyingPeriodWorkEvaluationDocument $document): Response { $work = $document->getAccompanyingPeriodWorkEvaluation()->getAccompanyingPeriodWork(); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index 7c7def6a7..5e823d58e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -45,7 +45,7 @@ class AccompanyingPeriodController extends AbstractController /** * @throws \Exception */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period/close', name: 'chill_person_accompanying_period_close')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period/close', name: 'chill_person_accompanying_period_close')] public function closeAction(int $person_id, Request $request): Response { $person = $this->_getPerson($person_id); @@ -116,13 +116,13 @@ class AccompanyingPeriodController extends AbstractController } return $this->render('@ChillPerson/AccompanyingPeriod/form.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, 'accompanying_period' => $current, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period/create', name: 'chill_person_accompanying_period_create')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period/create', name: 'chill_person_accompanying_period_create')] public function createAction(int $person_id, Request $request): Response { $person = $this->_getPerson($person_id); @@ -180,7 +180,7 @@ class AccompanyingPeriodController extends AbstractController } return $this->render('@ChillPerson/AccompanyingPeriod/form.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, 'accompanying_period' => $accompanyingPeriod, ]); @@ -189,7 +189,7 @@ class AccompanyingPeriodController extends AbstractController /** * @ParamConverter("person", options={"id"="person_id"}) */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period', name: 'chill_person_accompanying_period_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period', name: 'chill_person_accompanying_period_list')] public function listAction(Person $person): Response { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $person); @@ -214,7 +214,7 @@ class AccompanyingPeriodController extends AbstractController ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period/open', name: 'chill_person_accompanying_period_open')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period/open', name: 'chill_person_accompanying_period_open')] public function openAction(int $person_id, Request $request): Response { $person = $this->_getPerson($person_id); @@ -291,13 +291,13 @@ class AccompanyingPeriodController extends AbstractController } return $this->render('@ChillPerson/AccompanyingPeriod/form.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, 'accompanying_period' => $accompanyingPeriod, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open', name: 'chill_person_accompanying_period_re_open')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open', name: 'chill_person_accompanying_period_re_open')] public function reOpenAction(int $person_id, int $period_id, Request $request): Response { /** @var Person $person */ @@ -346,7 +346,7 @@ class AccompanyingPeriodController extends AbstractController /** * @throws Exception */ - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/accompanying-period/{period_id}/update', name: 'chill_person_accompanying_period_update')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/accompanying-period/{period_id}/update', name: 'chill_person_accompanying_period_update')] public function updateAction(int $person_id, int $period_id, Request $request): Response { $em = $this->managerRegistry->getManager(); @@ -411,7 +411,7 @@ class AccompanyingPeriodController extends AbstractController } return $this->render('@ChillPerson/AccompanyingPeriod/form.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, 'accompanying_period' => $accompanyingPeriod, ]); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php index 918e6d70d..d3979a53d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php @@ -33,7 +33,7 @@ class AccompanyingPeriodRegulationListController { public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} - #[Route(path: '/{_locale}/person/periods/undispatched', name: 'chill_person_course_list_regulation')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/periods/undispatched', name: 'chill_person_course_list_regulation')] public function listRegul(Request $request): Response { if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php index e7f5d4de8..0b9a92f52 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php @@ -31,7 +31,7 @@ class AccompanyingPeriodWorkEvaluationApiController { public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security) {} - #[Route(path: '/api/1.0/person/docgen/template/by-evaluation/{id}.{_format}', requirements: ['format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/docgen/template/by-evaluation/{id}.{_format}', requirements: ['format' => 'json'])] public function listTemplateByEvaluation(Evaluation $evaluation, string $_format): JsonResponse { if ('json' !== $_format) { @@ -61,7 +61,7 @@ class AccompanyingPeriodWorkEvaluationApiController ), JsonResponse::HTTP_OK, [], true); } - #[Route(path: '/api/1.0/person/accompanying-period/work/evaluation/my-near-end')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/accompanying-period/work/evaluation/my-near-end')] public function myWorksNearEndDate(Request $request): JsonResponse { $total = $this->accompanyingPeriodWorkEvaluationRepository diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationDocumentDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationDocumentDuplicateController.php index e2dfa3484..5a0b33bc5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationDocumentDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationDocumentDuplicateController.php @@ -35,7 +35,7 @@ class AccompanyingPeriodWorkEvaluationDocumentDuplicateController private readonly ChillUrlGeneratorInterface $urlGenerator, ) {} - #[Route('/api/1.0/person/accompanying-course-work-evaluation-document/{id}/duplicate', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/api/1.0/person/accompanying-course-work-evaluation-document/{id}/duplicate', methods: ['POST'])] public function duplicateApi(AccompanyingPeriodWorkEvaluationDocument $document): Response { $work = $document->getAccompanyingPeriodWorkEvaluation()->getAccompanyingPeriodWork(); @@ -56,7 +56,7 @@ class AccompanyingPeriodWorkEvaluationDocumentDuplicateController ); } - #[Route('/{_locale}/person/accompanying-course-work-evaluation-document/{id}/duplicate', name: 'chill_person_accompanying_period_work_evaluation_document_duplicate', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route('/{_locale}/person/accompanying-course-work-evaluation-document/{id}/duplicate', name: 'chill_person_accompanying_period_work_evaluation_document_duplicate', methods: ['POST'])] public function duplicate(AccompanyingPeriodWorkEvaluationDocument $document): Response { $work = $document->getAccompanyingPeriodWorkEvaluation()->getAccompanyingPeriodWork(); diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminController.php b/src/Bundle/ChillPersonBundle/Controller/AdminController.php index 8519f9eee..aab00aa0e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AdminController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AdminController.php @@ -19,25 +19,25 @@ use Symfony\Component\Routing\Annotation\Route; */ class AdminController extends AbstractController { - #[Route(path: '/{_locale}/admin/accompanying-course', name: 'chill_accompanying-course_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/accompanying-course', name: 'chill_accompanying-course_admin_index')] public function indexAccompanyingCourseAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillPerson/Admin/indexAccompanyingCourse.html.twig'); } - #[Route(path: '/{_locale}/admin/household', name: 'chill_household_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/household', name: 'chill_household_admin_index')] public function indexHouseholdAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillPerson/Admin/indexHousehold.html.twig'); } - #[Route(path: '/{_locale}/admin/person', name: 'chill_person_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/person', name: 'chill_person_admin_index')] public function indexPersonAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillPerson/Admin/indexPerson.html.twig'); } - #[Route(path: '/{_locale}/admin/social-work', name: 'chill_social-work_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/social-work', name: 'chill_social-work_admin_index')] public function indexSocialWorkAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillPerson/Admin/indexSocialWork.html.twig'); @@ -46,7 +46,7 @@ class AdminController extends AbstractController /** * @return \Symfony\Component\HttpFoundation\RedirectResponse */ - #[Route(path: '/{_locale}/admin/person_redirect_to_main', name: 'chill_person_admin_redirect_to_admin_index', options: [null])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/person_redirect_to_main', name: 'chill_person_admin_redirect_to_admin_index', options: [null])] public function redirectToAdminIndexAction(): \Symfony\Component\HttpFoundation\RedirectResponse { return $this->redirectToRoute('chill_main_admin_central'); diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php index f32e44b89..fc460aad3 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php @@ -46,7 +46,7 @@ class HouseholdApiController extends ApiController /** * @return \Symfony\Component\HttpFoundation\JsonResponse */ - #[Route(path: '/api/1.0/person/household/by-address-reference/{id}.json', name: 'chill_api_person_household_by_address_reference')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/household/by-address-reference/{id}.json', name: 'chill_api_person_household_by_address_reference')] public function getHouseholdByAddressReference(AddressReference $addressReference): Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -68,7 +68,7 @@ class HouseholdApiController extends ApiController /** * Add an address to a household. */ - #[Route(path: '/api/1.0/person/household/{id}/address.{_format}', name: 'chill_api_single_household_address', methods: ['POST'], requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/household/{id}/address.{_format}', name: 'chill_api_single_household_address', methods: ['POST'], requirements: ['_format' => 'json'])] public function householdAddressApi(Household $household, Request $request, string $_format): Response { $this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $household); @@ -112,7 +112,7 @@ class HouseholdApiController extends ApiController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/api/1.0/person/address/suggest/by-household/{household_id}.{_format}', name: 'chill_person_address_suggest_by_household', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/address/suggest/by-household/{household_id}.{_format}', name: 'chill_person_address_suggest_by_household', requirements: ['_format' => 'json'])] public function suggestAddressByHousehold(Household $household, string $_format): \Symfony\Component\HttpFoundation\JsonResponse { // TODO add acl diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php index 16f61b33c..bc8fb8364 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php @@ -46,7 +46,7 @@ class HouseholdCompositionController extends AbstractController private readonly UrlGeneratorInterface $urlGenerator, ) {} - #[Route(path: '/{_locale}/person/household/{household_id}/composition/{composition_id}/delete', name: 'chill_person_household_composition_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/{household_id}/composition/{composition_id}/delete', name: 'chill_person_household_composition_delete')] public function deleteAction(Request $request, mixed $household_id, mixed $composition_id): Response { $composition = $this->householdCompositionRepository->find($composition_id); @@ -87,12 +87,12 @@ class HouseholdCompositionController extends AbstractController [ 'household' => $household, 'composition' => $composition, - 'form' => $form->createView(), + 'form' => $form, ] ); } - #[Route(path: '/{_locale}/person/household/{id}/composition/index', name: 'chill_person_household_composition_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/{id}/composition/index', name: 'chill_person_household_composition_index')] public function index(Household $household, Request $request): Response { if (!$this->security->isGranted(HouseholdVoter::SEE, $household)) { @@ -117,7 +117,7 @@ class HouseholdCompositionController extends AbstractController )); } - #[Route(path: '/{_locale}/person/household/{id}/composition/new', name: 'chill_person_household_composition_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/{id}/composition/new', name: 'chill_person_household_composition_new')] public function newAction(Household $household, Request $request): Response { if ($this->security->isGranted(HouseholdVoter::EDIT, $household)) { diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index 642934a01..4c550aded 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -29,7 +29,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; use Symfony\Component\Serializer\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; -#[Route(path: '/{_locale}/person/household')] +#[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household')] class HouseholdController extends AbstractController { public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} @@ -37,7 +37,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/accompanying-period', name: 'chill_person_household_accompanying_period', methods: ['GET', 'HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/accompanying-period', name: 'chill_person_household_accompanying_period', methods: ['GET', 'HEAD'])] public function accompanyingPeriod(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { $currentMembers = $household->getCurrentPersons(); @@ -87,7 +87,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/address/edit', name: 'chill_person_household_address_edit', methods: ['GET', 'HEAD', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/address/edit', name: 'chill_person_household_address_edit', methods: ['GET', 'HEAD', 'POST'])] public function addressEdit(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { // TODO ACL @@ -109,7 +109,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/addresses', name: 'chill_person_household_addresses', methods: ['GET', 'HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/addresses', name: 'chill_person_household_addresses', methods: ['GET', 'HEAD'])] public function addresses(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { // TODO ACL @@ -135,7 +135,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/address/move', name: 'chill_person_household_address_move', methods: ['GET', 'HEAD', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/address/move', name: 'chill_person_household_address_move', methods: ['GET', 'HEAD', 'POST'])] public function addressMove(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { // TODO ACL @@ -151,7 +151,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/address/edit_valid_from', name: 'chill_person_household_address_valid_from_edit', methods: ['GET', 'HEAD', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/address/edit_valid_from', name: 'chill_person_household_address_valid_from_edit', methods: ['GET', 'HEAD', 'POST'])] public function addressValidFromEdit(Request $request, Household $household): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $household); @@ -195,7 +195,7 @@ class HouseholdController extends AbstractController [ 'household' => $household, 'address' => $address, - 'form' => $form->createView(), + 'form' => $form, ] ); } @@ -203,7 +203,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/members/metadata/edit', name: 'chill_person_household_members_metadata_edit', methods: ['GET', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/members/metadata/edit', name: 'chill_person_household_members_metadata_edit', methods: ['GET', 'POST'])] public function editHouseholdMetadata(Request $request, Household $household): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { // TODO ACL @@ -229,14 +229,14 @@ class HouseholdController extends AbstractController return $this->render('@ChillPerson/Household/edit_member_metadata.html.twig', [ 'household' => $household, - 'form' => $form->createView(), + 'form' => $form, ]); } /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/relationship', name: 'chill_person_household_relationship', methods: ['GET', 'HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/relationship', name: 'chill_person_household_relationship', methods: ['GET', 'HEAD'])] public function showRelationship(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { $jsonString = $this->serializer->serialize( @@ -257,7 +257,7 @@ class HouseholdController extends AbstractController /** * @ParamConverter("household", options={"id": "household_id"}) */ - #[Route(path: '/{household_id}/summary', name: 'chill_person_household_summary', methods: ['GET', 'HEAD'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{household_id}/summary', name: 'chill_person_household_summary', methods: ['GET', 'HEAD'])] public function summary(Request $request, Household $household): \Symfony\Component\HttpFoundation\Response { // TODO ACL diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 1583cad49..a27c9cf7e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -55,7 +55,7 @@ class HouseholdMemberController extends ApiController $this->household_fields_visibility = $parameterBag->get('chill_person.household_fields'); } - #[Route(path: '/{_locale}/person/household/member/{id}/edit', name: 'chill_person_household_member_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/member/{id}/edit', name: 'chill_person_household_member_edit')] public function editMembership(Request $request, HouseholdMember $member): Response { // TODO ACL @@ -80,7 +80,7 @@ class HouseholdMemberController extends ApiController return $this->render('@ChillPerson/Household/Member/edit.html.twig', [ 'household' => $member->getHousehold(), 'member' => $member, - 'form' => $form->createView(), + 'form' => $form, ]); } @@ -94,7 +94,7 @@ class HouseholdMemberController extends ApiController * * allow_leave_without_household: if present, the editor will allow * to leave household without joining another */ - #[Route(path: '/{_locale}/person/household/members/editor', name: 'chill_person_household_members_editor')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/members/editor', name: 'chill_person_household_members_editor')] public function editor(Request $request): \Symfony\Component\HttpFoundation\Response { $ids = $request->query->all('persons'); @@ -173,7 +173,7 @@ class HouseholdMemberController extends ApiController ]); } - #[Route(path: '/api/1.0/person/household/members/move.{_format}', name: 'chill_api_person_household_members_move')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/household/members/move.{_format}', name: 'chill_api_person_household_members_move')] public function move(Request $request, mixed $_format): Response { try { diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php index fcc00c1e9..0dee85ebe 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php @@ -31,7 +31,7 @@ class PersonAddressController extends AbstractController */ public function __construct(private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/address/create', name: 'chill_person_address_create', methods: ['POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/address/create', name: 'chill_person_address_create', methods: ['POST'])] public function createAction(mixed $person_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry->getManager() @@ -82,11 +82,11 @@ class PersonAddressController extends AbstractController return $this->render('@ChillPerson/Address/new.html.twig', [ 'person' => $person, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/address/{address_id}/edit', name: 'chill_person_address_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/address/{address_id}/edit', name: 'chill_person_address_edit')] public function editAction(mixed $person_id, mixed $address_id): \Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry->getManager() @@ -110,11 +110,11 @@ class PersonAddressController extends AbstractController return $this->render('@ChillPerson/Address/edit.html.twig', [ 'person' => $person, 'address' => $address, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/address/list', name: 'chill_person_address_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/address/list', name: 'chill_person_address_list')] public function listAction(mixed $person_id): \Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry->getManager() @@ -136,7 +136,7 @@ class PersonAddressController extends AbstractController ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/address/new', name: 'chill_person_address_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/address/new', name: 'chill_person_address_new')] public function newAction(mixed $person_id): \Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry->getManager() @@ -159,11 +159,11 @@ class PersonAddressController extends AbstractController return $this->render('@ChillPerson/Address/new.html.twig', [ 'person' => $person, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/address/{address_id}/update', name: 'chill_person_address_update')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/address/{address_id}/update', name: 'chill_person_address_update')] public function updateAction(mixed $person_id, mixed $address_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry->getManager() @@ -212,7 +212,7 @@ class PersonAddressController extends AbstractController return $this->render('@ChillPerson/Address/edit.html.twig', [ 'person' => $person, 'address' => $address, - 'form' => $form->createView(), + 'form' => $form, ]); } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index ffe3295d9..917104f4e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -36,7 +36,7 @@ class PersonApiController extends ApiController $this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; } - #[Route(path: '/api/1.0/person/creation/authorized-centers', name: 'chill_person_person_creation_authorized_centers')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/creation/authorized-centers', name: 'chill_person_person_creation_authorized_centers')] public function authorizedCentersForCreation(): Response { $centers = $this->authorizedCenterOnPersonCreation->getCenters(); @@ -49,7 +49,7 @@ class PersonApiController extends ApiController ); } - #[Route(path: '/api/1.0/person/config/alt_names.{_format}', name: 'chill_person_config_alt_names', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/config/alt_names.{_format}', name: 'chill_person_config_alt_names', requirements: ['_format' => 'json'])] public function configAltNames(Request $request, string $_format): Response { $configAltNamesChoices = $this->configPersonAltNameHelper->getChoices(); @@ -74,7 +74,7 @@ class PersonApiController extends ApiController /** * @ParamConverter("person", options={"id": "person_id"}) */ - #[Route(path: '/api/1.0/person/address/suggest/by-person/{person_id}.{_format}', name: 'chill_person_address_suggest_by_person', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/address/suggest/by-person/{person_id}.{_format}', name: 'chill_person_address_suggest_by_person', requirements: ['_format' => 'json'])] public function suggestAddress(Person $person, Request $request, string $_format): Response { $this->denyAccessUnlessGranted(PersonVoter::SEE, $person); diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index a5cf46bca..25d13c0d2 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -49,7 +49,7 @@ final class PersonController extends AbstractController private readonly EntityManagerInterface $em, ) {} - #[Route(path: '/{_locale}/person/{person_id}/general/edit', name: 'chill_person_general_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/general/edit', name: 'chill_person_general_edit')] public function editAction(int $person_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $person = $this->_getPerson($person_id); @@ -95,7 +95,7 @@ final class PersonController extends AbstractController return $this->render( '@ChillPerson/Person/edit.html.twig', - ['person' => $person, 'form' => $form->createView()] + ['person' => $person, 'form' => $form] ); } @@ -116,7 +116,7 @@ final class PersonController extends AbstractController /** * @ParamConverter("person", options={"id": "person_id"}) */ - #[Route(path: '/{_locale}/person/household/{person_id}/history', name: 'chill_person_household_person_history', methods: ['GET', 'POST'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/household/{person_id}/history', name: 'chill_person_household_person_history', methods: ['GET', 'POST'])] public function householdHistoryByPerson(Request $request, Person $person): Response { $this->denyAccessUnlessGranted( @@ -145,7 +145,7 @@ final class PersonController extends AbstractController * The next post compare the data with previous one and, if yes, show a * review page if there are "alternate persons". */ - #[Route(path: '/{_locale}/person/new', name: 'chill_person_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/new', name: 'chill_person_new')] public function newAction(Request $request): Response { $person = new Person(); @@ -234,13 +234,13 @@ final class PersonController extends AbstractController return $this->render( '@ChillPerson/Person/create.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'alternatePersons' => $alternatePersons ?? [], ] ); } - #[Route(path: '/{_locale}/person/{person_id}/general', name: 'chill_person_view')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/general', name: 'chill_person_view')] public function viewAction(int $person_id): \Symfony\Component\HttpFoundation\Response { $person = $this->_getPerson($person_id); diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index f9f5ac299..d211acc10 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -44,7 +44,7 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll private readonly TranslatorInterface $translator, ) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm', name: 'chill_person_duplicate_confirm')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm', name: 'chill_person_duplicate_confirm')] public function confirmAction(mixed $person1_id, mixed $person2_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if ($person1_id === $person2_id) { @@ -100,11 +100,11 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll return $this->render('@ChillPerson/PersonDuplicate/confirm.html.twig', [ 'person' => $person1, 'person2' => $person2, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/find-manually', name: 'chill_person_find_manually_duplicate')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/find-manually', name: 'chill_person_find_manually_duplicate')] public function findManuallyDuplicateAction(mixed $person_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $person = $this->_getPerson($person_id); @@ -156,11 +156,11 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll return $this->render('@ChillPerson/PersonDuplicate/find_manually.html.twig', [ 'person' => $person, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate', name: 'chill_person_duplicate_not_duplicate')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate', name: 'chill_person_duplicate_not_duplicate')] public function notDuplicateAction(mixed $person1_id, mixed $person2_id): \Symfony\Component\HttpFoundation\RedirectResponse { $user = $this->security->getUser(); @@ -193,7 +193,7 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate', name: 'chill_person_remove_duplicate_not_duplicate')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate', name: 'chill_person_remove_duplicate_not_duplicate')] public function removeNotDuplicateAction(mixed $person1_id, mixed $person2_id): \Symfony\Component\HttpFoundation\RedirectResponse { [$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id); @@ -215,7 +215,7 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/duplicate/view', name: 'chill_person_duplicate_view')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/duplicate/view', name: 'chill_person_duplicate_view')] public function viewAction(mixed $person_id, PersonNotDuplicateRepository $personNotDuplicateRepository): \Symfony\Component\HttpFoundation\Response { $person = $this->_getPerson($person_id); diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php index 9613322fc..7837d5d6a 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -27,7 +27,7 @@ final class PersonResourceController extends AbstractController { public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/resources/{resource_id}/delete', name: 'chill_person_resource_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/resources/{resource_id}/delete', name: 'chill_person_resource_delete')] public function deleteAction(Request $request, mixed $person_id, mixed $resource_id): Response { $personOwner = $this->personRepository->find($person_id); @@ -68,12 +68,12 @@ final class PersonResourceController extends AbstractController [ 'person' => $personOwner, 'resource' => $resource, - 'form' => $form->createView(), + 'form' => $form, ] ); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/resources/{resource_id}/edit', name: 'chill_person_resource_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/resources/{resource_id}/edit', name: 'chill_person_resource_edit')] public function editAction(Request $request, mixed $resource_id, mixed $person_id): Response { $resource = $this->personResourceRepository->find($resource_id); @@ -102,13 +102,13 @@ final class PersonResourceController extends AbstractController [ 'person' => $personOwner, 'resource' => $resource, - 'form' => $form->createView(), + 'form' => $form, 'action' => 'edit', ] ); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/resources/list', name: 'chill_person_resource_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/resources/list', name: 'chill_person_resource_list')] public function listAction(Request $request, mixed $person_id): \Symfony\Component\HttpFoundation\Response { $personOwner = $this->personRepository->find($person_id); @@ -126,7 +126,7 @@ final class PersonResourceController extends AbstractController ); } - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/resources/new', name: 'chill_person_resource_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/resources/new', name: 'chill_person_resource_new')] public function newAction(Request $request, mixed $person_id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $personOwner = $this->personRepository->find($person_id); @@ -151,7 +151,7 @@ final class PersonResourceController extends AbstractController return $this->render( '@ChillPerson/PersonResource/create.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'person' => $personOwner, ] ); diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonSignatureController.php b/src/Bundle/ChillPersonBundle/Controller/PersonSignatureController.php index aa9407c11..2ad541a58 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonSignatureController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonSignatureController.php @@ -26,7 +26,7 @@ class PersonSignatureController extends AbstractController private readonly EntityWorkflowManager $entityWorkflowManager, ) {} - #[Route(path: '/{_locale}/signatures/by-person/{id}', name: 'chill_person_signature_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/signatures/by-person/{id}', name: 'chill_person_signature_list')] public function listSignatures(Person $person): Response { $this->denyAccessUnlessGranted(PersonVoter::SEE, $person); diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index 7870c72ee..2013feafa 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -41,7 +41,7 @@ class ReassignAccompanyingPeriodController extends AbstractController { public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) {} - #[Route(path: '/{_locale}/person/accompanying-periods/reassign', name: 'chill_course_list_reassign')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/accompanying-periods/reassign', name: 'chill_course_list_reassign')] public function listAction(Request $request): Response { if (!$this->security->isGranted(AccompanyingPeriodVoter::REASSIGN_BULK)) { diff --git a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php index dc3c8ee0a..ae3ebc080 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php @@ -29,7 +29,7 @@ final class ResidentialAddressController extends AbstractController { public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[Route(path: '/{_locale}/person/residential-address/{id}/delete', name: 'chill_person_residential_address_delete')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/residential-address/{id}/delete', name: 'chill_person_residential_address_delete')] public function deleteAction(Request $request, ResidentialAddress $residentialAddress): Response { $this->denyAccessUnlessGranted(PersonVoter::UPDATE, $residentialAddress->getPerson()); @@ -51,11 +51,11 @@ final class ResidentialAddressController extends AbstractController return $this->render('@ChillPerson/ResidentialAddress/delete.html.twig', [ 'person' => $residentialAddress->getPerson(), 'residentialAddress' => $residentialAddress, - 'delete_form' => $form->createView(), + 'delete_form' => $form, ]); } - #[Route(path: '/{_locale}/person/residential-address/{id}/edit', name: 'chill_person_residential_address_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/residential-address/{id}/edit', name: 'chill_person_residential_address_edit')] public function editAction(Request $request, ResidentialAddress $residentialAddress): Response { if ($request->query->has('kind')) { @@ -85,11 +85,11 @@ final class ResidentialAddressController extends AbstractController return $this->render('@ChillPerson/ResidentialAddress/edit.html.twig', [ 'residentialAddress' => $residentialAddress, 'person' => $person, - 'form' => $form->createView(), + 'form' => $form, ]); } - #[Route(path: '/{_locale}/person/{id}/residential-address/list', name: 'chill_person_residential_address_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{id}/residential-address/list', name: 'chill_person_residential_address_list')] public function listAction(Request $request, Person $person): Response { $this->denyAccessUnlessGranted(PersonVoter::SEE, $person); @@ -102,7 +102,7 @@ final class ResidentialAddressController extends AbstractController ]); } - #[Route(path: '/{_locale}/person/{id}/residential-address/new', name: 'chill_person_residential_address_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{id}/residential-address/new', name: 'chill_person_residential_address_new')] public function newAction(Request $request, Person $person): Response { $residentialAddress = new ResidentialAddress(); @@ -133,7 +133,7 @@ final class ResidentialAddressController extends AbstractController return $this->render('@ChillPerson/ResidentialAddress/new.html.twig', [ 'person' => $person, - 'form' => $form->createView(), + 'form' => $form, ]); } } diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialActionCSVExportController.php b/src/Bundle/ChillPersonBundle/Controller/SocialActionCSVExportController.php index 24a8ffbd2..7bd4db927 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialActionCSVExportController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialActionCSVExportController.php @@ -37,7 +37,7 @@ class SocialActionCSVExportController extends AbstractController * @throws CannotInsertRecord * @throws Exception */ - #[Route(path: '/{_locale}/admin/social-work/social-action/export/list.{_format}', name: 'chill_person_social_action_export_list', requirements: ['_format' => 'csv'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/social-work/social-action/export/list.{_format}', name: 'chill_person_social_action_export_list', requirements: ['_format' => 'csv'])] public function socialActionList(Request $request, string $_format = 'csv'): StreamedResponse { if (!$this->security->isGranted('ROLE_ADMIN')) { diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueCSVExportController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueCSVExportController.php index ef713af3e..b7d644fe4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueCSVExportController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueCSVExportController.php @@ -37,7 +37,7 @@ class SocialIssueCSVExportController extends AbstractController * @throws CannotInsertRecord * @throws Exception */ - #[Route(path: '/{_locale}/admin/social-work/social-issue/export/list.{_format}', name: 'chill_person_social_issue_export_list', requirements: ['_format' => 'csv'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/social-work/social-issue/export/list.{_format}', name: 'chill_person_social_issue_export_list', requirements: ['_format' => 'csv'])] public function socialIssueList(Request $request, string $_format = 'csv'): StreamedResponse { if (!$this->security->isGranted('ROLE_ADMIN')) { diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php index 27a7acbf5..99b9922ba 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php @@ -27,7 +27,7 @@ class SocialWorkEvaluationApiController extends AbstractController /** * @ParamConverter("action", options={"id": "action_id"}) */ - #[Route(path: '/api/1.0/person/social-work/evaluation/by-social-action/{action_id}.json', name: 'chill_person_evaluation_index_by_social_action', requirements: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/person/social-work/evaluation/by-social-action/{action_id}.json', name: 'chill_person_evaluation_index_by_social_action', requirements: ['_format' => 'json'])] public function listEvaluationBySocialAction(SocialAction $action): Response { $evaluations = $action->getEvaluations()->filter(static fn (Evaluation $eval) => $eval->isActive()); diff --git a/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php b/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php index 0db62acfb..6a954e0f4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php @@ -24,7 +24,7 @@ class TimelinePersonController extends AbstractController { public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} - #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/person/{person_id}/timeline', name: 'chill_person_timeline')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/{person_id}/timeline', name: 'chill_person_timeline')] public function personAction(Request $request, mixed $person_id): \Symfony\Component\HttpFoundation\Response { $person = $this->managerRegistry diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 3a2b1be6e..5ccbbf534 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -23,7 +23,7 @@ class UserAccompanyingPeriodController extends AbstractController { public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) {} - #[Route(path: '/{_locale}/person/accompanying-periods/my', name: 'chill_person_accompanying_period_user')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/accompanying-periods/my', name: 'chill_person_accompanying_period_user')] public function listAction(Request $request): Response { $active = $request->query->getBoolean('active', true); @@ -54,7 +54,7 @@ class UserAccompanyingPeriodController extends AbstractController ]); } - #[Route(path: '/{_locale}/person/accompanying-periods/my/drafts', name: 'chill_person_accompanying_period_draft_user')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/person/accompanying-periods/my/drafts', name: 'chill_person_accompanying_period_draft_user')] public function listDraftsAction(): Response { $total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => 'DRAFT']); diff --git a/src/Bundle/ChillReportBundle/Controller/ReportController.php b/src/Bundle/ChillReportBundle/Controller/ReportController.php index d41caf05b..680b20a01 100644 --- a/src/Bundle/ChillReportBundle/Controller/ReportController.php +++ b/src/Bundle/ChillReportBundle/Controller/ReportController.php @@ -98,7 +98,7 @@ class ReportController extends AbstractController return $this->render('@ChillReport/Report/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, ]); } @@ -140,7 +140,7 @@ class ReportController extends AbstractController $this->eventDispatcher->dispatch($event, PrivacyEvent::PERSON_PRIVACY_EVENT); return $this->render('@ChillReport/Report/edit.html.twig', [ - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, 'person' => $person, ]); } @@ -271,7 +271,7 @@ class ReportController extends AbstractController return $this->render('@ChillReport/Report/new.html.twig', [ 'entity' => $entity, - 'form' => $form->createView(), + 'form' => $form, 'person' => $person, ]); } @@ -442,7 +442,7 @@ class ReportController extends AbstractController ); return $this->render('@ChillReport/Report/edit.html.twig', [ - 'edit_form' => $editForm->createView(), + 'edit_form' => $editForm, 'person' => $report->getPerson(), ]); } diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 28a3f4f8c..d56f4315c 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -63,7 +63,7 @@ final class SingleTaskController extends AbstractController private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, ) {} - #[Route(path: '/{_locale}/task/single-task/{id}/delete', name: 'chill_task_single_task_delete', methods: ['GET', 'POST', 'DELETE'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/{id}/delete', name: 'chill_task_single_task_delete', methods: ['GET', 'POST', 'DELETE'])] public function deleteAction(Request $request, mixed $id) { $course = null; @@ -143,7 +143,7 @@ final class SingleTaskController extends AbstractController '@ChillTask/SingleTask/Person/confirm_delete.html.twig', [ 'task' => $task, - 'delete_form' => $form->createView(), + 'delete_form' => $form, ] ); } @@ -152,13 +152,13 @@ final class SingleTaskController extends AbstractController '@ChillTask/SingleTask/AccompanyingCourse/confirm_delete.html.twig', [ 'task' => $task, - 'delete_form' => $form->createView(), + 'delete_form' => $form, 'accompanyingCourse' => $course, ] ); } - #[Route(path: '/{_locale}/task/single-task/{id}/edit', name: 'chill_task_single_task_edit')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/{id}/edit', name: 'chill_task_single_task_edit')] public function editAction( #[MapEntity(id: 'id')] SingleTask $task, Request $request, @@ -249,7 +249,7 @@ final class SingleTaskController extends AbstractController * - hide_form (hide the form to filter the tasks) * - status: date state, amongst SingleTaskRepository::DATE_STATUSES, or 'closed'. */ - #[Route(path: '/{_locale}/task/single-task/list', name: 'chill_task_singletask_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/list', name: 'chill_task_singletask_list')] public function listAction( Request $request, ): Response { @@ -302,7 +302,7 @@ final class SingleTaskController extends AbstractController ]); } - #[Route(path: '/{_locale}/task/single-task/by-course/{id}', name: 'chill_task_singletask_by-course_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/by-course/{id}', name: 'chill_task_singletask_by-course_list')] public function listCourseTasks( AccompanyingPeriod $course, FormFactoryInterface $formFactory, @@ -349,7 +349,7 @@ final class SingleTaskController extends AbstractController ); } - #[Route(path: '/{_locale}/task/single-task/by-person/{id}', name: 'chill_task_singletask_by-person_list')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/by-person/{id}', name: 'chill_task_singletask_by-person_list')] public function listPersonTasks( #[MapEntity(id: 'id')] Person $person, ): Response { @@ -397,8 +397,8 @@ final class SingleTaskController extends AbstractController /** * @return Response */ - #[Route(path: '/{_locale}/task/single-task/list/my', name: 'chill_task_singletask_my_tasks', defaults: ['_format' => 'html'])] - #[Route(path: '/api/1.0/task/single-task/list/my', defaults: ['_format' => 'json'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/list/my', name: 'chill_task_singletask_my_tasks', defaults: ['_format' => 'html'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/api/1.0/task/single-task/list/my', defaults: ['_format' => 'json'])] public function myTasksAction(string $_format, Request $request): JsonResponse|Response { $this->denyAccessUnlessGranted('ROLE_USER'); @@ -454,7 +454,7 @@ final class SingleTaskController extends AbstractController } } - #[Route(path: '/{_locale}/task/single-task/new', name: 'chill_task_single_task_new')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/new', name: 'chill_task_single_task_new')] public function newAction(Request $request) { $user = $this->security->getUser(); @@ -552,12 +552,12 @@ final class SingleTaskController extends AbstractController return match ($entityType) { 'person' => $this->render('@ChillTask/SingleTask/Person/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'task' => $task, 'person' => $task->getPerson(), ]), 'course' => $this->render('@ChillTask/SingleTask/AccompanyingCourse/new.html.twig', [ - 'form' => $form->createView(), + 'form' => $form, 'task' => $task, 'accompanyingCourse' => $task->getCourse(), ]), @@ -565,7 +565,7 @@ final class SingleTaskController extends AbstractController }; } - #[Route(path: '/{_locale}/task/single-task/{id}/show', name: 'chill_task_single_task_show')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/single-task/{id}/show', name: 'chill_task_single_task_show')] public function showAction(#[MapEntity(id: 'id')] SingleTask $task, Request $request): Response { $this->denyAccessUnlessGranted(TaskVoter::SHOW, $task); diff --git a/src/Bundle/ChillTaskBundle/Controller/TaskController.php b/src/Bundle/ChillTaskBundle/Controller/TaskController.php index bc0261865..8948824b9 100644 --- a/src/Bundle/ChillTaskBundle/Controller/TaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/TaskController.php @@ -42,7 +42,7 @@ class TaskController extends AbstractController * * @return Response */ - #[Route(path: '/{_locale}/task/transition/{kind}/{taskId}/{transition}', name: 'chill_task_task_transition')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/task/transition/{kind}/{taskId}/{transition}', name: 'chill_task_task_transition')] public function applyTransitionAction( $kind, $taskId, @@ -124,7 +124,7 @@ class TaskController extends AbstractController return $this->render($defaultTemplate, [ 'task' => $task, - 'form' => $form->createView(), + 'form' => $form, 'transition' => $transitionInstance, ]); } diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/AdminController.php b/src/Bundle/ChillThirdPartyBundle/Controller/AdminController.php index 2fea77814..7c3916cee 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/AdminController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/AdminController.php @@ -19,7 +19,7 @@ class AdminController extends AbstractController /** * ThirdParty admin. */ - #[Route(path: '/{_locale}/admin/thirdparty', name: 'chill_thirdparty_admin_index')] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/thirdparty', name: 'chill_thirdparty_admin_index')] public function indexAdminAction(): \Symfony\Component\HttpFoundation\Response { return $this->render('@ChillThirdParty/Admin/index.html.twig'); diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php index b40a20b9b..8f16eea98 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php @@ -38,7 +38,7 @@ class ThirdpartyCSVExportController extends AbstractController * @throws CannotInsertRecord * @throws Exception */ - #[Route(path: '/{_locale}/admin/thirdparty/export/list.{_format}', name: 'chill_thirdparty_admin_export_list', requirements: ['_format' => 'csv'])] + #[\Symfony\Component\Routing\Attribute\Route(path: '/{_locale}/admin/thirdparty/export/list.{_format}', name: 'chill_thirdparty_admin_export_list', requirements: ['_format' => 'csv'])] public function socialIssueList(Request $request, string $_format = 'csv'): StreamedResponse { if (!$this->security->isGranted('ROLE_ADMIN')) { diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php index b4e31abf2..dfd93321e 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php @@ -24,7 +24,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter $user = $this->security->getUser(); if (!$user instanceof User && $this->security->isGranted('ROLE_ADMIN')) { - return $user->getUsername(); + return $user->getUserIdentifier(); } if (!$user instanceof User) { @@ -39,7 +39,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter $user = $this->security->getUser(); if (!$user instanceof User && $this->security->isGranted('ROLE_ADMIN')) { - return $user->getUsername(); + return $user->getUserIdentifier(); } if (!$user instanceof User) {