36 private $readOnlyMode;
45 $this->readOnlyMode = $readOnlyMode;
49 $this->result = $this->readOnlyMode->isReadOnly() ?
50 self::CONSTRAINT_FAILED :
51 self::CONSTRAINT_PASSED;
58 if ( $this->result === self::CONSTRAINT_FAILED ) {
61 $statusValue->
fatal(
'readonlytext' );
62 $statusValue->value = self::AS_READ_ONLY_PAGE;
Verify site is not in read only mode.
getLegacyStatus()
Get the legacy status for failure (or success)
__construct(ReadOnlyMode $readOnlyMode)
A service class for fetching the wiki's current read-only mode.
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.