section = $section; $this->subject = $subject; $this->allowBlankSubject = $allowBlankSubject; } public function checkConstraint(): string { if ( $this->section === 'new' && !$this->allowBlankSubject && trim( $this->subject ) === '' ) { $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 ) { // From EditPage, regarding the fatal: // or 'missingcommentheader' if $section === 'new'. Blegh // For new sections, the subject is also used for the summary, // so we report missing summaries if the section is missing $statusValue->fatal( 'missingsummary' ); $statusValue->value = self::AS_SUMMARY_NEEDED; } return $statusValue; } }