@@ -38,35 +38,25 @@ class User
3838 LOGOUT_MANUAL = UserStorage::LOGOUT_MANUAL ,
3939 LOGOUT_INACTIVITY = UserStorage::LOGOUT_INACTIVITY ;
4040
41- /** @var string default role for unauthenticated user */
42- public $ guestRole = 'guest ' ;
41+ /** default role for unauthenticated user */
42+ public string $ guestRole = 'guest ' ;
4343
44- /** @var string default role for authenticated user without own identity */
45- public $ authenticatedRole = 'authenticated ' ;
44+ /** default role for authenticated user without own identity */
45+ public string $ authenticatedRole = 'authenticated ' ;
4646
4747 /** @var callable[] function (User $sender): void; Occurs when the user is successfully logged in */
48- public $ onLoggedIn = [];
48+ public iterable $ onLoggedIn = [];
4949
5050 /** @var callable[] function (User $sender): void; Occurs when the user is logged out */
51- public $ onLoggedOut = [];
52-
53- /** @var UserStorage|IUserStorage Session storage for current user */
54- private $ storage ;
55-
56- /** @var IAuthenticator|null */
57- private $ authenticator ;
58-
59- /** @var Authorizator|null */
60- private $ authorizator ;
61-
62- /** @var IIdentity|null */
63- private $ identity ;
64-
65- /** @var bool|null */
66- private $ authenticated ;
67-
68- /** @var int|null */
69- private $ logoutReason ;
51+ public iterable $ onLoggedOut = [];
52+
53+ /** Session storage for current user */
54+ private UserStorage |IUserStorage $ storage ;
55+ private ?IAuthenticator $ authenticator ;
56+ private ?Authorizator $ authorizator ;
57+ private ?IIdentity $ identity = null ;
58+ private ?bool $ authenticated = null ;
59+ private ?int $ logoutReason = null ;
7060
7161
7262 public function __construct (
0 commit comments