2121 * @property-read array $roles
2222 * @property-read int $logoutReason
2323 * @property IAuthenticator $authenticator
24- * @property IAuthorizator $authorizator
24+ * @property Authorizator $authorizator
2525 */
2626class User
2727{
@@ -50,7 +50,7 @@ class User
5050 /** @var IAuthenticator|null */
5151 private $ authenticator ;
5252
53- /** @var IAuthorizator |null */
53+ /** @var Authorizator |null */
5454 private $ authorizator ;
5555
5656 /** @var IIdentity|null */
@@ -63,7 +63,7 @@ class User
6363 public function __construct (
6464 IUserStorage $ storage ,
6565 IAuthenticator $ authenticator = null ,
66- IAuthorizator $ authorizator = null
66+ Authorizator $ authorizator = null
6767 ) {
6868 $ this ->storage = $ storage ;
6969 $ this ->authenticator = $ authenticator ;
@@ -270,7 +270,7 @@ final public function isInRole(string $role): bool
270270 * Has a user effective access to the Resource?
271271 * If $resource is null, then the query applies to all resources.
272272 */
273- public function isAllowed ($ resource = IAuthorizator ::ALL , $ privilege = IAuthorizator ::ALL ): bool
273+ public function isAllowed ($ resource = Authorizator ::ALL , $ privilege = Authorizator ::ALL ): bool
274274 {
275275 foreach ($ this ->getRoles () as $ role ) {
276276 if ($ this ->getAuthorizator ()->isAllowed ($ role , $ resource , $ privilege )) {
@@ -286,7 +286,7 @@ public function isAllowed($resource = IAuthorizator::ALL, $privilege = IAuthoriz
286286 * Sets authorization handler.
287287 * @return static
288288 */
289- public function setAuthorizator (IAuthorizator $ handler )
289+ public function setAuthorizator (Authorizator $ handler )
290290 {
291291 $ this ->authorizator = $ handler ;
292292 return $ this ;
@@ -296,7 +296,7 @@ public function setAuthorizator(IAuthorizator $handler)
296296 /**
297297 * Returns current authorization handler.
298298 */
299- final public function getAuthorizator (): ?IAuthorizator
299+ final public function getAuthorizator (): ?Authorizator
300300 {
301301 if (func_num_args ()) {
302302 trigger_error (__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists() ' , E_USER_DEPRECATED );
@@ -312,7 +312,7 @@ final public function getAuthorizator(): ?IAuthorizator
312312 /**
313313 * Returns current authorization handler.
314314 */
315- final public function getAuthorizatorIfExists (): ?IAuthorizator
315+ final public function getAuthorizatorIfExists (): ?Authorizator
316316 {
317317 return $ this ->authorizator ;
318318 }
0 commit comments