@@ -22,10 +22,10 @@ |
||
| 22 | 22 | * @ingroup ExtensionManager |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -$specialPageAliases = []; |
|
| 25 | +$specialPageAliases = [ ]; |
|
| 26 | 26 | |
| 27 | 27 | /** English |
| 28 | 28 | */ |
| 29 | -$specialPageAliases['en'] = [ |
|
| 29 | +$specialPageAliases[ 'en' ] = [ |
|
| 30 | 30 | 'BatchUpload' => [ 'BatchUpload' ], |
| 31 | 31 | ]; |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | * @ingroup ExtensionManager |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -$magicWords = []; |
|
| 25 | +$magicWords = [ ]; |
|
| 26 | 26 | |
| 27 | 27 | /** English |
| 28 | 28 | */ |
| 29 | -$magicWords['en'] = [ |
|
| 29 | +$magicWords[ 'en' ] = [ |
|
| 30 | 30 | 'batchupload' => [ 0, 'batchupload' ], |
| 31 | 31 | ]; |
| 32 | 32 | \ No newline at end of file |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * @param $targetConfiguration |
| 49 | 49 | */ |
| 50 | - public function registerEarlyConfiguration( &$targetConfiguration ){ |
|
| 50 | + public function registerEarlyConfiguration( &$targetConfiguration ) { |
|
| 51 | 51 | $sourceConfiguration = $this->getEarlyConfiguration(); |
| 52 | 52 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
| 53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * @param $targetConfiguration |
| 57 | 57 | */ |
| 58 | - public function registerLateConfiguration( &$targetConfiguration ){ |
|
| 58 | + public function registerLateConfiguration( &$targetConfiguration ) { |
|
| 59 | 59 | $sourceConfiguration = $this->getLateConfiguration(); |
| 60 | 60 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
| 61 | 61 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * @param $targetConfiguration |
| 49 | 49 | */ |
| 50 | - public function registerEarlyConfiguration( &$targetConfiguration ){ |
|
| 50 | + public function registerEarlyConfiguration( &$targetConfiguration ) { |
|
| 51 | 51 | $sourceConfiguration = $this->getEarlyConfiguration(); |
| 52 | 52 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
| 53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * @param $targetConfiguration |
| 57 | 57 | */ |
| 58 | - public function registerLateConfiguration( &$targetConfiguration ){ |
|
| 58 | + public function registerLateConfiguration( &$targetConfiguration ) { |
|
| 59 | 59 | $sourceConfiguration = $this->getLateConfiguration(); |
| 60 | 60 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
| 61 | 61 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | protected function mergeConfiguration( $sourceConfiguration, &$targetConfiguration ) { |
| 67 | 67 | foreach ( $sourceConfiguration as $varname => $value ) { |
| 68 | - $targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration )?array_replace_recursive( $targetConfiguration[ $varname ], $value ):$value; |
|
| 68 | + $targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration ) ?array_replace_recursive( $targetConfiguration[ $varname ], $value ) : $value; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | protected function getEarlyConfiguration(): array { |
| 76 | 76 | |
| 77 | - $configuration = []; |
|
| 77 | + $configuration = [ ]; |
|
| 78 | 78 | |
| 79 | 79 | $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__ . '/SimpleBatchUpload.alias.php'; |
| 80 | 80 | $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__ . '/SimpleBatchUpload.magic.php'; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $configuration[ 'wgHooks' ][ 'ParserFirstCallInit' ][ 'ext.simplebatchupload' ] = [ $this, 'registerParserFunction' ]; |
| 85 | 85 | $configuration[ 'wgHooks' ][ 'MakeGlobalVariablesScript' ][ 'ext.simplebatchupload' ] = [ $this, 'onMakeGlobalVariablesScript' ]; |
| 86 | - $configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache']; |
|
| 86 | + $configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache' ]; |
|
| 87 | 87 | |
| 88 | 88 | return $configuration; |
| 89 | 89 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | protected function getLateConfiguration(): array { |
| 96 | 96 | |
| 97 | - $configuration = []; |
|
| 97 | + $configuration = [ ]; |
|
| 98 | 98 | $configuration[ 'wgResourceModules' ] = $this->getUploadSupportModuleDefinition() + $this->getUploadModuleDefinition(); |
| 99 | 99 | |
| 100 | 100 | return $configuration; |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | $dependencies = [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.jqueryMsg' ]; |
| 140 | 140 | |
| 141 | 141 | if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.32.0', '>' ) ) { |
| 142 | - $dependencies[] = 'mediawiki.api'; |
|
| 142 | + $dependencies[ ] = 'mediawiki.api'; |
|
| 143 | 143 | } else { |
| 144 | - $dependencies[] = 'mediawiki.api.edit'; |
|
| 144 | + $dependencies[ ] = 'mediawiki.api.edit'; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return [ 'ext.SimpleBatchUpload' => |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @param \OutputPage $out |
| 174 | 174 | */ |
| 175 | 175 | public function onMakeGlobalVariablesScript( &$vars, $out ) { |
| 176 | - $vars['simpleBatchUploadMaxFilesPerBatch'] = $this->getMaxFilesPerBatchConfig(); |
|
| 176 | + $vars[ 'simpleBatchUploadMaxFilesPerBatch' ] = $this->getMaxFilesPerBatchConfig(); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | public function onSetupAfterCache() { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function testRegisterEarlyConfiguraion() { |
| 48 | 48 | $sbu = new SimpleBatchUpload(); |
| 49 | - $config = []; |
|
| 49 | + $config = [ ]; |
|
| 50 | 50 | |
| 51 | 51 | $sbu->registerEarlyConfiguration( $config ); |
| 52 | 52 | $this->assertEarlyConfiguration( $config ); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function testRegisterLateConfiguraion() { |
| 56 | 56 | $sbu = new SimpleBatchUpload(); |
| 57 | - $config = []; |
|
| 57 | + $config = [ ]; |
|
| 58 | 58 | |
| 59 | 59 | $sbu->registerLateConfiguration( $config ); |
| 60 | 60 | $this->assertLateConfiguration( $config ); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ->method( 'setFunctionHook' ) |
| 71 | 71 | ->with( |
| 72 | 72 | $this->equalTo( 'batchupload' ), |
| 73 | - $this->callback( function ( $param ) { |
|
| 73 | + $this->callback( function( $param ) { |
|
| 74 | 74 | return is_callable( $param ); |
| 75 | 75 | } ), |
| 76 | 76 | $this->equalTo( Parser::SFH_OBJECT_ARGS ) ) |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function testOnMakeGlobalVariablesScript() { |
| 84 | - $vars = []; |
|
| 84 | + $vars = [ ]; |
|
| 85 | 85 | $out = $this->getMockBuilder( OutputPage::class ) |
| 86 | 86 | ->disableOriginalConstructor() |
| 87 | 87 | ->getMock(); |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | $dependencies = [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.jqueryMsg' ]; |
| 147 | 147 | |
| 148 | 148 | if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.32.0', '>' ) ) { |
| 149 | - $dependencies[] = 'mediawiki.api'; |
|
| 149 | + $dependencies[ ] = 'mediawiki.api'; |
|
| 150 | 150 | } else { |
| 151 | - $dependencies[] = 'mediawiki.api.edit'; |
|
| 151 | + $dependencies[ ] = 'mediawiki.api.edit'; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $this->assertArrayHasKey( 'ext.SimpleBatchUpload', $configuration[ 'wgResourceModules' ] ); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'position' => 'top', |
| 161 | 161 | 'dependencies' => $dependencies, |
| 162 | 162 | 'messages' => [ 'simplebatchupload-comment', 'simplebatchupload-max-files-alert' ], |
| 163 | - ]); |
|
| 163 | + ] ); |
|
| 164 | 164 | |
| 165 | 165 | } |
| 166 | 166 | |