MediaWiki master
MediaWiki\User\UserRequirementsConditionEvaluator Class Reference

Inherits MediaWiki\User\UserRequirementsConditionEvaluatorBase.

Collaboration diagram for MediaWiki\User\UserRequirementsConditionEvaluator:

Public Member Functions

 __construct (private readonly ServiceOptions $options, private readonly GroupPermissionsLookup $groupPermissionsLookup, private readonly UserEditTracker $userEditTracker, private readonly UserRegistrationLookup $userRegistrationLookup, private readonly UserFactory $userFactory, private readonly IContextSource $context, private readonly UserGroupManager $userGroupManager,)
 
 checkCondition (string|int $conditionType, array $args, UserIdentity $user, bool $isPerformingRequest)
 Evaluates the specified condition and returns whether the condition is met.If the condition is unsupported by this evaluator, return null.
Parameters
string | int$conditionTypeThe condition type, one of constants like APCOND_AGE
array$argsArray of arguments to this condition
UserIdentity$userThe user against whom the condition is checked.
bool$isPerformingRequestWhether the checked user is the one who performs current request. If this value is false, the implementation should only perform checks that make sense against users at rest (e.g., no current IP checks). For other checks a reasonable default value should be returned.

 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Definition at line 21 of file UserRequirementsConditionEvaluator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\UserRequirementsConditionEvaluator::__construct ( private readonly ServiceOptions $options,
private readonly GroupPermissionsLookup $groupPermissionsLookup,
private readonly UserEditTracker $userEditTracker,
private readonly UserRegistrationLookup $userRegistrationLookup,
private readonly UserFactory $userFactory,
private readonly IContextSource $context,
private readonly UserGroupManager $userGroupManager )

Definition at line 37 of file UserRequirementsConditionEvaluator.php.

Member Function Documentation

◆ checkCondition()

MediaWiki\User\UserRequirementsConditionEvaluator::checkCondition ( string|int $conditionType,
array $args,
UserIdentity $user,
bool $isPerformingRequest )

Evaluates the specified condition and returns whether the condition is met.If the condition is unsupported by this evaluator, return null.

Parameters
string | int$conditionTypeThe condition type, one of constants like APCOND_AGE
array$argsArray of arguments to this condition
UserIdentity$userThe user against whom the condition is checked.
bool$isPerformingRequestWhether the checked user is the one who performs current request. If this value is false, the implementation should only perform checks that make sense against users at rest (e.g., no current IP checks). For other checks a reasonable default value should be returned.

Reimplemented from MediaWiki\User\UserRequirementsConditionEvaluatorBase.

Definition at line 50 of file UserRequirementsConditionEvaluator.php.

References APCOND_AGE, APCOND_AGE_FROM_EDIT, APCOND_BLOCKED, APCOND_EDITCOUNT, APCOND_EMAILCONFIRMED, APCOND_INGROUPS, APCOND_IPINRANGE, APCOND_ISBOT, APCOND_ISIP, MediaWiki\MainConfigNames\AutoConfirmAge, MediaWiki\MainConfigNames\AutoConfirmCount, MediaWiki\MainConfigNames\EmailAuthentication, and wfTimestampOrNull().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\User\UserRequirementsConditionEvaluator::CONSTRUCTOR_OPTIONS
Initial value:
= [
]
const AutoConfirmCount
Name constant for the AutoConfirmCount setting, for use with Config::get()
const AutoConfirmAge
Name constant for the AutoConfirmAge setting, for use with Config::get()
const EmailAuthentication
Name constant for the EmailAuthentication setting, for use with Config::get()
Access: internal
For use by UserRequirementsConditionCheckerFactory

Definition at line 24 of file UserRequirementsConditionEvaluator.php.

Referenced by MediaWiki\User\UserRequirementsConditionCheckerFactory\__construct().


The documentation for this class was generated from the following file: