X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMessage.php;h=5719f83090429afbe6154338190d21dded1decc2;hb=9abb9999d720ad77aab26a9a331d7bfd797ee96f;hp=8d8cdeeb70e018c47552960de4d41cc1c4943d12;hpb=e913cca852b570db6ed3a7995d2025ad21c1ef6e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Message.php b/includes/Message.php index 8d8cdeeb70..5719f83090 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -22,11 +22,11 @@ */ /** - * The Message class provides methods which fullfil two basic services: + * The Message class provides methods which fulfil two basic services: * - fetching interface messages * - processing messages into a variety of formats * - * First implemented with MediaWiki 1.17, the Message class is intented to + * First implemented with MediaWiki 1.17, the Message class is intended to * replace the old wfMsg* functions that over time grew unusable. * @see https://www.mediawiki.org/wiki/Manual:Messages_API for equivalences * between old and new functions. @@ -216,7 +216,7 @@ class Message { * Constructor. * @since 1.17 * @param $key: message key, or array of message keys to try and use the first non-empty message for - * @param $params Array message parameters + * @param array $params message parameters * @return Message: $this */ public function __construct( $key, $params = array() ) { @@ -226,12 +226,45 @@ class Message { $this->language = $wgLang; } + /** + * Returns the message key + * + * @since 1.21 + * + * @return string + */ + public function getKey() { + return $this->key; + } + + /** + * Returns the message parameters + * + * @since 1.21 + * + * @return string[] + */ + public function getParams() { + return $this->parameters; + } + + /** + * Returns the message format + * + * @since 1.21 + * + * @return string + */ + public function getFormat() { + return $this->format; + } + /** * Factory function that is just wrapper for the real constructor. It is - * intented to be used instead of the real constructor, because it allows + * intended to be used instead of the real constructor, because it allows * chaining method calls, while new objects don't. * @since 1.17 - * @param $key String: message key + * @param string $key message key * @param Varargs: parameters as Strings * @return Message: $this */ @@ -521,7 +554,7 @@ class Message { } /** - * Returns the message text as-is, only parameters are subsituted. + * Returns the message text as-is, only parameters are substituted. * @since 1.17 * @return String: Unescaped untransformed message text. */ @@ -600,10 +633,10 @@ class Message { } /** - * Substitutes any paramaters into the message text. + * Substitutes any parameters into the message text. * @since 1.17 - * @param $message String: the message text - * @param $type String: either before or after + * @param string $message the message text + * @param string $type either before or after * @return String */ protected function replaceParameters( $message, $type = 'before' ) { @@ -621,7 +654,7 @@ class Message { /** * Extracts the parameter type and preprocessed the value if needed. * @since 1.18 - * @param $param String|Array: Parameter as defined in this class. + * @param string|array $param Parameter as defined in this class. * @return Tuple(type, value) */ protected function extractParam( $param ) { @@ -645,7 +678,7 @@ class Message { /** * Wrapper for what ever method we use to parse wikitext. * @since 1.17 - * @param $string String: Wikitext message contents + * @param string $string Wikitext message contents * @return string Wikitext parsed into HTML */ protected function parseText( $string ) { @@ -656,7 +689,7 @@ class Message { /** * Wrapper for what ever method we use to {{-transform wikitext. * @since 1.17 - * @param $string String: Wikitext message contents + * @param string $string Wikitext message contents * @return string Wikitext with {{-constructs replaced with their values. */ protected function transformText( $string ) { @@ -710,8 +743,8 @@ class RawMessage extends Message { * Call the parent constructor, then store the key as * the message. * - * @param $key Message to use - * @param $params Parameters for the message + * @param string $key Message to use + * @param array $params Parameters for the message * @see Message::__construct */ public function __construct( $key, $params = array() ) {