34 private string $section;
35 private string $subject;
36 private bool $allowBlankSubject;
37 private string $result;
47 bool $allowBlankSubject
49 $this->section = $section;
50 $this->subject = $subject;
51 $this->allowBlankSubject = $allowBlankSubject;
55 if ( $this->section ===
'new' &&
56 !$this->allowBlankSubject &&
57 trim( $this->subject ) ===
''
59 $this->result = self::CONSTRAINT_FAILED;
61 $this->result = self::CONSTRAINT_PASSED;
68 if ( $this->result === self::CONSTRAINT_FAILED ) {
73 $statusValue->
fatal(
'missingsummary' );
74 $statusValue->value = self::AS_SUMMARY_NEEDED;
if(!defined('MW_SETUP_CALLBACK'))
For a new section, do not allow the user to post with an empty subject (section title) unless they ch...
__construct(string $section, string $subject, bool $allowBlankSubject)
getLegacyStatus()
Get the legacy status for failure (or success)
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.