MediaWiki  master
MediaWiki\EditPage\Constraint\EditConstraintRunner Class Reference

Back end to process the edit constraints. More...

Public Member Functions

 __construct ()
 Create a new runner. More...
 
 addConstraint (IEditConstraint $constraint)
 Add a constraint to check. More...
 
 checkConstraints ()
 Run constraint checks. More...
 
 getFailedConstraint ()
 Get the constraint that failed. More...
 

Detailed Description

Back end to process the edit constraints.

Constraints reflect possible errors that need to be checked

Since
1.36
Access: internal
Author
DannyS712

Definition at line 36 of file EditConstraintRunner.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\Constraint\EditConstraintRunner::__construct ( )

Create a new runner.

Definition at line 58 of file EditConstraintRunner.php.

References MediaWiki\Logger\LoggerFactory\getInstance().

Member Function Documentation

◆ addConstraint()

MediaWiki\EditPage\Constraint\EditConstraintRunner::addConstraint ( IEditConstraint  $constraint)

Add a constraint to check.

Not all constraints are applicable to the action api or other methods of submitting an edit

For constraints that have dependencies, use the EditConstraintFactory.

Parameters
IEditConstraint$constraint

Definition at line 74 of file EditConstraintRunner.php.

◆ checkConstraints()

MediaWiki\EditPage\Constraint\EditConstraintRunner::checkConstraints ( )

Run constraint checks.

Returns true if all constraints pass, false otherwise. Check getLegacyStatus for the reason

Returns
bool

Definition at line 86 of file EditConstraintRunner.php.

◆ getFailedConstraint()

MediaWiki\EditPage\Constraint\EditConstraintRunner::getFailedConstraint ( )

Get the constraint that failed.

Returns
IEditConstraint

Definition at line 138 of file EditConstraintRunner.php.


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