(bug 34289) user.options CSS loaded twice. Fixed by splitting off the CSS part of...
[lhc/web/wiklou.git] / includes / Namespace.php
index 57840c9..292559d 100644 (file)
@@ -36,7 +36,7 @@ class MWNamespace {
         * @return true
         */
        private static function isMethodValidFor( $index, $method ) {
-               if( $index < NS_MAIN ) {
+               if ( $index < NS_MAIN ) {
                        throw new MWException( "$method does not make any sense for given namespace $index" );
                }
                return true;
@@ -50,7 +50,7 @@ class MWNamespace {
         */
        public static function isMovable( $index ) {
                global $wgAllowImageMoving;
-               return !( $index < NS_MAIN || ($index == NS_FILE && !$wgAllowImageMoving)  || $index == NS_CATEGORY );
+               return !( $index < NS_MAIN || ( $index == NS_FILE && !$wgAllowImageMoving )  || $index == NS_CATEGORY );
        }
 
        /**
@@ -69,6 +69,7 @@ class MWNamespace {
         * @deprecated Please use the more consistently named isSubject (since 1.19)
         */
        public static function isMain( $index ) {
+               wfDeprecated( __METHOD__, '1.19' );
                return self::isSubject( $index );
        }
 
@@ -105,7 +106,7 @@ class MWNamespace {
         */
        public static function getSubject( $index ) {
                # Handle special namespaces
-               if( $index < NS_MAIN ) {
+               if ( $index < NS_MAIN ) {
                        return $index;
                }
 
@@ -125,9 +126,9 @@ class MWNamespace {
        public static function getAssociated( $index ) {
                self::isMethodValidFor( $index, __METHOD__ );
 
-               if( self::isMain( $index ) ) {
+               if ( self::isSubject( $index ) ) {
                        return self::getTalk( $index );
-               } elseif( self::isTalk( $index ) ) {
+               } elseif ( self::isTalk( $index ) ) {
                        return self::getSubject( $index );
                } else {
                        return null;
@@ -138,7 +139,7 @@ class MWNamespace {
         * Returns whether the specified namespace exists
         *
         * @param $index
-        * 
+        *
         * @return bool
         * @since 1.19
         */
@@ -155,8 +156,8 @@ class MWNamespace {
         * of this function rather than directly doing comparison will make
         * sure that code will not potentially break.
         *
-        * @param $ns1 The first namespace index
-        * @param $ns2 The second namespae index
+        * @param $ns1 int The first namespace index
+        * @param $ns2 int The second namespae index
         *
         * @return bool
         * @since 1.19
@@ -170,8 +171,8 @@ class MWNamespace {
         * eg: NS_USER and NS_USER wil return true, as well
         *     NS_USER and NS_USER_TALK will return true.
         *
-        * @param $ns1 The first namespace index
-        * @param $ns2 The second namespae index
+        * @param $ns1 int The first namespace index
+        * @param $ns2 int The second namespae index
         *
         * @return bool
         * @since 1.19
@@ -208,7 +209,7 @@ class MWNamespace {
         */
        public static function getCanonicalName( $index ) {
                $nslist = self::getCanonicalNamespaces();
-               if( isset( $nslist[$index] ) ) {
+               if ( isset( $nslist[$index] ) ) {
                        return $nslist[$index];
                } else {
                        return false;
@@ -227,7 +228,7 @@ class MWNamespace {
                if ( $xNamespaces === false ) {
                        $xNamespaces = array();
                        foreach ( self::getCanonicalNamespaces() as $i => $text ) {
-                               $xNamespaces[strtolower($text)] = $i;
+                               $xNamespaces[strtolower( $text )] = $i;
                        }
                }
                if ( array_key_exists( $name, $xNamespaces ) ) {
@@ -305,7 +306,7 @@ class MWNamespace {
         */
        public static function getContentNamespaces() {
                global $wgContentNamespaces;
-               if( !is_array( $wgContentNamespaces ) || $wgContentNamespaces === array() ) {
+               if ( !is_array( $wgContentNamespaces ) || $wgContentNamespaces === array() ) {
                        return NS_MAIN;
                } elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) {
                        // always force NS_MAIN to be part of array (to match the algorithm used by isContent)