From 5019accfe102ed81e4740203c5337df27cf9d9f0 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Thu, 22 Aug 2019 13:38:09 -0700 Subject: [PATCH] PermissionManager::userHas{All,Any}Right: don't specify a variadic param. Change-Id: Ife9d01be57a4926f4a5efa99661163a391564a6e --- includes/Permissions/PermissionManager.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/Permissions/PermissionManager.php b/includes/Permissions/PermissionManager.php index bd88c17a9c..e6df7d2861 100644 --- a/includes/Permissions/PermissionManager.php +++ b/includes/Permissions/PermissionManager.php @@ -1199,11 +1199,12 @@ class PermissionManager { * Check if user is allowed to make any action * * @param UserIdentity $user - * @param string[] ...$actions + * // TODO: HHVM can't create mocks with variable params @param string ...$actions * @return bool True if user is allowed to perform *any* of the given actions * @since 1.34 */ - public function userHasAnyRight( UserIdentity $user, ...$actions ) { + public function userHasAnyRight( UserIdentity $user ) { + $actions = array_slice( func_get_args(), 1 ); foreach ( $actions as $action ) { if ( $this->userHasRight( $user, $action ) ) { return true; @@ -1216,11 +1217,12 @@ class PermissionManager { * Check if user is allowed to make all actions * * @param UserIdentity $user - * @param string[] ...$actions + * // TODO: HHVM can't create mocks with variable params @param string ...$actions * @return bool True if user is allowed to perform *all* of the given actions * @since 1.34 */ - public function userHasAllRights( UserIdentity $user, ...$actions ) { + public function userHasAllRights( UserIdentity $user ) { + $actions = array_slice( func_get_args(), 1 ); foreach ( $actions as $action ) { if ( !$this->userHasRight( $user, $action ) ) { return false; -- 2.20.1