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',
/** @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;
*/
private $temporaryUserRights = [];
- /** @var string[] Cached rights for isEveryoneAllowed */
+ /** @var bool[] Cached rights for isEveryoneAllowed, [ right => allowed ] */
private $cachedRights = [];
/**
RevisionLookup $revisionLookup,
NamespaceInfo $nsInfo
) {
- $options->assertRequiredOptions( self::$constructorOptions );
+ $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
$this->options = $options;
$this->specialPageFactory = $specialPageFactory;
$this->revisionLookup = $revisionLookup;
* 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
*/
* 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
*/
* @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,