Fixed spacing
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 4 Aug 2014 09:51:22 +0000 (11:51 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Mon, 4 Aug 2014 09:51:22 +0000 (11:51 +0200)
- Removed spaces around array index
- Changed else if to elseif
- Added space after foreach/if/function
- include_once is not a function

Change-Id: I7745ae791d1b7e60cfebec6d268513a9cc071bdd

includes/Cookie.php
includes/Skin.php
includes/media/SVG.php
includes/resourceloader/ResourceLoader.php
tests/phpunit/phpunit.php

index 8b5906a..cb04190 100644 (file)
@@ -94,8 +94,9 @@ class Cookie {
 
                // Don't allow a trailing dot or addresses without a or just a leading dot
                if ( substr( $domain, -1 ) == '.' ||
-                        count( $dc ) <= 1 ||
-                        count( $dc ) == 2 && $dc[0] === '' ) {
+                       count( $dc ) <= 1 ||
+                       count( $dc ) == 2 && $dc[0] === ''
+               ) {
                        return false;
                }
 
index fd737c0..a59d567 100644 (file)
@@ -220,7 +220,7 @@ abstract class Skin extends ContextSource {
                                # is no longer valid.
                                wfDebug( "Skin class does not exist: $className\n" );
 
-                               $fallback = $skinNames[ Skin::normalizeKey( $wgFallbackSkin ) ];
+                               $fallback = $skinNames[Skin::normalizeKey( $wgFallbackSkin )];
                                $className = "Skin{$fallback}";
                        }
                }
index 9245d42..a0ce806 100644 (file)
@@ -202,7 +202,7 @@ class SvgHandler extends ImageHandler {
                $tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
                $lnPath = "$tmpDir/" . basename( $srcPath );
                $ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
-               $cleaner = new ScopedCallback( function() use ( $tmpDir, $lnPath ) {
+               $cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
                        wfSuppressWarnings();
                        unlink( $lnPath );
                        rmdir( $tmpDir );
index bcb3842..d46f0a3 100644 (file)
@@ -307,11 +307,11 @@ class ResourceLoader {
 
                                        // If $name is preceded with a '+', the defined style files will be added to 'default'
                                        // skinStyles, otherwise 'default' will be ignored as it normally would be.
-                                       if ( isset( $skinStyles[ $name ] ) ) {
-                                               $paths = (array)$skinStyles[ $name ];
+                                       if ( isset( $skinStyles[$name] ) ) {
+                                               $paths = (array)$skinStyles[$name];
                                                $styleFiles = array();
-                                       } else if ( isset( $skinStyles[ '+' . $name ] ) ) {
-                                               $paths = (array)$skinStyles[ '+' . $name ];
+                                       } elseif ( isset( $skinStyles['+' . $name] ) ) {
+                                               $paths = (array)$skinStyles['+' . $name];
                                                $styleFiles = isset( $this->moduleInfos[$name]['skinStyles']['default'] ) ?
                                                        $this->moduleInfos[$name]['skinStyles']['default'] :
                                                        array();
index 63313cf..1125504 100755 (executable)
@@ -148,17 +148,17 @@ class PHPUnitMaintClass extends Maintenance {
                }
 
                $key = array_search( '--debug-tests', $_SERVER['argv'] );
-               if( $key !== false && array_search( '--printer', $_SERVER['argv'] ) === false ) {
+               if ( $key !== false && array_search( '--printer', $_SERVER['argv'] ) === false ) {
                        unset( $_SERVER['argv'][$key] );
                        array_splice( $_SERVER['argv'], 1, 0, 'MediaWikiPHPUnitTestListener' );
                        array_splice( $_SERVER['argv'], 1, 0, '--printer' );
                }
 
-               foreach( self::$additionalOptions as $option => $default ) {
+               foreach ( self::$additionalOptions as $option => $default ) {
                        $key = array_search( '--' . $option, $_SERVER['argv'] );
-                       if( $key !== false ) {
+                       if ( $key !== false ) {
                                unset( $_SERVER['argv'][$key] );
-                               if( $this->mParams[$option]['withArg'] ) {
+                               if ( $this->mParams[$option]['withArg'] ) {
                                        self::$additionalOptions[$option] = $_SERVER['argv'][$key + 1];
                                        unset( $_SERVER['argv'][$key + 1] );
                                } else {
@@ -179,11 +179,11 @@ class PHPUnitMaintClass extends Maintenance {
         */
        private function forceFormatServerArgv() {
                $argv = array();
-               foreach( $_SERVER['argv'] as $key => $arg ) {
-                       if( $key === 0 ) {
+               foreach ( $_SERVER['argv'] as $key => $arg ) {
+                       if ( $key === 0 ) {
                                $argv[0] = $arg;
                        } elseif ( strstr( $arg, '=' ) ) {
-                               foreach( explode( '=', $arg, 2 ) as $argPart ) {
+                               foreach ( explode( '=', $arg, 2 ) as $argPart ) {
                                        $argv[] = $argPart;
                                }
                        } else {
@@ -209,12 +209,12 @@ if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) {
 
 $ok = false;
 
-foreach( array(
+foreach ( array(
        stream_resolve_include_path( 'phpunit.phar' ),
        'PHPUnit/Runner/Version.php',
        'PHPUnit/Autoload.php'
 ) as $includePath ) {
-       @include_once( $includePath );
+       @include_once $includePath;
        if ( class_exists( 'PHPUnit_TextUI_Command' ) ) {
                $ok = true;
                break;