Apply rector rules: symfony up to 54

This commit is contained in:
2024-04-04 23:30:25 +02:00
parent 1ee3b9e2f0
commit 579bd829f8
204 changed files with 974 additions and 2346 deletions

View File

@@ -65,9 +65,7 @@ class ExportController extends AbstractController
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
}
/**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/download/{alias}", name="chill_main_export_download", methods={"GET"})
*/
#[Route(path: '/{_locale}/exports/download/{alias}', name: 'chill_main_export_download', methods: ['GET'])]
public function downloadResultAction(Request $request, mixed $alias)
{
/** @var ExportManager $exportManager */
@@ -109,9 +107,11 @@ class ExportController extends AbstractController
* @param string $alias
*
* @return Response
* @return Response
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"})
*/
#[Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])]
public function generateAction(Request $request, $alias)
{
/** @var ExportManager $exportManager */
@@ -130,10 +130,9 @@ class ExportController extends AbstractController
}
/**
* @Route("/{_locale}/exports/generate-from-saved/{id}", name="chill_main_export_generate_from_saved")
*
* @throws \RedisException
*/
#[Route(path: '/{_locale}/exports/generate-from-saved/{id}', name: 'chill_main_export_generate_from_saved')]
public function generateFromSavedExport(SavedExport $savedExport): RedirectResponse
{
$this->denyAccessUnlessGranted(SavedExportVoter::GENERATE, $savedExport);
@@ -154,9 +153,8 @@ class ExportController extends AbstractController
/**
* Render the list of available exports.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/", name="chill_main_export_index")
*/
#[Route(path: '/{_locale}/exports/', name: 'chill_main_export_index')]
public function indexAction(): Response
{
$exportManager = $this->exportManager;
@@ -179,9 +177,8 @@ class ExportController extends AbstractController
* stored in the session (if valid), and then a redirection is done to next step.
* 3. 'generate': gather data from session from the previous steps, and
* make a redirection to the "generate" action with data in query (HTTP GET)
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/new/{alias}", name="chill_main_export_new")
*/
#[Route(path: '/{_locale}/exports/new/{alias}', name: 'chill_main_export_new')]
public function newAction(Request $request, string $alias): Response
{
// first check for ACL
@@ -205,9 +202,7 @@ class ExportController extends AbstractController
};
}
/**
* @Route("/{_locale}/export/saved/update-from-key/{id}/{key}", name="chill_main_export_saved_edit_options_from_key")
*/
#[Route(path: '/{_locale}/export/saved/update-from-key/{id}/{key}', name: 'chill_main_export_saved_edit_options_from_key')]
public function editSavedExportOptionsFromKey(SavedExport $savedExport, string $key): Response
{
$this->denyAccessUnlessGranted('ROLE_USER');
@@ -227,9 +222,7 @@ class ExportController extends AbstractController
return $this->redirectToRoute('chill_main_export_saved_edit', ['id' => $savedExport->getId()]);
}
/**
* @Route("/{_locale}/export/save-from-key/{alias}/{key}", name="chill_main_export_save_from_key")
*/
#[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');