@@ -79,8 +79,8 @@ final public function getStorage(): UserStorage
7979
8080
8181 /**
82- * Conducts the authentication process. Parameters are optional .
83- * @param string|IIdentity $username name or Identity
82+ * Authenticates the user. Accepts username and password, or an IIdentity directly .
83+ * @param string|IIdentity $username username or identity
8484 * @throws AuthenticationException if authentication was not successful
8585 */
8686 public function login (
@@ -128,7 +128,7 @@ final public function logout(bool $clearIdentity = false): void
128128
129129
130130 /**
131- * Is this user authenticated?
131+ * Checks whether the user is authenticated.
132132 */
133133 final public function isLoggedIn (): bool
134134 {
@@ -141,7 +141,7 @@ final public function isLoggedIn(): bool
141141
142142
143143 /**
144- * Returns current user identity, if any .
144+ * Returns the current user identity, or null if not authenticated .
145145 */
146146 final public function getIdentity (): ?IIdentity
147147 {
@@ -178,6 +178,9 @@ public function getId(): string|int|null
178178 }
179179
180180
181+ /**
182+ * Discards cached authentication state, forcing a reload from storage on next access.
183+ */
181184 final public function refreshStorage (): void
182185 {
183186 $ this ->identity = $ this ->authenticated = $ this ->logoutReason = null ;
@@ -208,7 +211,7 @@ final public function getAuthenticator(): IAuthenticator
208211
209212
210213 /**
211- * Returns authentication handler.
214+ * Returns authentication handler, or null if none is set .
212215 */
213216 final public function getAuthenticatorIfExists (): ?IAuthenticator
214217 {
@@ -234,7 +237,7 @@ public function setExpiration(?string $expire, bool $clearIdentity = false): sta
234237
235238
236239 /**
237- * Why was user logged out? Returns LOGOUT_MANUAL or LOGOUT_INACTIVITY .
240+ * Returns the logout reason: LogoutManual or LogoutInactivity, or null if not applicable .
238241 */
239242 final public function getLogoutReason (): ?int
240243 {
@@ -246,7 +249,7 @@ final public function getLogoutReason(): ?int
246249
247250
248251 /**
249- * Returns a list of effective roles that a user has been granted .
252+ * Returns effective roles of the user. Unauthenticated users get the guest role .
250253 */
251254 public function getRoles (): array
252255 {
@@ -260,7 +263,7 @@ public function getRoles(): array
260263
261264
262265 /**
263- * Is a user in the specified effective role?
266+ * Checks whether the user has the specified effective role.
264267 */
265268 final public function isInRole (string $ role ): bool
266269 {
@@ -275,8 +278,8 @@ final public function isInRole(string $role): bool
275278
276279
277280 /**
278- * Has a user effective access to the Resource?
279- * If $resource is null, then the query applies to all resources .
281+ * Checks whether the user has access to the given resource and privilege.
282+ * Null means all resources or all privileges .
280283 */
281284 public function isAllowed (mixed $ resource = Authorizator::All, mixed $ privilege = Authorizator::All): bool
282285 {
@@ -314,7 +317,7 @@ final public function getAuthorizator(): Authorizator
314317
315318
316319 /**
317- * Returns current authorization handler.
320+ * Returns authorization handler, or null if none is set .
318321 */
319322 final public function getAuthorizatorIfExists (): ?Authorizator
320323 {
0 commit comments