Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5982047
AutoBlockTarget.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
AutoBlockTarget.php
View Options
<?php
namespace
MediaWiki\Block
;
use
MediaWiki\DAO\WikiAwareEntity
;
use
MediaWiki\Page\PageReference
;
use
MediaWiki\Page\PageReferenceValue
;
use
StatusValue
;
/**
* A block target of the form #1234 where the number is the block ID. For user
* input or display when the IP address needs to be hidden.
*
* @since 1.44
*/
class
AutoBlockTarget
extends
BlockTarget
{
private
int
$id
;
/**
* @param int $id The block ID
* @param string|false $wikiId
*/
public
function
__construct
(
int
$id
,
$wikiId
=
WikiAwareEntity
::
LOCAL
)
{
parent
::
__construct
(
$wikiId
);
$this
->
id
=
$id
;
}
public
function
toString
():
string
{
return
'#'
.
$this
->
id
;
}
public
function
getType
():
int
{
return
Block
::
TYPE_AUTO
;
}
public
function
getLogPage
():
PageReference
{
return
new
PageReferenceValue
(
NS_USER
,
$this
->
toString
(),
$this
->
wikiId
);
}
public
function
getSpecificity
()
{
return
2
;
}
public
function
validateForCreation
():
StatusValue
{
// Autoblocks are never valid for creation
return
StatusValue
::
newFatal
(
'badipaddress'
);
}
/**
* Get the block ID
*
* @return int
*/
public
function
getId
():
int
{
return
$this
->
id
;
}
protected
function
getLegacyUnion
()
{
return
(
string
)
$this
->
id
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 22:10 (1 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e6/62/9333c14c81427e28ac4b284d75d0
Default Alt Text
AutoBlockTarget.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment