Merge "SpecialVersion: Grammar fixes in comments"
[lhc/web/wiklou.git] / includes / Message.php
index f46c872..826d55b 100644 (file)
@@ -443,7 +443,7 @@ class Message {
         *
         * @since 1.22
         *
-        * @param number|number[] [$param,...] Time period parameters, or a single argument that is
+        * @param int|int[] [$param,...] Time period parameters, or a single argument that is
         * an array of time period parameters.
         *
         * @return Message $this
@@ -508,7 +508,7 @@ class Message {
         *
         * @since 1.19
         *
-        * @param $context IContextSource
+        * @param IContextSource $context
         *
         * @return Message $this
         */
@@ -604,7 +604,7 @@ class Message {
         *
         * @since 1.18
         *
-        * @param $title Title object
+        * @param Title $title
         *
         * @return Message $this
         */
@@ -659,10 +659,7 @@ class Message {
                # Maybe transform using the full parser
                if ( $this->format === 'parse' ) {
                        $string = $this->parseText( $string );
-                       $m = array();
-                       if ( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
-                               $string = $m[1];
-                       }
+                       $string = Parser::stripOuterParagraph( $string );
                } elseif ( $this->format === 'block-parse' ) {
                        $string = $this->parseText( $string );
                } elseif ( $this->format === 'text' ) {
@@ -890,7 +887,7 @@ class Message {
         * @param string $message The message text.
         * @param string $type Either "before" or "after".
         *
-        * @return String
+        * @return string
         */
        protected function replaceParameters( $message, $type = 'before' ) {
                $replacementKeys = array();
@@ -960,7 +957,14 @@ class Message {
         * @return string Wikitext parsed into HTML.
         */
        protected function parseText( $string ) {
-               $out = MessageCache::singleton()->parse( $string, $this->title, /*linestart*/true, $this->interface, $this->language );
+               $out = MessageCache::singleton()->parse(
+                       $string,
+                       $this->title,
+                       /*linestart*/true,
+                       $this->interface,
+                       $this->language
+               );
+
                return $out instanceof ParserOutput ? $out->getText() : $out;
        }
 
@@ -974,7 +978,12 @@ class Message {
         * @return string Wikitext with {{-constructs replaced with their values.
         */
        protected function transformText( $string ) {
-               return MessageCache::singleton()->transform( $string, $this->interface, $this->language, $this->title );
+               return MessageCache::singleton()->transform(
+                       $string,
+                       $this->interface,
+                       $this->language,
+                       $this->title
+               );
        }
 
        /**