Merge "Slightly simplify QueryPage::outputResults"
[lhc/web/wiklou.git] / includes / title / MediaWikiTitleCodec.php
index 01575ac..c497865 100644 (file)
@@ -76,7 +76,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                        MWNamespace::hasGenderDistinction( $namespace )
                ) {
 
-                       //NOTE: we are assuming here that the title text is a user name!
+                       // NOTE: we are assuming here that the title text is a user name!
                        $gender = $this->genderCache->getGenderOf( $text, __METHOD__ );
                        $name = $this->language->getGenderNsText( $namespace, $gender );
                } else {
@@ -198,7 +198,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
         * @param int $defaultNamespace
         *
         * @throws MalformedTitleException If $text is not a valid title string.
-        * @return array A mapp with the fields 'interwiki', 'fragment', 'namespace',
+        * @return array A map with the fields 'interwiki', 'fragment', 'namespace',
         *         'user_case_dbkey', and 'dbkey'.
         */
        public function splitTitleString( $text, $defaultNamespace = NS_MAIN ) {
@@ -255,7 +255,8 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                        $m = array();
                        if ( preg_match( $prefixRegexp, $dbkey, $m ) ) {
                                $p = $m[1];
-                               if ( ( $ns = $this->language->getNsIndex( $p ) ) !== false ) {
+                               $ns = $this->language->getNsIndex( $p );
+                               if ( $ns !== false ) {
                                        # Ordinary namespace
                                        $dbkey = $m[2];
                                        $parts['namespace'] = $ns;
@@ -265,7 +266,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                                                        # Disallow Talk:File:x type titles...
                                                        throw new MalformedTitleException( 'title-invalid-talk-namespace', $text );
                                                } elseif ( Interwiki::isValidInterwiki( $x[1] ) ) {
-                                                       //TODO: get rid of global state!
+                                                       // TODO: get rid of global state!
                                                        # Disallow Talk:Interwiki:x type titles...
                                                        throw new MalformedTitleException( 'title-invalid-talk-namespace', $text );
                                                }