44 private $userProvidedText;
57 string $userProvidedText
59 $this->title = $title;
60 $this->allowBlank = $allowBlank;
61 $this->userProvidedText = $userProvidedText;
65 $defaultMessageText = $this->title->getDefaultMessageText();
66 if ( $this->title->getNamespace() ===
NS_MEDIAWIKI && $defaultMessageText !==
false ) {
67 $defaultText = $defaultMessageText;
72 if ( !$this->allowBlank && $this->userProvidedText === $defaultText ) {
73 $this->result = self::CONSTRAINT_FAILED;
75 $this->result = self::CONSTRAINT_PASSED;
82 if ( $this->result === self::CONSTRAINT_FAILED ) {
83 $statusValue->
fatal(
'blankarticle' );
84 $statusValue->setResult(
false, self::AS_BLANK_ARTICLE );
Don't save a new page if it's blank or if it's a MediaWiki: message with content equivalent to defaul...
getLegacyStatus()
Get the legacy status for failure (or success)
__construct(Title $title, bool $allowBlank, string $userProvidedText)
Generic operation result class Has warning/error list, boolean status and arbitrary value.
fatal( $message,... $parameters)
Add an error and set OK to false, indicating that the operation as a whole was fatal.
Interface for all constraints that can prevent edits.