Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5968709
TranslationUnitIssue.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
TranslationUnitIssue.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\PageTranslation
;
use
InvalidArgumentException
;
use
MediaWiki\Extension\Translate\Validation\ValidationIssue
;
use
MessageSpecifier
;
/**
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2021.05
* @see ValidationIssue (similar, but different use case)
*/
class
TranslationUnitIssue
implements
MessageSpecifier
{
public
const
ERROR
=
'error'
;
public
const
WARNING
=
'warning'
;
/** @var string self::ERROR|self::WARNING */
private
string
$severity
;
private
string
$messageKey
;
private
array
$messageParams
;
public
function
__construct
(
string
$severity
,
string
$messageKey
,
array
$messageParams
=
[]
)
{
if
(
!
in_array
(
$severity
,
[
self
::
ERROR
,
self
::
WARNING
]
)
)
{
throw
new
InvalidArgumentException
(
'Invalid value for severity: '
.
$severity
);
}
$this
->
severity
=
$severity
;
$this
->
messageKey
=
$messageKey
;
$this
->
messageParams
=
$messageParams
;
}
public
function
getSeverity
():
string
{
return
$this
->
severity
;
}
public
function
getKey
():
string
{
return
$this
->
messageKey
;
}
public
function
getParams
():
array
{
return
$this
->
messageParams
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 13:15 (2 d, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fb/89/fee2e52bd71ea73d4353570c5145
Default Alt Text
TranslationUnitIssue.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment