MediaWiki
master
Toggle main menu visibility
Main Page
Related Pages
Topics
Classes
Class List
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Files
File List
File Members
All
$
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
x
Functions
a
f
g
i
l
r
s
w
Variables
$
a
c
d
e
i
l
m
n
o
p
r
s
t
u
x
▼
MediaWiki
►
Introduction
Code of Conduct
►
MediaWiki Developers
►
ContentHandler
►
Database Access
►
Hooks
►
Dependency Injection
Language
LinkCache
►
Logger
Magic Words
►
Memcached
►
PageUpdater
Schema
Sitelist
►
Skins
Title
►
ExternalStore
►
FileBackend Architecture
FileRepo Architecture
►
JobQueue Architecture
README
MediaWiki
Deprecated List
Todo List
►
Topics
►
Namespace Members
►
Classes
▼
Files
▼
File List
►
docs
▼
includes
►
actions
►
api
►
auth
►
block
►
cache
►
Category
►
changetags
►
collation
►
CommentFormatter
►
CommentStore
►
composer
►
config
►
content
►
context
►
dao
►
db
►
debug
►
deferred
►
diff
►
DomainEvent
►
edit
▼
editpage
▼
Constraint
►
AccidentalRecreationConstraint.php
►
BrokenRedirectConstraint.php
►
ChangeTagsConstraint.php
►
ContentModelChangeConstraint.php
►
DefaultTextConstraint.php
►
EditConstraintFactory.php
►
EditConstraintRunner.php
►
EditFilterMergedContentHookConstraint.php
►
EditRightConstraint.php
►
ExistingSectionEditConstraint.php
►
IEditConstraint.php
►
ImageRedirectConstraint.php
►
MissingCommentConstraint.php
►
NewSectionMissingSubjectConstraint.php
►
PageSizeConstraint.php
►
ReadOnlyConstraint.php
►
SelfRedirectConstraint.php
►
SimpleAntiSpamConstraint.php
►
SpamRegexConstraint.php
►
UnicodeConstraint.php
►
UserBlockConstraint.php
►
UserRateLimitConstraint.php
►
EditPage.php
►
IEditObject.php
►
IntroMessageBuilder.php
►
IntroMessageList.php
ParametersHelper.php
►
PreloadedContentBuilder.php
►
SpamChecker.php
►
TemplatesOnThisPageFormatter.php
►
TextboxBuilder.php
►
TextConflictHelper.php
►
exception
►
export
►
ExternalLinks
►
externalstore
►
Feed
►
filebackend
►
filerepo
►
gallery
►
historyblob
►
Hook
►
HookContainer
►
Html
►
htmlform
►
http
►
import
►
installer
►
interwiki
►
jobqueue
►
json
►
language
►
languages
►
libs
►
linkeddata
►
linker
►
logging
►
mail
►
media
►
Navigation
►
objectcache
►
Output
►
OutputTransform
►
page
►
pager
►
ParamValidator
►
parser
►
password
►
Permissions
►
poolcounter
►
preferences
►
profiler
►
recentchanges
►
registration
►
RenameUser
►
Request
►
ResourceLoader
►
Rest
►
Revision
►
revisiondelete
►
revisionlist
►
search
►
session
►
Settings
►
shell
►
site
►
SiteStats
►
skins
►
sparql
►
specialpage
►
specials
►
Status
►
Storage
►
StubObject
►
tidy
►
title
►
upload
►
user
►
utils
►
watchlist
►
widget
►
WikiMap
►
xml
►
AutoLoader.php
►
BootstrapHelperFunctions.php
►
config-schema.php
DefaultSettings.php
►
Defines.php
►
DevelopmentSettings.php
►
EntryPointEnvironment.php
►
GlobalFunctions.php
►
MainConfigNames.php
►
MainConfigSchema.php
►
MediaWiki.php
MediaWikiEntryPoint.php
►
MediaWikiServices.php
►
PHPVersionCheck.php
►
ServiceWiring.php
►
Setup.php
►
SetupDynamicConfig.php
►
WebStart.php
►
languages
►
maintenance
►
mw-config
►
api.php
►
autoload.php
►
img_auth.php
►
load.php
►
index.php
►
opensearch_desc.php
►
rest.php
►
thumb.php
►
thumb_handler.php
►
File Members
MissingCommentConstraint.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\EditPage\Constraint
;
22
23
use
StatusValue
;
24
32
class
MissingCommentConstraint
implements
IEditConstraint
{
33
34
private
string
$section;
35
private
string
$userComment;
36
41
public
function
__construct
(
string
$section,
string
$userComment ) {
42
$this->section = $section;
43
$this->userComment = $userComment;
44
}
41
public
function
__construct
(
string
$section,
string
$userComment ) {
…
}
45
46
public
function
checkConstraint
(): string {
47
if
( $this->section ===
'new'
&& $this->userComment ===
''
) {
48
return
self::CONSTRAINT_FAILED;
49
}
50
return
self::CONSTRAINT_PASSED;
51
}
46
public
function
checkConstraint
(): string {
…
}
52
53
public
function
getLegacyStatus
():
StatusValue
{
54
$statusValue =
StatusValue
::newGood();
55
if
( $this->section ===
'new'
&& $this->userComment ===
''
) {
56
$statusValue->
fatal
(
'missingcommenttext'
);
57
$statusValue->value = self::AS_TEXTBOX_EMPTY;
58
}
59
return
$statusValue;
60
}
53
public
function
getLegacyStatus
():
StatusValue
{
…
}
61
62
}
32
class
MissingCommentConstraint
implements
IEditConstraint
{
…
};
if
if(!defined('MW_SETUP_CALLBACK'))
Definition
WebStart.php:81
MediaWiki\EditPage\Constraint\MissingCommentConstraint
Do not allow the user to post an empty comment (only used for new section)
Definition
MissingCommentConstraint.php:32
MediaWiki\EditPage\Constraint\MissingCommentConstraint\__construct
__construct(string $section, string $userComment)
Definition
MissingCommentConstraint.php:41
MediaWiki\EditPage\Constraint\MissingCommentConstraint\checkConstraint
checkConstraint()
Definition
MissingCommentConstraint.php:46
MediaWiki\EditPage\Constraint\MissingCommentConstraint\getLegacyStatus
getLegacyStatus()
Get the legacy status for failure (or success)
Definition
MissingCommentConstraint.php:53
StatusValue
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition
StatusValue.php:52
StatusValue\fatal
fatal( $message,... $parameters)
Add an error and set OK to false, indicating that the operation as a whole was fatal.
Definition
StatusValue.php:293
MediaWiki\EditPage\Constraint\IEditConstraint
Interface for all constraints that can prevent edits.
Definition
IEditConstraint.php:33
MediaWiki\EditPage\Constraint
Definition
AccidentalRecreationConstraint.php:21
includes
editpage
Constraint
MissingCommentConstraint.php
Generated on Mon Jan 6 2025 23:23:26 for MediaWiki by
1.10.0