MediaWiki master
MediaWiki\EditPage\Constraint\EditConstraintFactory Class Reference

Constraints reflect possible errors that need to be checked. More...

Public Member Functions

 __construct (private readonly ServiceOptions $options, private readonly HookContainer $hookContainer, private readonly ReadOnlyMode $readOnlyMode, private readonly SpamChecker $spamRegexChecker, private readonly LoggerInterface $spamRegexLogger, private readonly RateLimiter $rateLimiter, private readonly RedirectLookup $redirectLookup, private readonly IConnectionProvider $connectionProvider, private readonly LogFormatterFactory $logFormatterFactory, private readonly UserFactory $userFactory,)
 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.
 
 newAccidentalRecreationConstraint (Title $title, bool $allowRecreation, ?string $startTime, ?MessageSpecifier $submitButtonLabel=null,)
 
 newEditFilterMergedContentHookConstraint (Content $content, IContextSource $context, string $summary, bool $minorEdit, UserIdentity $user)
 
 newLinkPurgeRateLimitConstraint (RateLimitSubject $subject)
 
 newPageSizeConstraint (int $contentSize, string $type)
 
 newReadOnlyConstraint ()
 
 newRedirectConstraint (?LinkTarget $allowedProblematicRedirectTarget, Content $newContent, ?Content $originalContent, PageReference $page, MessageSpecifier $errorMessageWrapper, ?string $contentFormat,)
 
 newSpamRegexConstraint (string $summary, ?string $sectionHeading, string $text, string $reqIP, PageReference $page,)
 

Public Attributes

const CONSTRUCTOR_OPTIONS
 

Detailed Description

Constraints reflect possible errors that need to be checked.

Since
1.36
Access: internal
Author
DannyS712

Definition at line 36 of file EditConstraintFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\Constraint\EditConstraintFactory::__construct ( private readonly ServiceOptions $options,
private readonly HookContainer $hookContainer,
private readonly ReadOnlyMode $readOnlyMode,
private readonly SpamChecker $spamRegexChecker,
private readonly LoggerInterface $spamRegexLogger,
private readonly RateLimiter $rateLimiter,
private readonly RedirectLookup $redirectLookup,
private readonly IConnectionProvider $connectionProvider,
private readonly LogFormatterFactory $logFormatterFactory,
private readonly UserFactory $userFactory )

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.

Definition at line 49 of file EditConstraintFactory.php.

Member Function Documentation

◆ newAccidentalRecreationConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newAccidentalRecreationConstraint ( Title $title,
bool $allowRecreation,
?string $startTime,
?MessageSpecifier $submitButtonLabel = null )

Definition at line 163 of file EditConstraintFactory.php.

◆ newEditFilterMergedContentHookConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newEditFilterMergedContentHookConstraint ( Content $content,
IContextSource $context,
string $summary,
bool $minorEdit,
UserIdentity $user )

Definition at line 72 of file EditConstraintFactory.php.

◆ newLinkPurgeRateLimitConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newLinkPurgeRateLimitConstraint ( RateLimitSubject $subject)
Parameters
RateLimitSubject$subject
Returns
LinkPurgeRateLimitConstraint

Definition at line 117 of file EditConstraintFactory.php.

◆ newPageSizeConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newPageSizeConstraint ( int $contentSize,
string $type )
Parameters
int$contentSize
string$type
Returns
PageSizeConstraint

Definition at line 95 of file EditConstraintFactory.php.

◆ newReadOnlyConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newReadOnlyConstraint ( )

Definition at line 106 of file EditConstraintFactory.php.

◆ newRedirectConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newRedirectConstraint ( ?LinkTarget $allowedProblematicRedirectTarget,
Content $newContent,
?Content $originalContent,
PageReference $page,
MessageSpecifier $errorMessageWrapper,
?string $contentFormat )

◆ newSpamRegexConstraint()

MediaWiki\EditPage\Constraint\EditConstraintFactory::newSpamRegexConstraint ( string $summary,
?string $sectionHeading,
string $text,
string $reqIP,
PageReference $page )

Definition at line 126 of file EditConstraintFactory.php.

Member Data Documentation

◆ 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 39 of file EditConstraintFactory.php.


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