Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Tag | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| execute | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\AbuseFilter\Consequences\Consequence; |
| 4 | |
| 5 | use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger; |
| 6 | use MediaWiki\Extension\AbuseFilter\Consequences\Parameters; |
| 7 | |
| 8 | /** |
| 9 | * Consequence that adds change tags once the edit is saved |
| 10 | */ |
| 11 | class Tag extends Consequence { |
| 12 | |
| 13 | public function __construct( |
| 14 | Parameters $parameters, |
| 15 | private readonly array $tags, |
| 16 | private readonly ChangeTagger $tagger |
| 17 | ) { |
| 18 | parent::__construct( $parameters ); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @inheritDoc |
| 23 | */ |
| 24 | public function execute(): bool { |
| 25 | $this->tagger->addTags( $this->parameters->getActionSpecifier(), $this->tags ); |
| 26 | return true; |
| 27 | } |
| 28 | } |