$logoutUrl = null;
try { $logoutUrl =
$this->logoutUrlGenerator?->
getLogoutPath();
} catch (\Exception
) { // fail silently when the logout URL cannot be generated
} $this->data =
[ 'enabled' => true,
'authenticated' =>
(bool) $token->
getUser(),
'impersonated' => null !==
$impersonatorUser,
'impersonator_user' =>
$impersonatorUser,
'impersonation_exit_path' => null,
'token' =>
$token,
'token_class' =>
$this->hasVarDumper ?
new ClassStub($token::
class) :
$token::
class,
'logout_url' =>
$logoutUrl,
'user' =>
$token->
getUserIdentifier(),
'roles' =>
$assignedRoles,
'inherited_roles' =>
array_unique($inheritedRoles),
'supports_role_hierarchy' => null !==
$this->roleHierarchy,
];
}