41 private readonly
Content $content,
43 private readonly
string $summary,
44 private readonly
bool $minorEdit,
47 $this->hookRunner =
new HookRunner( $hookContainer );
53 $hookResult = $this->hookRunner->onEditFilterMergedContent(
58 Status::wrap( $status ),
60 $this->userFactory->newFromUserIdentity( $this->hookUser ),
65 if ( $status->isGood() ) {
69 $status->
setOK(
false );
71 if ( !$status->getMessages() ) {
73 $status->fatal(
'hookaborted' );
77 if ( !$status->value ) {
84 if ( !$status->isOK() ) {
87 if ( !$status->getMessages() ) {
89 $status->fatal(
'hookaborted' );
95 return PageEditStatus::newGood();
Abstract class for all constraints that can prevent edits.
Verify EditFilterMergedContent hook.
__construct(HookContainer $hookContainer, private readonly UserFactory $userFactory, private readonly Content $content, private readonly IContextSource $hookContext, private readonly string $summary, private readonly bool $minorEdit, private readonly UserIdentity $hookUser,)
Status returned by edit constraints and other page editing checks.
setOK( $ok)
Change operation status.
Content objects represent page content, e.g.
Interface for objects which can provide a MediaWiki context on request.
const AS_HOOK_ERROR_EXPECTED
Status: A hook function returned an error.