Merge "Have TitleParser::parseTitle() default to NS_MAIN to match Title"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 15 Aug 2018 14:43:44 +0000 (14:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 15 Aug 2018 14:43:44 +0000 (14:43 +0000)
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 );
 }