From: Timo Tijhof Date: Thu, 19 Apr 2018 17:57:18 +0000 (+0100) Subject: userrights: Add array typehints to SpecialUserrights methods X-Git-Tag: 1.34.0-rc.0~5642^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=c7c76124fa9160adf7b34654c010ec3ece622af9;p=lhc%2Fweb%2Fwiklou.git userrights: Add array typehints to SpecialUserrights methods Follows-up e3ce482e1b4da37. * Add them to parameters of doSaveUserGroups(), which were the entrypoint to the error fixed by e3ce482e1b4da37. * Add them to parameters of addLogEntry(), which is where the actual count() error happened. Bug: T182377 Change-Id: I647a1ebf6dc0e80952efe2a3c1192fd8ac5dc1b7 --- diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 40f02a5f4d..6d6bf0ef4a 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -325,8 +325,8 @@ class UserrightsPage extends SpecialPage { * containing only those groups that are to have new expiry values set * @return array Tuple of added, then removed groups */ - function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [], - $groupExpiries = [] + function doSaveUserGroups( $user, array $add, array $remove, $reason = '', + array $tags = [], array $groupExpiries = [] ) { // Validate input set... $isself = $user->getName() == $this->getUser()->getName(); @@ -427,13 +427,13 @@ class UserrightsPage extends SpecialPage { * @param User|UserRightsProxy $user * @param array $oldGroups * @param array $newGroups - * @param array $reason + * @param string $reason * @param array $tags Change tags for the log entry * @param array $oldUGMs Associative array of (group name => UserGroupMembership) * @param array $newUGMs Associative array of (group name => UserGroupMembership) */ - protected function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, - $oldUGMs, $newUGMs + protected function addLogEntry( $user, array $oldGroups, array $newGroups, $reason, + array $tags, array $oldUGMs, array $newUGMs ) { // make sure $oldUGMs and $newUGMs are in the same order, and serialise // each UGM object to a simplified array