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) | |
Public Attributes | |
const | FORMAT_NAME = 'mw-time-iso' |
Protected Member Functions | |
stringParse ( $value) | |
Parses the provided string and returns the result. | |
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. | |
parseFromOutputString (Language $lang, $value, $precision, $msgKey) | |
getRegexpFromMessageText ( $msgText) | |
Creates a regular expression snippet from a given message. | |
chooseAndParseNumber (Language $lang, $matches, $precision, $isBceMsg) | |
Tries to find the number from the given matches and parses it. | |
isBceMsg ( $msgKey) | |
getTimeFromYear ( $year, $isBce) | |
setPrecision ( $precision) | |
Private Attributes | |
$lang | |
$isoTimestampParser | |
Static Private Attributes | |
static | $precisionMsgKeys |
static | $paddedZeros |
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 a regular expression snippet from a given message.
This replaces $1 with (.+?) and also expands PLURAL clauses so that we can match for every combination of these.
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 |
|
staticprivate |
|
staticprivate |
const Wikibase\Repo\Parsers\MwTimeIsoParser::FORMAT_NAME = 'mw-time-iso' |