MediaWiki
1.34.4
|
Format errors and warnings in the old style, for backwards compatibility. More...
Public Member Functions | |
__construct (ApiResult $result) | |
arrayFromStatus (StatusValue $status, $type='error', $format=null) | |
Format messages from a StatusValue as an array. More... | |
formatException ( $exception, array $options=[]) | |
Format an exception as an array. More... | |
getFormat () | |
Fetch the format for this formatter. More... | |
Public Member Functions inherited from ApiErrorFormatter | |
__construct (ApiResult $result, Language $lang, $format, $useDB=false) | |
addError ( $modulePath, $msg, $code=null, $data=null) | |
Add an error to the result. More... | |
addMessagesFromStatus ( $modulePath, StatusValue $status, $types=[ 'warning', 'error'], array $filter=[]) | |
Add warnings and errors from a StatusValue object to the result. More... | |
addWarning ( $modulePath, $msg, $code=null, $data=null) | |
Add a warning to the result. More... | |
formatMessage ( $msg, $format=null) | |
Format a message as an array. More... | |
getLanguage () | |
Fetch the Language for this formatter. More... | |
getMessageFromException ( $exception, array $options=[]) | |
Get an ApiMessage from an exception. More... | |
newWithFormat ( $format) | |
Return a formatter like this one but with a different format. More... | |
Protected Member Functions | |
addWarningOrError ( $tag, $modulePath, $msg) | |
Actually add the warning or error to the result. More... | |
formatMessageInternal ( $msg, $format) | |
Format a message as an array. More... | |
Protected Member Functions inherited from ApiErrorFormatter | |
getDummyTitle () | |
Fetch a dummy title to set on Messages. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ApiErrorFormatter | |
static | isValidApiCode ( $code) |
Test whether a code is a valid API error code. More... | |
static | stripMarkup ( $text) |
Turn wikitext into something resembling plaintext. More... | |
Protected Attributes inherited from ApiErrorFormatter | |
$format = 'none' | |
Language | $lang |
ApiResult | $result |
$useDB = false | |
Format errors and warnings in the old style, for backwards compatibility.
Definition at line 28 of file ApiErrorFormatter_BackCompat.php.
ApiErrorFormatter_BackCompat::__construct | ( | ApiResult | $result | ) |
ApiResult | $result | Into which data will be added |
Definition at line 33 of file ApiErrorFormatter_BackCompat.php.
References ApiErrorFormatter\$result, and Language\factory().
|
protected |
Actually add the warning or error to the result.
string | $tag | 'warning' or 'error' |
string | null | $modulePath | |
ApiMessage | ApiRawMessage | $msg |
Reimplemented from ApiErrorFormatter.
Definition at line 82 of file ApiErrorFormatter_BackCompat.php.
References $path, ApiResult\ADD_ON_TOP, ApiResult\NO_SIZE_CHECK, ApiResult\OVERRIDE, and ApiErrorFormatter\stripMarkup().
ApiErrorFormatter_BackCompat::arrayFromStatus | ( | StatusValue | $status, |
$type = 'error' , |
|||
$format = null |
|||
) |
Format messages from a StatusValue as an array.
StatusValue | $status | |
string | $type | 'warning' or 'error' |
string | null | $format |
Reimplemented from ApiErrorFormatter.
Definition at line 41 of file ApiErrorFormatter_BackCompat.php.
References ApiErrorFormatter\$result, $type, ApiMessage\create(), StatusValue\getErrors(), StatusValue\getErrorsByType(), StatusValue\isGood(), and ApiResult\setIndexedTagName().
ApiErrorFormatter_BackCompat::formatException | ( | $exception, | |
array | $options = [] |
||
) |
Format an exception as an array.
Exception | Throwable | $exception | |
array | $options | See parent::formatException(), plus
|
Reimplemented from ApiErrorFormatter.
Definition at line 77 of file ApiErrorFormatter_BackCompat.php.
|
protected |
Format a message as an array.
ApiMessage | ApiRawMessage | $msg | |
string | null | $format |
Reimplemented from ApiErrorFormatter.
Definition at line 62 of file ApiErrorFormatter_BackCompat.php.
ApiErrorFormatter_BackCompat::getFormat | ( | ) |
Fetch the format for this formatter.
Reimplemented from ApiErrorFormatter.
Definition at line 37 of file ApiErrorFormatter_BackCompat.php.