Skip to content

Commit

Permalink
Retravaille les noms des routes et controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca committed Nov 4, 2024
1 parent 81d6108 commit a8f6720
Show file tree
Hide file tree
Showing 70 changed files with 128 additions and 136 deletions.
2 changes: 1 addition & 1 deletion src/Infrastructure/Controller/AccessRequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __invoke(Request $request): Response

return new Response(
$this->twig->render(
name: 'accessRequest.html.twig',
name: 'access_request.html.twig',
context: [
'form' => $form->createView(),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class GetRegulationsController
final class GetDatexRegulationsController
{
public function __construct(
private \Twig\Environment $twig,
Expand All @@ -22,15 +22,15 @@ public function __construct(
#[Route(
'/api/regulations.{_format}',
methods: 'GET',
name: 'api_regulations_list',
name: 'api_regulations_datex',
requirements: ['_format' => 'xml'],
)]
public function __invoke(): Response
{
$regulationOrders = $this->queryBus->handle(new GetRegulationOrdersToDatexFormatQuery());

return new Response(
$this->twig->render('api/regulations.xml.twig', [
$this->twig->render('api/datex_regulations.xml.twig', [
'publicationTime' => $this->dateUtils->getNow(),
'regulationOrders' => $regulationOrders,
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface;

final class MapDataController
final class GetMapDataFragmentController
{
public function __construct(
private FormFactoryInterface $formFactory,
Expand All @@ -24,7 +24,7 @@ public function __construct(

#[Route(
'/carte/data.geojson',
name: 'app_carto_data',
name: 'app_map_data',
methods: ['GET'],
)]
public function __invoke(Request $request): Response
Expand All @@ -34,7 +34,7 @@ public function __invoke(Request $request): Response
type: MapFilterFormType::class,
data: $dto,
options: [
'action' => $this->router->generate('app_carto_data'),
'action' => $this->router->generate('app_map_data'),
'method' => 'GET',
'attr' => [
'data-turbo-action' => 'replace',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Requirement\Requirement;

final class GetLocationController
final class GetMapLocationFragmentController
{
public function __construct(
private \Twig\Environment $twig,
Expand All @@ -23,7 +23,7 @@ public function __construct(
}

#[Route(
'/map/fragments/location/{uuid}',
'/_fragment/map/location/{uuid}',
name: 'fragment_map_location',
requirements: ['uuid' => Requirement::UUID],
methods: ['GET'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\Routing\Annotation\Route;

final class MapSearchController
final class SearchMapFragmentController
{
public function __construct(
private \Twig\Environment $twig,
Expand All @@ -19,7 +19,7 @@ public function __construct(

#[Route(
'/_fragment/map/search',
name: 'fragment_carto_search',
name: 'fragment_map_search',
methods: ['GET'],
)]
public function __invoke(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
use App\Infrastructure\Controller\DTO\MapFilterDTO;
use App\Infrastructure\Form\Map\MapFilterFormType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\RouterInterface;

final class MapController
final class GetMapController
{
public function __construct(
private \Twig\Environment $twig,
Expand All @@ -25,17 +24,17 @@ public function __construct(

#[Route(
'/carte',
name: 'app_carto',
name: 'app_map',
methods: ['GET'],
)]
public function __invoke(Request $request): Response
public function __invoke(): Response
{
$dto = new MapFilterDTO($this->dateUtils->getNow());
$form = $this->formFactory->create(
type: MapFilterFormType::class,
data: $dto,
options: [
'action' => $this->router->generate('app_carto_data'),
'action' => $this->router->generate('app_map_data'),
'method' => 'GET',
],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class IndexController
final class MyAreaController
{
public function __construct(
private \Twig\Environment $twig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(

#[Route(
'/organizations/{uuid}/edit',
name: 'app_config_organization_edit',
name: 'app_my_area_organization_edit',
requirements: ['uuid' => Requirement::UUID],
methods: ['GET', 'POST'],
)]
Expand All @@ -61,7 +61,7 @@ public function __invoke(Request $request, string $uuid): Response
$this->commandBus->handle($command);

return new RedirectResponse(
url: $this->router->generate('app_config_organization_detail', ['uuid' => $uuid]),
url: $this->router->generate('app_my_area_organization_detail', ['uuid' => $uuid]),
status: Response::HTTP_SEE_OTHER,
);
} catch (SiretAlreadyExistException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(

#[Route(
'/organizations/{uuid}',
name: 'app_config_organization_detail',
name: 'app_my_area_organization_detail',
requirements: ['uuid' => Requirement::UUID],
methods: ['GET'],
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/users/add',
name: 'app_users_add',
name: 'app_my_area_users_add',
requirements: ['organizationUuid' => Requirement::UUID],
methods: ['GET', 'POST'],
)]
Expand All @@ -60,7 +60,7 @@ public function __invoke(Request $request, string $organizationUuid): Response
$this->commandBus->handle($command);

return new RedirectResponse(
url: $this->router->generate('app_users_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_users_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
} catch (UserAlreadyRegisteredException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid;

final class DeleteOrganizationUserController
final class DeleteUserController
{
public function __construct(
private RouterInterface $router,
Expand All @@ -33,7 +33,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/users/{uuid}',
name: 'app_organization_users_delete',
name: 'app_my_area_users_delete',
requirements: ['organizationUuid' => Requirement::UUID, 'uuid' => Requirement::UUID],
methods: ['DELETE'],
)]
Expand All @@ -56,7 +56,7 @@ public function __invoke(string $organizationUuid, string $uuid): RedirectRespon
$this->commandBus->handle(new DeleteOrganizationUserCommand($organizationUser));

return new RedirectResponse(
url: $this->router->generate('app_users_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_users_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/users/{uuid}/edit',
name: 'app_users_edit',
name: 'app_my_area_users_edit',
requirements: ['organizationUuid' => Requirement::UUID, 'uuid' => Requirement::UUID],
methods: ['GET', 'POST'],
)]
Expand Down Expand Up @@ -70,7 +70,7 @@ public function __invoke(Request $request, string $organizationUuid, string $uui
$this->commandBus->handle($command);

return new RedirectResponse(
url: $this->router->generate('app_users_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_users_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
} catch (EmailAlreadyExistsException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(

#[Route(
'/organizations/{uuid}/users',
name: 'app_users_list',
name: 'app_my_area_users_list',
requirements: ['uuid' => Requirement::UUID],
methods: ['GET'],
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/visa_models/add',
name: 'app_config_visa_models_add',
name: 'app_my_area_config_visa_models_add',
requirements: ['organizationUuid' => Requirement::UUID],
methods: ['GET', 'POST'],
)]
Expand All @@ -55,7 +55,7 @@ public function __invoke(Request $request, string $organizationUuid): Response
$this->commandBus->handle($command);

return new RedirectResponse(
url: $this->router->generate('app_config_visa_models_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_config_visa_models_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/visa_models/{uuid}',
name: 'app_config_visa_models_delete',
name: 'app_my_area_config_visa_models_delete',
requirements: ['organizationUuid' => Requirement::UUID, 'uuid' => Requirement::UUID],
methods: ['DELETE'],
)]
Expand All @@ -54,7 +54,7 @@ public function __invoke(string $organizationUuid, string $uuid): RedirectRespon
}

return new RedirectResponse(
url: $this->router->generate('app_config_visa_models_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_config_visa_models_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/visa_models/{uuid}/duplicate',
name: 'app_config_visa_models_duplicate',
name: 'app_my_area_config_visa_models_duplicate',
requirements: ['organizationUuid' => Requirement::UUID, 'uuid' => Requirement::UUID],
methods: ['POST'],
)]
Expand All @@ -57,7 +57,7 @@ public function __invoke(Request $request, string $organizationUuid, string $uui
$session->getFlashBag()->add('success', $this->translator->trans('visa.duplicated.success'));

return new RedirectResponse(
url: $this->router->generate('app_config_visa_models_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_config_visa_models_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
} catch (VisaModelNotFoundException $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(

#[Route(
'/organizations/{organizationUuid}/visa_models/{uuid}/edit',
name: 'app_config_visa_models_edit',
name: 'app_my_area_config_visa_models_edit',
requirements: ['organizationUuid' => Requirement::UUID, 'uuid' => Requirement::UUID],
methods: ['GET', 'POST'],
)]
Expand All @@ -64,7 +64,7 @@ public function __invoke(Request $request, string $organizationUuid, string $uui
$this->commandBus->handle($command);

return new RedirectResponse(
url: $this->router->generate('app_config_visa_models_list', ['uuid' => $organizationUuid]),
url: $this->router->generate('app_my_area_config_visa_models_list', ['uuid' => $organizationUuid]),
status: Response::HTTP_SEE_OTHER,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(

#[Route(
'/organizations/{uuid}/visa_models',
name: 'app_config_visa_models_list',
name: 'app_my_area_config_visa_models_list',
requirements: ['uuid' => Requirement::UUID],
methods: ['GET'],
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\UX\Turbo\TurboBundle;

final class AddMeasureController extends AbstractRegulationController
final class AddMeasureFragmentController extends AbstractRegulationController
{
public function __construct(
private \Twig\Environment $twig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;

final class GetCityCompletionFragmentController
final class GetCityCompletionsFragmentController
{
public function __construct(
private GeocoderInterface $geocoder,
Expand All @@ -21,7 +21,7 @@ public function __construct(
#[Route(
'/_fragment/city-completions',
methods: 'GET',
name: 'fragment_city_completion',
name: 'fragment_city_completions',
)]
public function __invoke(Request $request): Response
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Requirement\Requirement;

final class GetGeneralInfoController extends AbstractRegulationController
final class GetGeneralInfoFragmentController extends AbstractRegulationController
{
public function __construct(
private readonly \Twig\Environment $twig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;

final class GetIntersectionCompletionFragmentController
final class GetIntersectionCompletionsFragmentController
{
public function __construct(
private IntersectionGeocoderInterface $intersectionGeocoder,
Expand All @@ -21,7 +21,7 @@ public function __construct(
#[Route(
'/_fragment/intersection-completions',
methods: 'GET',
name: 'fragment_intersection_completion',
name: 'fragment_intersection_completions',
)]
public function __invoke(Request $request): Response
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Requirement\Requirement;

final class GetMeasureController extends AbstractRegulationController
final class GetMeasureFragmentController extends AbstractRegulationController
{
public function __construct(
private readonly \Twig\Environment $twig,
Expand Down
Loading

0 comments on commit a8f6720

Please sign in to comment.