permissions: Avoid null as init for PermissionManager->usersRights cache

Using the empty array as init value and to reset the cache avoids
implicit array casts on the usages, which makes the type clear

Change-Id: I9b3a8786aeb79084b4d44169768d375cace36d92
This commit is contained in:
Umherirrender 2021-09-22 22:28:32 +02:00
parent 7a545309c7
commit 1866aef83c

View file

@ -109,7 +109,7 @@ class PermissionManager {
private $userCache;
/** @var string[][] Cached user rights */
private $usersRights = null;
private $usersRights = [];
/**
* Temporary user rights, valid for the current request only.
@ -1478,7 +1478,7 @@ class PermissionManager {
$rightsCacheKey = $this->getRightsCacheKey( $user );
unset( $this->usersRights[ $rightsCacheKey ] );
} else {
$this->usersRights = null;
$this->usersRights = [];
}
}