Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5961121
VariableGeneratorFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
VariableGeneratorFactory.php
View Options
<?php
namespace
MediaWiki\Extension\AbuseFilter\VariableGenerator
;
use
MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner
;
use
MediaWiki\Extension\AbuseFilter\TextExtractor
;
use
MediaWiki\Extension\AbuseFilter\Variables\VariableHolder
;
use
MediaWiki\Page\WikiPageFactory
;
use
MediaWiki\Title\Title
;
use
MediaWiki\User\User
;
use
MediaWiki\User\UserFactory
;
use
RecentChange
;
use
RepoGroup
;
use
Wikimedia\Mime\MimeAnalyzer
;
class
VariableGeneratorFactory
{
public
const
SERVICE_NAME
=
'AbuseFilterVariableGeneratorFactory'
;
/** @var AbuseFilterHookRunner */
private
$hookRunner
;
/** @var TextExtractor */
private
$textExtractor
;
/** @var MimeAnalyzer */
private
$mimeAnalyzer
;
/** @var RepoGroup */
private
$repoGroup
;
/** @var WikiPageFactory */
private
$wikiPageFactory
;
/** @var UserFactory */
private
$userFactory
;
/**
* @param AbuseFilterHookRunner $hookRunner
* @param TextExtractor $textExtractor
* @param MimeAnalyzer $mimeAnalyzer
* @param RepoGroup $repoGroup
* @param WikiPageFactory $wikiPageFactory
* @param UserFactory $userFactory
*/
public
function
__construct
(
AbuseFilterHookRunner
$hookRunner
,
TextExtractor
$textExtractor
,
MimeAnalyzer
$mimeAnalyzer
,
RepoGroup
$repoGroup
,
WikiPageFactory
$wikiPageFactory
,
UserFactory
$userFactory
)
{
$this
->
hookRunner
=
$hookRunner
;
$this
->
textExtractor
=
$textExtractor
;
$this
->
mimeAnalyzer
=
$mimeAnalyzer
;
$this
->
repoGroup
=
$repoGroup
;
$this
->
wikiPageFactory
=
$wikiPageFactory
;
$this
->
userFactory
=
$userFactory
;
}
/**
* @param VariableHolder|null $holder
* @return VariableGenerator
*/
public
function
newGenerator
(
?
VariableHolder
$holder
=
null
):
VariableGenerator
{
return
new
VariableGenerator
(
$this
->
hookRunner
,
$this
->
userFactory
,
$holder
);
}
/**
* @param User $user
* @param Title $title
* @param VariableHolder|null $holder
* @return RunVariableGenerator
*/
public
function
newRunGenerator
(
User
$user
,
Title
$title
,
?
VariableHolder
$holder
=
null
):
RunVariableGenerator
{
return
new
RunVariableGenerator
(
$this
->
hookRunner
,
$this
->
userFactory
,
$this
->
textExtractor
,
$this
->
mimeAnalyzer
,
$this
->
wikiPageFactory
,
$user
,
$title
,
$holder
);
}
/**
* @param RecentChange $rc
* @param User $contextUser
* @param VariableHolder|null $holder
* @return RCVariableGenerator
*/
public
function
newRCGenerator
(
RecentChange
$rc
,
User
$contextUser
,
?
VariableHolder
$holder
=
null
):
RCVariableGenerator
{
return
new
RCVariableGenerator
(
$this
->
hookRunner
,
$this
->
userFactory
,
$this
->
mimeAnalyzer
,
$this
->
repoGroup
,
$this
->
wikiPageFactory
,
$rc
,
$contextUser
,
$holder
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 07:52 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
18/c8/4e7575881628ea4da0a1248261f8
Default Alt Text
VariableGeneratorFactory.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment