mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-28 07:50:24 +00:00
1ad77dc9fb
It makes sense to look at this and Iedd7a5dca24 together, as this patch itself doesn't really fix anything. Change-Id: Ifef5266b1803d1a96489789b08d9beed044d908f
62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter;
|
|
|
|
use MessageLocalizer;
|
|
use OutputPage;
|
|
use User;
|
|
|
|
/**
|
|
* Factory for EditBoxBuilder objects
|
|
*/
|
|
class EditBoxBuilderFactory {
|
|
|
|
public const SERVICE_NAME = 'AbuseFilterEditBoxBuilderFactory';
|
|
|
|
/** @var AbuseFilterPermissionManager */
|
|
private $afPermManager;
|
|
|
|
/** @var KeywordsManager */
|
|
private $keywordsManager;
|
|
|
|
/** @var bool */
|
|
private $isCodeEditorLoaded;
|
|
|
|
/**
|
|
* @param AbuseFilterPermissionManager $afPermManager
|
|
* @param KeywordsManager $keywordsManager
|
|
* @param bool $isCodeEditorLoaded
|
|
*/
|
|
public function __construct(
|
|
AbuseFilterPermissionManager $afPermManager,
|
|
KeywordsManager $keywordsManager,
|
|
bool $isCodeEditorLoaded
|
|
) {
|
|
$this->afPermManager = $afPermManager;
|
|
$this->keywordsManager = $keywordsManager;
|
|
$this->isCodeEditorLoaded = $isCodeEditorLoaded;
|
|
}
|
|
|
|
/**
|
|
* @param MessageLocalizer $messageLocalizer
|
|
* @param User $user
|
|
* @param OutputPage $output
|
|
* @return EditBoxBuilder
|
|
*/
|
|
public function newEditBoxBuilder(
|
|
MessageLocalizer $messageLocalizer,
|
|
User $user,
|
|
OutputPage $output
|
|
) : EditBoxBuilder {
|
|
return new EditBoxBuilder(
|
|
$this->afPermManager,
|
|
$this->keywordsManager,
|
|
$this->isCodeEditorLoaded,
|
|
$messageLocalizer,
|
|
$user,
|
|
$output
|
|
);
|
|
}
|
|
|
|
}
|