logger = $logger; $this->input = $inputText; $this->user = $user; $this->title = $title; } public function checkConstraint(): string { if ( $this->input === '' ) { return self::CONSTRAINT_PASSED; } $this->logger->debug( '{name} editing "{title}" submitted bogus field "{input}"', [ 'name' => $this->user->getName(), 'title' => $this->title->getPrefixedText(), 'input' => $this->input ] ); return self::CONSTRAINT_FAILED; } public function getLegacyStatus(): StatusValue { $statusValue = StatusValue::newGood(); if ( $this->input !== '' ) { $statusValue->fatal( 'spamprotectionmatch', false ); $statusValue->value = self::AS_SPAM_ERROR; } return $statusValue; } }