mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -30,14 +30,8 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class CalendarEntityListener
|
||||
{
|
||||
private MessageBusInterface $messageBus;
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(MessageBusInterface $messageBus, Security $security)
|
||||
public function __construct(private MessageBusInterface $messageBus, private Security $security)
|
||||
{
|
||||
$this->messageBus = $messageBus;
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function postPersist(Calendar $calendar, PostPersistEventArgs $args): void
|
||||
|
@@ -30,14 +30,8 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class CalendarRangeEntityListener
|
||||
{
|
||||
private MessageBusInterface $messageBus;
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(MessageBusInterface $messageBus, Security $security)
|
||||
public function __construct(private MessageBusInterface $messageBus, private Security $security)
|
||||
{
|
||||
$this->messageBus = $messageBus;
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function postPersist(CalendarRange $calendarRange, PostPersistEventArgs $eventArgs): void
|
||||
|
@@ -31,14 +31,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class CalendarRangeRemoveToRemoteHandler implements MessageHandlerInterface
|
||||
{
|
||||
private RemoteCalendarConnectorInterface $remoteCalendarConnector;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(RemoteCalendarConnectorInterface $remoteCalendarConnector, UserRepository $userRepository)
|
||||
public function __construct(private RemoteCalendarConnectorInterface $remoteCalendarConnector, private UserRepository $userRepository)
|
||||
{
|
||||
$this->remoteCalendarConnector = $remoteCalendarConnector;
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
public function __invoke(CalendarRangeRemovedMessage $calendarRangeRemovedMessage)
|
||||
|
@@ -32,20 +32,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class CalendarRangeToRemoteHandler implements MessageHandlerInterface
|
||||
{
|
||||
private CalendarRangeRepository $calendarRangeRepository;
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private RemoteCalendarConnectorInterface $remoteCalendarConnector;
|
||||
|
||||
public function __construct(
|
||||
CalendarRangeRepository $calendarRangeRepository,
|
||||
RemoteCalendarConnectorInterface $remoteCalendarConnector,
|
||||
EntityManagerInterface $entityManager
|
||||
) {
|
||||
$this->calendarRangeRepository = $calendarRangeRepository;
|
||||
$this->remoteCalendarConnector = $remoteCalendarConnector;
|
||||
$this->entityManager = $entityManager;
|
||||
public function __construct(private CalendarRangeRepository $calendarRangeRepository, private RemoteCalendarConnectorInterface $remoteCalendarConnector, private EntityManagerInterface $entityManager)
|
||||
{
|
||||
}
|
||||
|
||||
public function __invoke(CalendarRangeMessage $calendarRangeMessage): void
|
||||
|
@@ -31,17 +31,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class CalendarRemoveHandler implements MessageHandlerInterface
|
||||
{
|
||||
private CalendarRangeRepository $calendarRangeRepository;
|
||||
|
||||
private RemoteCalendarConnectorInterface $remoteCalendarConnector;
|
||||
|
||||
private UserRepositoryInterface $userRepository;
|
||||
|
||||
public function __construct(RemoteCalendarConnectorInterface $remoteCalendarConnector, CalendarRangeRepository $calendarRangeRepository, UserRepositoryInterface $userRepository)
|
||||
public function __construct(private RemoteCalendarConnectorInterface $remoteCalendarConnector, private CalendarRangeRepository $calendarRangeRepository, private UserRepositoryInterface $userRepository)
|
||||
{
|
||||
$this->remoteCalendarConnector = $remoteCalendarConnector;
|
||||
$this->calendarRangeRepository = $calendarRangeRepository;
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
public function __invoke(CalendarRemovedMessage $message)
|
||||
|
@@ -37,32 +37,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class CalendarToRemoteHandler implements MessageHandlerInterface
|
||||
{
|
||||
private RemoteCalendarConnectorInterface $calendarConnector;
|
||||
|
||||
private CalendarRangeRepository $calendarRangeRepository;
|
||||
|
||||
private CalendarRepository $calendarRepository;
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private InviteRepository $inviteRepository;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(
|
||||
CalendarRangeRepository $calendarRangeRepository,
|
||||
CalendarRepository $calendarRepository,
|
||||
EntityManagerInterface $entityManager,
|
||||
InviteRepository $inviteRepository,
|
||||
RemoteCalendarConnectorInterface $calendarConnector,
|
||||
UserRepository $userRepository
|
||||
) {
|
||||
$this->calendarConnector = $calendarConnector;
|
||||
$this->calendarRepository = $calendarRepository;
|
||||
$this->calendarRangeRepository = $calendarRangeRepository;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->userRepository = $userRepository;
|
||||
$this->inviteRepository = $inviteRepository;
|
||||
public function __construct(private CalendarRangeRepository $calendarRangeRepository, private CalendarRepository $calendarRepository, private EntityManagerInterface $entityManager, private InviteRepository $inviteRepository, private RemoteCalendarConnectorInterface $calendarConnector, private UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function __invoke(CalendarMessage $calendarMessage)
|
||||
|
@@ -31,17 +31,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class InviteUpdateHandler implements MessageHandlerInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private InviteRepository $inviteRepository;
|
||||
|
||||
private RemoteCalendarConnectorInterface $remoteCalendarConnector;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, InviteRepository $inviteRepository, RemoteCalendarConnectorInterface $remoteCalendarConnector)
|
||||
public function __construct(private EntityManagerInterface $em, private InviteRepository $inviteRepository, private RemoteCalendarConnectorInterface $remoteCalendarConnector)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->inviteRepository = $inviteRepository;
|
||||
$this->remoteCalendarConnector = $remoteCalendarConnector;
|
||||
}
|
||||
|
||||
public function __invoke(InviteUpdateMessage $inviteUpdateMessage): void
|
||||
|
@@ -36,40 +36,8 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
*/
|
||||
class MSGraphChangeNotificationHandler implements MessageHandlerInterface
|
||||
{
|
||||
private CalendarRangeRepository $calendarRangeRepository;
|
||||
|
||||
private CalendarRangeSyncer $calendarRangeSyncer;
|
||||
|
||||
private CalendarRepository $calendarRepository;
|
||||
|
||||
private CalendarSyncer $calendarSyncer;
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
private MapCalendarToUser $mapCalendarToUser;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(
|
||||
CalendarRangeRepository $calendarRangeRepository,
|
||||
CalendarRangeSyncer $calendarRangeSyncer,
|
||||
CalendarRepository $calendarRepository,
|
||||
CalendarSyncer $calendarSyncer,
|
||||
EntityManagerInterface $em,
|
||||
LoggerInterface $logger,
|
||||
MapCalendarToUser $mapCalendarToUser,
|
||||
UserRepository $userRepository
|
||||
) {
|
||||
$this->calendarRangeRepository = $calendarRangeRepository;
|
||||
$this->calendarRangeSyncer = $calendarRangeSyncer;
|
||||
$this->calendarRepository = $calendarRepository;
|
||||
$this->calendarSyncer = $calendarSyncer;
|
||||
$this->em = $em;
|
||||
$this->logger = $logger;
|
||||
$this->mapCalendarToUser = $mapCalendarToUser;
|
||||
$this->userRepository = $userRepository;
|
||||
public function __construct(private CalendarRangeRepository $calendarRangeRepository, private CalendarRangeSyncer $calendarRangeSyncer, private CalendarRepository $calendarRepository, private CalendarSyncer $calendarSyncer, private EntityManagerInterface $em, private LoggerInterface $logger, private MapCalendarToUser $mapCalendarToUser, private UserRepository $userRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function __invoke(MSGraphChangeNotificationMessage $changeNotificationMessage): void
|
||||
|
@@ -28,8 +28,6 @@ class CalendarMessage
|
||||
|
||||
public const CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE';
|
||||
|
||||
private string $action;
|
||||
|
||||
private int $byUserId;
|
||||
|
||||
private int $calendarId;
|
||||
@@ -47,12 +45,11 @@ class CalendarMessage
|
||||
|
||||
public function __construct(
|
||||
Calendar $calendar,
|
||||
string $action,
|
||||
private string $action,
|
||||
User $byUser
|
||||
) {
|
||||
$this->calendarId = $calendar->getId();
|
||||
$this->byUserId = $byUser->getId();
|
||||
$this->action = $action;
|
||||
$this->previousCalendarRangeId = null !== $calendar->previousCalendarRange ?
|
||||
$calendar->previousCalendarRange->getId() : null;
|
||||
$this->previousMainUserId = null !== $calendar->previousMainUser ?
|
||||
|
@@ -27,15 +27,12 @@ class CalendarRangeMessage
|
||||
|
||||
public const CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE';
|
||||
|
||||
private string $action;
|
||||
|
||||
private ?int $byUserId = null;
|
||||
|
||||
private int $calendarRangeId;
|
||||
|
||||
public function __construct(CalendarRange $calendarRange, string $action, ?User $byUser)
|
||||
public function __construct(CalendarRange $calendarRange, private string $action, ?User $byUser)
|
||||
{
|
||||
$this->action = $action;
|
||||
$this->calendarRangeId = $calendarRange->getId();
|
||||
|
||||
if (null !== $byUser) {
|
||||
|
@@ -20,14 +20,8 @@ namespace Chill\CalendarBundle\Messenger\Message;
|
||||
|
||||
class MSGraphChangeNotificationMessage
|
||||
{
|
||||
private array $content;
|
||||
|
||||
private int $userId;
|
||||
|
||||
public function __construct(array $content, int $userId)
|
||||
public function __construct(private array $content, private int $userId)
|
||||
{
|
||||
$this->content = $content;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
public function getContent(): array
|
||||
|
Reference in New Issue
Block a user