@@ -41,35 +41,25 @@ class User
4141 public const LOGOUT_MANUAL = self ::LogoutManual;
4242 public const LOGOUT_INACTIVITY = self ::LogoutInactivity;
4343
44- /** @var string default role for unauthenticated user */
45- public $ guestRole = 'guest ' ;
44+ /** default role for unauthenticated user */
45+ public string $ guestRole = 'guest ' ;
4646
47- /** @var string default role for authenticated user without own identity */
48- public $ authenticatedRole = 'authenticated ' ;
47+ /** default role for authenticated user without own identity */
48+ public string $ authenticatedRole = 'authenticated ' ;
4949
5050 /** @var callable[] function (User $sender): void; Occurs when the user is successfully logged in */
51- public $ onLoggedIn = [];
51+ public array $ onLoggedIn = [];
5252
5353 /** @var callable[] function (User $sender): void; Occurs when the user is logged out */
54- public $ onLoggedOut = [];
55-
56- /** @var UserStorage|IUserStorage Session storage for current user */
57- private $ storage ;
58-
59- /** @var IAuthenticator|null */
60- private $ authenticator ;
61-
62- /** @var Authorizator|null */
63- private $ authorizator ;
64-
65- /** @var IIdentity|null */
66- private $ identity ;
67-
68- /** @var bool|null */
69- private $ authenticated ;
70-
71- /** @var int|null */
72- private $ logoutReason ;
54+ public array $ onLoggedOut = [];
55+
56+ /** Session storage for current user */
57+ private UserStorage |IUserStorage $ storage ;
58+ private ?IAuthenticator $ authenticator ;
59+ private ?Authorizator $ authorizator ;
60+ private ?IIdentity $ identity = null ;
61+ private ?bool $ authenticated = null ;
62+ private ?int $ logoutReason = null ;
7363
7464
7565 public function __construct (
0 commit comments