Have TitleParser::parseTitle() default to NS_MAIN to match Title
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 15 Aug 2018 03:58:34 +0000 (20:58 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 15 Aug 2018 03:58:34 +0000 (20:58 -0700)
Matches the default parameters of Title::newFromText().

Change-Id: Id08312d424be9ae7e64688bb21687204ae77c560

includes/title/MediaWikiTitleCodec.php
includes/title/TitleParser.php

index 890a870..a00ef1e 100644 (file)
@@ -149,7 +149,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
         * @throws MalformedTitleException
         * @return TitleValue
         */
-       public function parseTitle( $text, $defaultNamespace ) {
+       public function parseTitle( $text, $defaultNamespace = NS_MAIN ) {
                // NOTE: this is an ugly cludge that allows this class to share the
                // code for parsing with the old Title class. The parser code should
                // be refactored to avoid this.
index de65be8..ddffed6 100644 (file)
@@ -43,5 +43,5 @@ interface TitleParser {
         * @throws MalformedTitleException If the text is not a valid representation of a page title.
         * @return TitleValue
         */
-       public function parseTitle( $text, $defaultNamespace );
+       public function parseTitle( $text, $defaultNamespace = NS_MAIN );
 }