$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 );
// 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();
}
$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 {
*/
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 {
$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;