MediaWiki master
RestrictedUserGroupCheckerFactory.php
Go to the documentation of this file.
1<?php
2/*
3 * @license GPL-2.0-or-later
4 * @file
5 */
6
7namespace MediaWiki\User;
8
15
16 private array $instances = [];
17
18 public function __construct(
19 private readonly RestrictedUserGroupConfigReader $configReader,
20 private readonly UserRequirementsConditionChecker $userRequirementsConditionChecker,
21 ) {
22 }
23
32 false|string $wiki = false,
35 $key = $wiki . ':' . $scope;
36 if ( !isset( $this->instances[$key] ) ) {
37 $config = $this->configReader->getConfig( $wiki, $scope );
38 $this->instances[$key] = new RestrictedUserGroupChecker(
39 $config,
40 $this->userRequirementsConditionChecker,
41 );
42 }
43 return $this->instances[$key];
44 }
45}
A service that helps to create RestrictedUserGroupChecker instances, either for the local or remote w...
__construct(private readonly RestrictedUserGroupConfigReader $configReader, private readonly UserRequirementsConditionChecker $userRequirementsConditionChecker,)
getRestrictedUserGroupChecker(false|string $wiki=false, string $scope=RestrictedUserGroupConfigReader::SCOPE_LOCAL)
Creates an instance of RestrictedUserGroupChecker for the specified wiki and scope.
A service to check whether a user can be added or removed to/from restricted user groups.
A helper class to read the restricted user groups configuration for a given wiki.
const SCOPE_LOCAL
Scope value representing user groups as supported by MediaWiki core.