You are here

public function UsernameEventVariables::userIsAnonymous in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/preprocess_event_dispatcher/src/Variables/UsernameEventVariables.php \Drupal\preprocess_event_dispatcher\Variables\UsernameEventVariables::userIsAnonymous()

Whether the user is anonymous or not.

Return value

bool Is it?

File

modules/preprocess_event_dispatcher/src/Variables/UsernameEventVariables.php, line 18

Class

UsernameEventVariables
Class UsernameEventVariables.

Namespace

Drupal\preprocess_event_dispatcher\Variables

Code

public function userIsAnonymous() : bool {
  return $this
    ->getAccount()
    ->isAnonymous();
}