Run symfonysetlist up to symfony_70

This commit is contained in:
2025-05-28 15:46:25 +02:00
parent abb786495a
commit 13a9e14450
128 changed files with 515 additions and 518 deletions

View File

@@ -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');

View File

@@ -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');

View File

@@ -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);

View File

@@ -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)) {

View File

@@ -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);

View File

@@ -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();

View File

@@ -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 */

View File

@@ -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')) {

View File

@@ -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')) {

View File

@@ -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);
}
}

View File

@@ -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());
}