Wikibase
MediaWiki Wikibase extension
|
Class to parse values that can be formatted by MWTimeIsoFormatter This includes parsing of localized values. More...
Public Member Functions | |
__construct (ParserOptions $options=null) | |
Protected Member Functions | |
stringParse ( $value) | |
Parses the provided string and returns the result. More... | |
Private Member Functions | |
reconvertOutputString ( $value, Language $lang) | |
Analyzes a string if it is a time value that has been specified in one of the output precision formats specified in the settings. More... | |
parseFromOutputString (Language $lang, $value, $precision, $msgKey) | |
getRegexpsFromMessageText (string $msgText) | |
Creates regular expression snippets from a given message. More... | |
chooseAndParseNumber (Language $lang, $matches, $precision, $isBceMsg) | |
Tries to find the number from the given matches and parses it. More... | |
isBceMsg ( $msgKey) | |
getTimeFromYear ( $year, $isBce) | |
setPrecision ( $precision) | |
Private Attributes | |
const | FORMAT_NAME = 'mw-time-iso' |
const | PRECISION_MSG_KEYS |
const | PADDED_ZEROS |
$lang | |
$isoTimestampParser | |
Class to parse values that can be formatted by MWTimeIsoFormatter This includes parsing of localized values.
Wikibase\Repo\Parsers\MwTimeIsoParser::__construct | ( | ParserOptions | $options = null | ) |
ParserOptions | null | $options |
|
private |
Tries to find the number from the given matches and parses it.
This naively assumes the first parseable number to be the best match.
Language | $lang | |
string[] | $matches | |
int | $precision | |
boolean | $isBceMsg |
|
private |
Creates regular expression snippets from a given message.
This replaces $1 with (.+?) and also expands PLURAL clauses so that we can match for every combination of these. Callers should try each returned regex in turn.
string | $msgText |
|
private |
string | $year | |
bool | $isBce |
|
private |
string | $msgKey |
|
private |
Language | $lang | |
string | $value | |
int | $precision | |
string | $msgKey |
|
private |
Analyzes a string if it is a time value that has been specified in one of the output precision formats specified in the settings.
If so, this method re-converts such an output string to an object that can be used to instantiate a time.Time object.
string | $value | |
Language | $lang |
RuntimeException |
|
private |
int | $precision |
|
protected |
Parses the provided string and returns the result.
string | $value |
ParseException |
|
private |
|
private |
|
private |
|
private |
|
private |