mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
Apply rector rules: symfony up to 54
This commit is contained in:
@@ -26,32 +26,24 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/notification")
|
||||
*/
|
||||
#[Route(path: '/api/1.0/main/notification')]
|
||||
class NotificationApiController
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {}
|
||||
|
||||
/**
|
||||
* @Route("/{id}/mark/read", name="chill_api_main_notification_mark_read", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/mark/read', name: 'chill_api_main_notification_mark_read', methods: ['POST'])]
|
||||
public function markAsRead(Notification $notification): JsonResponse
|
||||
{
|
||||
return $this->markAs('read', $notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{id}/mark/unread", name="chill_api_main_notification_mark_unread", methods={"POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/mark/unread', name: 'chill_api_main_notification_mark_unread', methods: ['POST'])]
|
||||
public function markAsUnread(Notification $notification): JsonResponse
|
||||
{
|
||||
return $this->markAs('unread', $notification);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/my/unread")
|
||||
*/
|
||||
#[Route(path: '/my/unread')]
|
||||
public function myUnreadNotifications(Request $request): JsonResponse
|
||||
{
|
||||
$total = $this->notificationRepository->countUnreadByUser($this->security->getUser());
|
||||
|
Reference in New Issue
Block a user