section = $section; $this->userComment = $userComment; } public function checkConstraint(): string { if ( $this->section === 'new' && $this->userComment === '' ) { return self::CONSTRAINT_FAILED; } return self::CONSTRAINT_PASSED; } public function getLegacyStatus(): StatusValue { $statusValue = StatusValue::newGood(); if ( $this->section === 'new' && $this->userComment === '' ) { $statusValue->fatal( 'missingcommenttext' ); $statusValue->value = self::AS_TEXTBOX_EMPTY; } return $statusValue; } }