Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1430854
CiteFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CiteFactory.php
View Options
<?php
namespace
Cite
;
use
MediaWiki\Config\Config
;
use
MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory
;
use
MediaWiki\Parser\Parser
;
use
WeakMap
;
/**
* @license GPL-2.0-or-later
*/
class
CiteFactory
{
/** @var WeakMap<Parser,Cite> */
private
WeakMap
$citeForParser
;
public
function
__construct
(
private
readonly
Config
$config
,
private
readonly
AlphabetsProvider
$alphabetsProvider
,
private
readonly
?
ConfigurationProviderFactory
$configurationProviderFactory
,
)
{
$this
->
citeForParser
=
new
WeakMap
();
}
public
function
newCite
(
Parser
$parser
):
Cite
{
return
new
Cite
(
$parser
,
$this
->
config
,
$this
->
alphabetsProvider
,
$this
->
configurationProviderFactory
,
);
}
public
function
getCiteForParser
(
Parser
$parser
):
Cite
{
$this
->
citeForParser
[
$parser
]
??=
$this
->
newCite
(
$parser
);
return
$this
->
citeForParser
[
$parser
];
}
public
function
destroyCiteForParser
(
Parser
$parser
):
void
{
unset
(
$this
->
citeForParser
[
$parser
]
);
}
public
function
peekCiteForParser
(
Parser
$parser
):
?
Cite
{
return
$this
->
citeForParser
[
$parser
]
??
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 19:41 (3 h, 56 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ff/cc/0f9c3e96801c9f92a737ce77ecfe
Default Alt Text
CiteFactory.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment