reverted: --- b/core/lib/Drupal/Core/Session/AccountEvents.php +++ /dev/null @@ -1,28 +0,0 @@ -account = $account; $this->id = $account->id(); - $this->eventDispatcher->dispatch(AccountEvents::SET_USER, new AccountSetEvent($account)); + $this->eventDispatcher->dispatch(AccountSetEvent::SET_USER, new AccountSetEvent($account)); } /** diff -u b/core/lib/Drupal/Core/Session/AccountSetEvent.php b/core/lib/Drupal/Core/Session/AccountSetEvent.php --- b/core/lib/Drupal/Core/Session/AccountSetEvent.php +++ b/core/lib/Drupal/Core/Session/AccountSetEvent.php @@ -7,7 +7,21 @@ /** * Event fired when an account is set for the current session. */ -class AccountSetEvent extends Event { +final class AccountSetEvent extends Event { + + /** + * Name of the event fired when the current user is set. + * + * This event allows modules to perform an action whenever the current user is + * set. An event listener receives an the instance of that class. + * + * @Event + * + * @see \Drupal\Core\Session\AccountProxyInterface::setAccount() + * + * @var string + */ + const SET_USER = 'account.set'; /** * The set account. diff -u b/core/modules/system/src/TimeZoneResolver.php b/core/modules/system/src/TimeZoneResolver.php --- b/core/modules/system/src/TimeZoneResolver.php +++ b/core/modules/system/src/TimeZoneResolver.php @@ -5,8 +5,8 @@ use Drupal\Core\Config\ConfigCrudEvent; use Drupal\Core\Config\ConfigEvents; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Session\AccountEvents; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Session\AccountSetEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; @@ -76,7 +76,7 @@ // The priority for this must run directly after the authentication // subscriber. $events[KernelEvents::REQUEST][] = ['setDefaultTimeZone', 299]; - $events[AccountEvents::SET_USER][] = ['setDefaultTimeZone']; + $events[AccountSetEvent::SET_USER][] = ['setDefaultTimeZone']; return $events; }