session: Add debug message for the used store class
[lhc/web/wiklou.git] / includes / Permissions / PermissionManager.php
index 37791d0..a361639 100644 (file)
@@ -56,12 +56,10 @@ class PermissionManager {
        const RIGOR_SECURE = 'secure';
 
        /**
-        * TODO Make this const when HHVM support is dropped (T192166)
-        *
         * @since 1.34
         * @var array
         */
-       public static $constructorOptions = [
+       public const CONSTRUCTOR_OPTIONS = [
                'WhitelistRead',
                'WhitelistReadRegexp',
                'EmailConfirmToEdit',
@@ -85,8 +83,8 @@ class PermissionManager {
        /** @var NamespaceInfo */
        private $nsInfo;
 
-       /** @var string[] Cached results of getAllRights() */
-       private $allRights = false;
+       /** @var string[]|null Cached results of getAllRights() */
+       private $allRights;
 
        /** @var string[][] Cached user rights */
        private $usersRights = null;
@@ -97,7 +95,7 @@ class PermissionManager {
         */
        private $temporaryUserRights = [];
 
-       /** @var string[] Cached rights for isEveryoneAllowed */
+       /** @var bool[] Cached rights for isEveryoneAllowed, [ right => allowed ] */
        private $cachedRights = [];
 
        /**
@@ -201,7 +199,7 @@ class PermissionManager {
                RevisionLookup $revisionLookup,
                NamespaceInfo $nsInfo
        ) {
-               $options->assertRequiredOptions( self::$constructorOptions );
+               $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
                $this->options = $options;
                $this->specialPageFactory = $specialPageFactory;
                $this->revisionLookup = $revisionLookup;
@@ -1220,7 +1218,8 @@ class PermissionManager {
         * Check if user is allowed to make any action
         *
         * @param UserIdentity $user
-        * // TODO: HHVM can't create mocks with variable params @param string ...$actions
+        * // TODO: HHVM bug T228695#5450847 @param string ...$actions
+        * @suppress PhanCommentParamWithoutRealParam
         * @return bool True if user is allowed to perform *any* of the given actions
         * @since 1.34
         */
@@ -1238,7 +1237,8 @@ class PermissionManager {
         * Check if user is allowed to make all actions
         *
         * @param UserIdentity $user
-        * // TODO: HHVM can't create mocks with variable params @param string ...$actions
+        * // TODO: HHVM bug T228695#5450847 @param string ...$actions
+        * @suppress PhanCommentParamWithoutRealParam
         * @return bool True if user is allowed to perform *all* of the given actions
         * @since 1.34
         */
@@ -1469,7 +1469,7 @@ class PermissionManager {
         * @return string[] Array of permission names
         */
        public function getAllPermissions() {
-               if ( $this->allRights === false ) {
+               if ( $this->allRights === null ) {
                        if ( count( $this->options->get( 'AvailableRights' ) ) ) {
                                $this->allRights = array_unique( array_merge(
                                        $this->coreRights,