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;
}
public function onAppUserSubscribersUpdated(UserSubscribersUpdatedEvent $event)
public function onAppUserSubscribersUpdated(UserSubscribersUpdatedEvent $event): void
{
$this->notifier->sendUserSubscribersUpdatedNotification($event->getUser(), $event->getSubscribedUsers(), $event->getUnsubscribedUsers());
}

View File

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

View File

@ -36,7 +36,7 @@ class UsersUpdatedSubscriber implements EventSubscriber
$this->eventDispatcher = $eventDispatcher;
}
public function getSubscribedEvents()
public function getSubscribedEvents(): array
{
return [
'preUpdate',
@ -44,7 +44,7 @@ class UsersUpdatedSubscriber implements EventSubscriber
];
}
public function preUpdate(PreUpdateEventArgs $event)
public function preUpdate(PreUpdateEventArgs $event): void
{
/** @var User $entity */
$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)) {
// Creating event for dispatch