MediaWiki master
ChangeTagsConstraint.php
Go to the documentation of this file.
1<?php
8
12
21
26 public function __construct(
27 private readonly Authority $performer,
28 private readonly array $tags,
29 ) {
30 }
31
32 public function checkConstraint(): EditPageStatus {
33 if ( !$this->tags ) {
35 }
36
37 // TODO inject a service once canAddTagsAccompanyingChange is moved to a
38 // service as part of T245964
39 $changeTagStatus = ChangeTags::canAddTagsAccompanyingChange(
40 $this->tags,
41 $this->performer,
42 false
43 );
44
45 return EditPageStatus::cast( $changeTagStatus )
46 ->setValue( self::AS_CHANGE_TAG_ERROR );
47 }
48
49}
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:69
Recent changes tagging.
__construct(private readonly Authority $performer, private readonly array $tags,)
Status returned by edit constraints and other page editing checks.
static cast(StatusValue $sv)
Succinct helper method to wrap a StatusValue in some other specific subclass.
static newGood( $value=null)
Factory function for good results.
Interface for all constraints that can prevent edits.
This interface represents the authority associated with the current execution context,...
Definition Authority.php:23