Merge "ForeignAPIRepo: Fetch thumb error from foreign repo"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 6743619..a3c3b10 100644 (file)
@@ -283,13 +283,13 @@ class ResourceLoader {
 
                // Get core test suites
                $testModules = array();
-               $testModules['qunit'] = include( "$IP/tests/qunit/QUnitTestResources.php" );
+               $testModules['qunit'] = include "$IP/tests/qunit/QUnitTestResources.php";
                // Get other test suites (e.g. from extensions)
                wfRunHooks( 'ResourceLoaderTestModules', array( &$testModules, &$this ) );
 
                // Add the testrunner (which configures QUnit) to the dependencies.
                // Since it must be ready before any of the test suites are executed.
-               foreach( $testModules['qunit'] as &$module ) {
+               foreach ( $testModules['qunit'] as &$module ) {
                        // Make sure all test modules are top-loading so that when QUnit starts
                        // on document-ready, it will run once and finish. If some tests arrive
                        // later (possibly after QUnit has already finished) they will be ignored.
@@ -297,7 +297,7 @@ class ResourceLoader {
                        $module['dependencies'][] = 'mediawiki.tests.qunit.testrunner';
                }
 
-               foreach( $testModules as $id => $names ) {
+               foreach ( $testModules as $id => $names ) {
                        // Register test modules
                        $this->register( $testModules[$id] );
 
@@ -318,7 +318,7 @@ class ResourceLoader {
         * @param array $properties source properties
         * @throws MWException
         */
-       public function addSource( $id, $properties = null) {
+       public function addSource( $id, $properties = null ) {
                // Allow multiple sources to be registered in one call
                if ( is_array( $id ) ) {
                        foreach ( $id as $key => $value ) {
@@ -364,7 +364,7 @@ class ResourceLoader {
         * @return Array
         */
        public function getTestModuleNames( $framework = 'all' ) {
-               /// @TODO: api siteinfo prop testmodulenames modulenames
+               /// @todo api siteinfo prop testmodulenames modulenames
                if ( $framework == 'all' ) {
                        return $this->testModuleNames;
                } elseif ( isset( $this->testModuleNames[$framework] ) && is_array( $this->testModuleNames[$framework] ) ) {
@@ -466,7 +466,7 @@ class ResourceLoader {
                // Preload information needed to the mtime calculation below
                try {
                        $this->preloadModuleInfo( array_keys( $modules ), $context );
-               } catch( Exception $e ) {
+               } catch ( Exception $e ) {
                        // Add exception to the output as a comment
                        $errors .= $this->makeComment( $e->__toString() );
                        $this->hasErrors = true;
@@ -637,7 +637,7 @@ class ResourceLoader {
                if ( !$good ) {
                        try { // RL always hits the DB on file cache miss...
                                wfGetDB( DB_SLAVE );
-                       } catch( DBConnectionError $e ) { // ...check if we need to fallback to cache
+                       } catch ( DBConnectionError $e ) { // ...check if we need to fallback to cache
                                $good = $fileCache->isCacheGood(); // cache existence check
                        }
                }
@@ -914,7 +914,7 @@ class ResourceLoader {
 
                                        if ( $media === '' || $media == 'all' ) {
                                                $out[] = $style;
-                                       } else if ( is_string( $media ) ) {
+                                       } elseif ( is_string( $media ) ) {
                                                $out[] = "@media $media {\n" . str_replace( "\n", "\n\t", "\t" . $style ) . "}";
                                        }
                                        // else: skip