Remove no longer used annotation use statements and replace with attribute use statements

This commit is contained in:
2025-10-01 18:38:41 +02:00
parent d8528dceab
commit 32d2bb002b
486 changed files with 495 additions and 1063 deletions

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
{

View File

@@ -19,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
class CalendarAPIController extends ApiController
{

View File

@@ -40,7 +40,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

View File

@@ -23,7 +23,6 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Bundle\SecurityBundle\Security;

View File

@@ -19,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
class CalendarRangeAPIController extends ApiController
{

View File

@@ -29,7 +29,6 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\SecurityBundle\Security;
class InviteApiController

View File

@@ -24,7 +24,6 @@ use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Token\AccessToken;

View File

@@ -23,7 +23,6 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Annotation\Route;
class RemoteCalendarMSGraphSyncController
{

View File

@@ -26,7 +26,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\SerializerInterface;
/**

View File

@@ -21,7 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
*/
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('chill_calendar');
$rootNode = $treeBuilder->getRootNode();

View File

@@ -30,7 +30,7 @@ use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;

View File

@@ -18,7 +18,7 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]

View File

@@ -17,7 +17,7 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
/**
* An invitation for another user to a Calendar.

View File

@@ -22,17 +22,17 @@ use Chill\CalendarBundle\Messenger\Message\CalendarRangeRemovedMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\MainBundle\Repository\UserRepository;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Remove a calendar range when it is removed from local calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarRangeRemoveToRemoteHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarRangeRemovedMessage $calendarRangeRemovedMessage): void
{
$this->remoteCalendarConnector->removeCalendarRange(

View File

@@ -23,17 +23,17 @@ use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterfa
use Chill\CalendarBundle\Repository\CalendarRangeRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Write calendar range creation / update to the remote calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarRangeToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) {}
public function __invoke(CalendarRangeMessage $calendarRangeMessage): void
{
$range = $this->calendarRangeRepository->find($calendarRangeMessage->getCalendarRangeId());

View File

@@ -22,7 +22,6 @@ use Chill\CalendarBundle\Messenger\Message\CalendarRemovedMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\CalendarBundle\Repository\CalendarRangeRepository;
use Chill\MainBundle\Repository\UserRepositoryInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Handle the deletion of calendar.
@@ -33,6 +32,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class CalendarRemoveHandler
{
public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) {}
public function __invoke(CalendarRemovedMessage $message): void
{
if (null !== $message->getAssociatedCalendarRangeId()) {

View File

@@ -28,17 +28,17 @@ use Chill\CalendarBundle\Repository\InviteRepository;
use Chill\MainBundle\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Write calendar creation / update to the remote calendar.
*
* @AsMessageHandler
*/
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
#[AsMessageHandler]
class CalendarToRemoteHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) {}
public function __invoke(CalendarMessage $calendarMessage): void
{
$calendar = $this->calendarRepository->find($calendarMessage->getCalendarId());

View File

@@ -22,7 +22,6 @@ use Chill\CalendarBundle\Messenger\Message\InviteUpdateMessage;
use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface;
use Chill\CalendarBundle\Repository\InviteRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Sync the local invitation to the remote calendar.
@@ -33,6 +32,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class InviteUpdateHandler
{
public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) {}
public function __invoke(InviteUpdateMessage $inviteUpdateMessage): void
{
if (null === $invite = $this->inviteRepository->find($inviteUpdateMessage->getInviteId())) {

View File

@@ -27,7 +27,6 @@ use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Handle notification of changes made by users directly on Outlook calendar.
@@ -38,6 +37,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
class MSGraphChangeNotificationHandler
{
public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) {}
public function __invoke(MSGraphChangeNotificationMessage $changeNotificationMessage): void
{
$user = $this->userRepository->find($changeNotificationMessage->getUserId());

View File

@@ -18,7 +18,7 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\RemoteCalendar\Model;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Attribute as Serializer;
class RemoteEvent
{

View File

@@ -16,7 +16,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
/**
* @internal

View File

@@ -19,7 +19,6 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Messenger\Transport\InMemoryTransport;
/**
* @internal

View File

@@ -39,7 +39,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.agent_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\AgentAggregator
public function getAggregator(): AgentAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.cancel_reason_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\CancelReasonAggregator
public function getAggregator(): CancelReasonAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.job_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\JobAggregator
public function getAggregator(): JobAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\LocationAggregator
public function getAggregator(): LocationAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.location_type_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\LocationTypeAggregator
public function getAggregator(): LocationTypeAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.month_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\MonthYearAggregator
public function getAggregator(): MonthYearAggregator
{
return $this->aggregator;
}

View File

@@ -39,7 +39,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest
$this->aggregator = self::getContainer()->get('chill.calendar.export.scope_aggregator');
}
public function getAggregator(): \Chill\CalendarBundle\Export\Aggregator\ScopeAggregator
public function getAggregator(): ScopeAggregator
{
return $this->aggregator;
}

View File

@@ -46,7 +46,7 @@ final class AgentFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.agent_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\AgentFilter
public function getFilter(): AgentFilter
{
return $this->filter;
}

View File

@@ -46,7 +46,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.between_dates_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\BetweenDatesFilter
public function getFilter(): BetweenDatesFilter
{
return $this->filter;
}

View File

@@ -47,7 +47,7 @@ final class JobFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.job_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\JobFilter
public function getFilter(): JobFilter
{
return $this->filter;
}

View File

@@ -47,7 +47,7 @@ final class ScopeFilterTest extends AbstractFilterTest
$this->filter = self::getContainer()->get('chill.calendar.export.scope_filter');
}
public function getFilter(): \Chill\CalendarBundle\Export\Filter\ScopeFilter
public function getFilter(): ScopeFilter
{
return $this->filter;
}