From 79fcf8be8ed90f5568a7c418be03cea2f26f3887 Mon Sep 17 00:00:00 2001 From: Paula Date: Thu, 22 Oct 2020 14:36:41 +0200 Subject: [PATCH] Fixed doctrine listener arguments (#31) --- src/EventListener/AssignLocaleListener.php | 23 ++++------------------ 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/EventListener/AssignLocaleListener.php b/src/EventListener/AssignLocaleListener.php index 0500bd5..0329d7c 100644 --- a/src/EventListener/AssignLocaleListener.php +++ b/src/EventListener/AssignLocaleListener.php @@ -4,7 +4,7 @@ namespace Locastic\ApiPlatformTranslationBundle\EventListener; -use Doctrine\Common\Persistence\Event\LifecycleEventArgs; +use Doctrine\Common\EventArgs; use Locastic\ApiPlatformTranslationBundle\Model\TranslatableInterface; use Locastic\ApiPlatformTranslationBundle\Translation\Translator; @@ -25,38 +25,23 @@ class AssignLocaleListener */ private $defaultLocale; - /** - * AssignLocaleListener constructor. - * - * @param Translator $translator - * @param string $defaultLocale - */ public function __construct(Translator $translator, string $defaultLocale = 'en') { $this->translator = $translator; $this->defaultLocale = $defaultLocale; } - /** - * @param LifecycleEventArgs $args - */ - public function postLoad(LifecycleEventArgs $args): void + public function postLoad(EventArgs $args): void { $this->assignLocale($args); } - /** - * @param LifecycleEventArgs $args - */ - public function prePersist(LifecycleEventArgs $args): void + public function prePersist(EventArgs $args): void { $this->assignLocale($args); } - /** - * @param LifecycleEventArgs $args - */ - private function assignLocale(LifecycleEventArgs $args): void + private function assignLocale(EventArgs $args): void { $object = $args->getObject();