title = $title; $this->allowBlank = $allowBlank; $this->userProvidedText = $userProvidedText; } public function checkConstraint(): string { $defaultMessageText = $this->title->getDefaultMessageText(); if ( $this->title->getNamespace() === NS_MEDIAWIKI && $defaultMessageText !== false ) { $defaultText = $defaultMessageText; } else { $defaultText = ''; } if ( !$this->allowBlank && $this->userProvidedText === $defaultText ) { $this->result = self::CONSTRAINT_FAILED; } else { $this->result = self::CONSTRAINT_PASSED; } return $this->result; } public function getLegacyStatus(): StatusValue { $statusValue = StatusValue::newGood(); if ( $this->result === self::CONSTRAINT_FAILED ) { $statusValue->fatal( 'blankarticle' ); $statusValue->setResult( false, self::AS_BLANK_ARTICLE ); } return $statusValue; } }