Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7399035
TitleConditionValue.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
TitleConditionValue.php
View Options
<?php
namespace
MediaWiki\RecentChanges\ChangesListQuery
;
use
MediaWiki\Linker\LinkTarget
;
use
MediaWiki\Page\PageReference
;
/**
* A simple value class and helpers for a namespace/dbkey pair
*
* @internal Helper for ChangesListQuery modules
*/
class
TitleConditionValue
implements
\Stringable
{
/**
* @param LinkTarget|PageReference $title
* @return self
*/
public
static
function
create
(
$title
)
{
if
(
$title
instanceof
LinkTarget
)
{
$ns
=
$title
->
getNamespace
();
$dbk
=
$title
->
getDBkey
();
}
elseif
(
$title
instanceof
PageReference
)
{
$ns
=
$title
->
getNamespace
();
$dbk
=
$title
->
getDBkey
();
}
else
{
throw
new
\InvalidArgumentException
(
"Unknown value type for title"
);
}
return
new
self
(
$ns
,
$dbk
);
}
/**
* @param self[] $values
* @return array
*/
public
static
function
makeSet
(
$values
)
{
$set
=
[];
foreach
(
$values
as
$value
)
{
$set
[
$value
->
namespace
][
$value
->
dbKey
]
=
true
;
}
return
$set
;
}
public
function
__construct
(
public
int
$namespace
,
public
string
$dbKey
)
{
}
public
function
__toString
():
string
{
return
"{$this->namespace}:{$this->dbKey}"
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 15:43 (6 h, 21 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/49/27742fd750ce1d8cd6e20898c238
Default Alt Text
TitleConditionValue.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment