New PHP 7.1 type hints for Event Listeners.

This commit is contained in:
Alexey Skobkin 2017-01-13 02:16:50 +03:00
parent a02250a8df
commit 54903e2ad3
3 changed files with 5 additions and 5 deletions

View file

@ -23,7 +23,7 @@ class UserSubscribersUpdatedListener
$this->notifier = $notifier; $this->notifier = $notifier;
} }
public function onAppUserSubscribersUpdated(UserSubscribersUpdatedEvent $event) public function onAppUserSubscribersUpdated(UserSubscribersUpdatedEvent $event): void
{ {
$this->notifier->sendUserSubscribersUpdatedNotification($event->getUser(), $event->getSubscribedUsers(), $event->getUnsubscribedUsers()); $this->notifier->sendUserSubscribersUpdatedNotification($event->getUser(), $event->getSubscribedUsers(), $event->getUnsubscribedUsers());
} }

View file

@ -23,7 +23,7 @@ class UsersRenamedListener
$this->notifier = $notifier; $this->notifier = $notifier;
} }
public function onAppUsersRenamed(UsersRenamedEvent $event) public function onAppUsersRenamed(UsersRenamedEvent $event): void
{ {
$this->notifier->sendUsersRenamedNotification($event->getRenames()); $this->notifier->sendUsersRenamedNotification($event->getRenames());
} }

View file

@ -36,7 +36,7 @@ class UsersUpdatedSubscriber implements EventSubscriber
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
} }
public function getSubscribedEvents() public function getSubscribedEvents(): array
{ {
return [ return [
'preUpdate', 'preUpdate',
@ -44,7 +44,7 @@ class UsersUpdatedSubscriber implements EventSubscriber
]; ];
} }
public function preUpdate(PreUpdateEventArgs $event) public function preUpdate(PreUpdateEventArgs $event): void
{ {
/** @var User $entity */ /** @var User $entity */
$entity = $event->getObject(); $entity = $event->getObject();
@ -58,7 +58,7 @@ class UsersUpdatedSubscriber implements EventSubscriber
} }
} }
public function postFlush(PostFlushEventArgs $event) public function postFlush(PostFlushEventArgs $event): void
{ {
if (0 !== count($this->renames)) { if (0 !== count($this->renames)) {
// Creating event for dispatch // Creating event for dispatch