ResourceLoaderLanguageDataModule: clean up
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 6 Jun 2012 20:07:12 +0000 (22:07 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Wed, 6 Jun 2012 20:07:29 +0000 (22:07 +0200)
Change-Id: Id64e7ec8f22cc74926ff374ca207bf19552398aa

includes/resourceloader/ResourceLoaderLanguageDataModule.php

index aeeb291..4904735 100644 (file)
@@ -39,7 +39,7 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
 
        /**
         * @param $context ResourceLoaderContext
-        * @return string Javascript code
+        * @return string: Javascript code
         */
        public function getScript( ResourceLoaderContext $context ) {
                global $wgContLang;
@@ -62,13 +62,14 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderModule {
                $hash = md5( serialize( $forms ) );
 
                $result = $cache->get( $key );
-               if ( is_array( $result ) ) {
-                       if ( $result['hash'] === $hash ) {
-                               return $result['timestamp'];
-                       }
+               if ( is_array( $result ) && $result['hash'] === $hash ) {
+                       return $result['timestamp'];
                }
                $timestamp = wfTimestamp();
-               $cache->set( $key, array( 'hash' => $hash, 'timestamp' => $timestamp ) );
+               $cache->set( $key, array(
+                       'hash' => $hash,
+                       'timestamp' => $timestamp,
+               ) );
                return $timestamp;
        }