Merge "Make some generic array type hints in PHPDocs more specific"
This commit is contained in:
commit
4301be53a7
8 changed files with 18 additions and 18 deletions
|
|
@ -39,10 +39,10 @@ class GroupPermissionsLookup {
|
|||
'RevokePermissions',
|
||||
];
|
||||
|
||||
/** @var array */
|
||||
/** @var array[] */
|
||||
private $groupPermissions;
|
||||
|
||||
/** @var array */
|
||||
/** @var array[] */
|
||||
private $revokePermissions;
|
||||
|
||||
/** @var string[] */
|
||||
|
|
|
|||
|
|
@ -1634,7 +1634,7 @@ class PermissionManager {
|
|||
*
|
||||
* @param int $index Namespace ID (index) to check
|
||||
* @param UserIdentity|null $user User to check
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
public function getNamespaceRestrictionLevels( $index, UserIdentity $user = null ) {
|
||||
if ( !isset( $this->options->get( 'NamespaceProtection' )[$index] ) ) {
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ class RestrictionStore {
|
|||
*
|
||||
* @param string $oldRestrictions Restrictions in legacy format (page.page_restrictions).
|
||||
* Example: "edit=autoconfirmed,sysop:move=sysop"
|
||||
* @return array As returned by getAllRestrictions()
|
||||
* @return string[][] As returned by getAllRestrictions()
|
||||
* @codeCoverageIgnore We're planning to drop support for this
|
||||
*/
|
||||
private function convertOldRestrictions( string $oldRestrictions ): array {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SimpleAuthority implements Authority {
|
|||
/** @var UserIdentity */
|
||||
private $actor;
|
||||
|
||||
/** @var array permissions (stored in the keys, values are ignored) */
|
||||
/** @var true[] permissions (stored in the keys, values are ignored) */
|
||||
private $permissions;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ abstract class ParameterizedPassword extends Password {
|
|||
/**
|
||||
* Extra arguments that were found in the hash. This may or may not make
|
||||
* the hash invalid.
|
||||
* @var array
|
||||
* @var string[]
|
||||
*/
|
||||
protected $args = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ final class PasswordFactory {
|
|||
/**
|
||||
* Mapping of password types to classes
|
||||
*
|
||||
* @var array
|
||||
* @var array[]
|
||||
* @see PasswordFactory::register
|
||||
* @see Setup.php
|
||||
*/
|
||||
|
|
@ -121,7 +121,7 @@ final class PasswordFactory {
|
|||
/**
|
||||
* Get the list of types of passwords
|
||||
*
|
||||
* @return array
|
||||
* @return array[]
|
||||
*/
|
||||
public function getTypes(): array {
|
||||
return $this->types;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ use MediaWiki\User\UserIdentity;
|
|||
class UserPasswordPolicy {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array[]
|
||||
*/
|
||||
private $policies;
|
||||
|
||||
|
|
@ -39,13 +39,13 @@ class UserPasswordPolicy {
|
|||
* Mapping of statements to the function that will test the password for compliance. The
|
||||
* checking functions take the policy value, the user, and password, and return a Status
|
||||
* object indicating compliance.
|
||||
* @var array
|
||||
* @var callable[]
|
||||
*/
|
||||
private $policyCheckFunctions;
|
||||
|
||||
/**
|
||||
* @param array $policies
|
||||
* @param array $checks mapping statement to its checking function. Checking functions are
|
||||
* @param array[] $policies List of lists of policies per user group
|
||||
* @param callable[] $checks mapping statement to its checking function. Checking functions are
|
||||
* called with the policy value for this user, the user object, and the password to check.
|
||||
*/
|
||||
public function __construct( array $policies, array $checks ) {
|
||||
|
|
@ -92,7 +92,7 @@ class UserPasswordPolicy {
|
|||
* be used in the installer.
|
||||
* @param UserIdentity $user whose policy we are checking
|
||||
* @param string $password the password to check
|
||||
* @param array $groups list of groups to which we assume the user belongs
|
||||
* @param string[] $groups list of groups to which we assume the user belongs
|
||||
* @return Status error to indicate the password didn't meet the policy, or fatal to
|
||||
* indicate the user shouldn't be allowed to login. The status value will be an array,
|
||||
* potentially with the following keys:
|
||||
|
|
@ -116,8 +116,8 @@ class UserPasswordPolicy {
|
|||
/**
|
||||
* @param UserIdentity $user
|
||||
* @param string $password
|
||||
* @param array $policies
|
||||
* @param array $policyCheckFunctions
|
||||
* @param array $policies List of policy statements for the group the user belongs to
|
||||
* @param callable[] $policyCheckFunctions
|
||||
* @return Status
|
||||
*/
|
||||
private function checkPolicies( UserIdentity $user, $password, $policies, $policyCheckFunctions ) {
|
||||
|
|
@ -196,8 +196,8 @@ class UserPasswordPolicy {
|
|||
/**
|
||||
* Utility function to get the effective policy from a list of policies, based
|
||||
* on a list of groups.
|
||||
* @param array $policies list of policies to consider
|
||||
* @param array $userGroups the groups from which we calculate the effective policy
|
||||
* @param array[] $policies List of lists of policies per user group
|
||||
* @param string[] $userGroups the groups from which we calculate the effective policy
|
||||
* @param array $defaultPolicy the default policy to start from
|
||||
* @return array effective policy
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ class NamespaceInfo {
|
|||
* @deprecated since 1.34 User PermissionManager::getNamespaceRestrictionLevels instead.
|
||||
* @param int $index Index to check
|
||||
* @param User|null $user User to check
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
public function getRestrictionLevels( $index, User $user = null ) {
|
||||
// PermissionManager is not injected because adding an explicit dependency
|
||||
|
|
|
|||
Loading…
Reference in a new issue