mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -19,14 +19,12 @@ use Chill\MainBundle\Security\Authorization\NotificationVoter;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use Chill\MainBundle\Serializer\Model\Counter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/main/notification")
|
||||
@@ -91,13 +89,13 @@ class NotificationApiController
|
||||
$user = $this->security->getUser();
|
||||
|
||||
if (!$user instanceof User) {
|
||||
throw new RuntimeException('not possible to mark as read by this user');
|
||||
throw new \RuntimeException('not possible to mark as read by this user');
|
||||
}
|
||||
|
||||
match ($target) {
|
||||
'read' => $notification->markAsReadBy($user),
|
||||
'unread' => $notification->markAsUnreadBy($user),
|
||||
default => throw new UnexpectedValueException("target not supported: {$target}"),
|
||||
default => throw new \UnexpectedValueException("target not supported: {$target}"),
|
||||
};
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
Reference in New Issue
Block a user