Constraints reflect possible errors that need to be checked.
More...
|
| __construct (ServiceOptions $options, Spi $loggerFactory, PermissionManager $permissionManager, HookContainer $hookContainer, ReadOnlyMode $readOnlyMode, SpamChecker $spamRegexChecker, RateLimiter $rateLimiter) |
| Some constraints have dependencies that need to be injected, this class serves as a factory for all of the different constraints that need dependencies injected.
|
|
| newEditFilterMergedContentHookConstraint (Content $content, IContextSource $context, string $summary, bool $minorEdit, Language $language, User $user) |
|
| newEditRightConstraint (User $performer, Title $title, bool $new) |
|
| newPageSizeConstraint (int $contentSize, string $type) |
|
| newReadOnlyConstraint () |
|
| newSimpleAntiSpamConstraint (string $input, UserIdentity $user, Title $title) |
|
| newSpamRegexConstraint (string $summary, ?string $sectionHeading, string $text, string $reqIP, Title $title) |
|
| newUserBlockConstraint (LinkTarget $title, User $user) |
|
| newUserRateLimitConstraint (RateLimitSubject $subject, string $oldModel, string $newModel) |
|
Constraints reflect possible errors that need to be checked.
- Since
- 1.36
- Access: internal
- Author
- DannyS712
Definition at line 47 of file EditConstraintFactory.php.
◆ __construct()
Some constraints have dependencies that need to be injected, this class serves as a factory for all of the different constraints that need dependencies injected.
The checks in EditPage use wfDebugLog and logged to different channels, hence the need for multiple loggers retrieved from the Spi. The channels used are:
- SimpleAntiSpam (in SimpleAntiSpamConstraint)
- SpamRegex (in SpamRegexConstraint)
TODO can they be combined into the same channel?
- Parameters
-
ServiceOptions | $options | |
Spi | $loggerFactory | |
PermissionManager | $permissionManager | |
HookContainer | $hookContainer | |
ReadOnlyMode | $readOnlyMode | |
SpamChecker | $spamRegexChecker | |
RateLimiter | $rateLimiter | |
Definition at line 94 of file EditConstraintFactory.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
◆ newEditFilterMergedContentHookConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newEditFilterMergedContentHookConstraint |
( |
Content | $content, |
|
|
IContextSource | $context, |
|
|
string | $summary, |
|
|
bool | $minorEdit, |
|
|
Language | $language, |
|
|
User | $user ) |
◆ newEditRightConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newEditRightConstraint |
( |
User | $performer, |
|
|
Title | $title, |
|
|
bool | $new ) |
◆ newPageSizeConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newPageSizeConstraint |
( |
int | $contentSize, |
|
|
string | $type ) |
◆ newReadOnlyConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newReadOnlyConstraint |
( |
| ) |
|
◆ newSimpleAntiSpamConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newSimpleAntiSpamConstraint |
( |
string | $input, |
|
|
UserIdentity | $user, |
|
|
Title | $title ) |
- Parameters
-
string | $input | |
UserIdentity | $user | |
Title | $title | |
- Returns
- SimpleAntiSpamConstraint
Definition at line 204 of file EditConstraintFactory.php.
◆ newSpamRegexConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newSpamRegexConstraint |
( |
string | $summary, |
|
|
?string | $sectionHeading, |
|
|
string | $text, |
|
|
string | $reqIP, |
|
|
Title | $title ) |
- Parameters
-
string | $summary | |
?string | $sectionHeading | |
string | $text | |
string | $reqIP | |
Title | $title | |
- Returns
- SpamRegexConstraint
Definition at line 225 of file EditConstraintFactory.php.
◆ newUserBlockConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newUserBlockConstraint |
( |
LinkTarget | $title, |
|
|
User | $user ) |
◆ newUserRateLimitConstraint()
MediaWiki\EditPage\Constraint\EditConstraintFactory::newUserRateLimitConstraint |
( |
RateLimitSubject | $subject, |
|
|
string | $oldModel, |
|
|
string | $newModel ) |
- Parameters
-
RateLimitSubject | $subject | |
string | $oldModel | |
string | $newModel | |
- Returns
- UserRateLimitConstraint
Definition at line 185 of file EditConstraintFactory.php.
◆ CONSTRUCTOR_OPTIONS
const MediaWiki\EditPage\Constraint\EditConstraintFactory::CONSTRUCTOR_OPTIONS |
Initial value:= [
]
const MaxArticleSize
Name constant for the MaxArticleSize setting, for use with Config::get()
- Access: internal
Definition at line 50 of file EditConstraintFactory.php.
The documentation for this class was generated from the following file: