DX: fix phpstan errors

This commit is contained in:
2023-02-07 23:03:37 +01:00
parent fa481fd795
commit f57555dab4
11 changed files with 41 additions and 41 deletions

View File

@@ -17,6 +17,7 @@ use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreFlushEventArgs;
use Doctrine\ORM\Event\PrePersistEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@@ -133,7 +134,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
/**
* @ORM\PrePersist
*/
public function onPrePersist(LifecycleEventArgs $eventArgs): void
public function onPrePersist(PrePersistEventArgs $eventArgs): void
{
$this->recentlyPersisted = true;
}

View File

@@ -17,6 +17,8 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Repository\NotificationRepository;
use Chill\MainBundle\Templating\UI\NotificationCounterInterface;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PostPersistEventArgs;
use Doctrine\ORM\Event\PostUpdateEventArgs;
use Doctrine\ORM\Event\PreFlushEventArgs;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Security\Core\User\UserInterface;
@@ -68,7 +70,7 @@ final class NotificationByUserCounter implements NotificationCounterInterface
return 'chill_main_notif_unread_by_' . $user->getId();
}
public function onEditNotificationComment(NotificationComment $notificationComment, LifecycleEventArgs $eventArgs): void
public function onEditNotificationComment(NotificationComment $notificationComment, PostPersistEventArgs $eventArgs): void
{
$this->resetCacheForNotification($notificationComment->getNotification());
}

View File

@@ -14,6 +14,8 @@ namespace Chill\MainBundle\Notification\Email;
use Chill\MainBundle\Entity\Notification;
use Chill\MainBundle\Entity\NotificationComment;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PostPersistEventArgs;
use Doctrine\ORM\Event\PostUpdateEventArgs;
use Psr\Log\LoggerInterface;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
@@ -36,7 +38,7 @@ class NotificationMailer
$this->translator = $translator;
}
public function postPersistComment(NotificationComment $comment, LifecycleEventArgs $eventArgs): void
public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void
{
foreach (
array_merge(
@@ -72,13 +74,13 @@ class NotificationMailer
/**
* Send a email after a notification is persisted.
*/
public function postPersistNotification(Notification $notification, LifecycleEventArgs $eventArgs): void
public function postPersistNotification(Notification $notification, PostPersistEventArgs $eventArgs): void
{
$this->sendNotificationEmailsToAddresses($notification);
$this->sendNotificationEmailsToAddressesEmails($notification);
}
public function postUpdateNotification(Notification $notification, LifecycleEventArgs $eventArgs): void
public function postUpdateNotification(Notification $notification, PostUpdateEventArgs $eventArgs): void
{
$this->sendNotificationEmailsToAddressesEmails($notification);
}