@@ -97,8 +97,8 @@ |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | - * @param $configuration |
|
101 | - */ |
|
100 | + * @param $configuration |
|
101 | + */ |
|
102 | 102 | public function assertEarlyConfiguration( $configuration ) { |
103 | 103 | |
104 | 104 | //$configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__ . '/SimpleBatchUpload.alias.php'; |
@@ -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 ) ) |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public function testOnMakeGlobalVariablesScript() { |
84 | 84 | $sbu = new SimpleBatchUpload(); |
85 | - $vars = []; |
|
85 | + $vars = [ ]; |
|
86 | 86 | |
87 | 87 | $sbu->onMakeGlobalVariablesScript( $vars ); |
88 | 88 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->assertArrayHasKey( 'ext.SimpleBatchUpload.jquery-file-upload', $configuration[ 'wgResourceModules' ] ); |
134 | 134 | $this->assertTrue( $configuration[ 'wgResourceModules' ][ 'ext.SimpleBatchUpload.jquery-file-upload' ] === [ |
135 | 135 | 'localBasePath' => dirname( dirname( __DIR__ ) ), |
136 | - 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ] . '/SimpleBatchUpload', |
|
136 | + 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ].'/SimpleBatchUpload', |
|
137 | 137 | 'scripts' => [ 'res/jquery.fileupload.js' ], |
138 | 138 | 'styles' => [ 'res/jquery.fileupload.css' ], |
139 | 139 | 'position' => 'top', |
@@ -143,21 +143,21 @@ discard block |
||
143 | 143 | $dependencies = [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.jqueryMsg' ]; |
144 | 144 | |
145 | 145 | if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.32.0', '>' ) ) { |
146 | - $dependencies[] = 'mediawiki.api'; |
|
146 | + $dependencies[ ] = 'mediawiki.api'; |
|
147 | 147 | } else { |
148 | - $dependencies[] = 'mediawiki.api.edit'; |
|
148 | + $dependencies[ ] = 'mediawiki.api.edit'; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | $this->assertArrayHasKey( 'ext.SimpleBatchUpload', $configuration[ 'wgResourceModules' ] ); |
152 | 152 | $this->assertTrue( $configuration[ 'wgResourceModules' ][ 'ext.SimpleBatchUpload' ] === [ |
153 | 153 | 'localBasePath' => dirname( dirname( __DIR__ ) ), |
154 | - 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ] . '/SimpleBatchUpload', |
|
154 | + 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ].'/SimpleBatchUpload', |
|
155 | 155 | 'scripts' => [ 'res/ext.SimpleBatchUpload.js' ], |
156 | 156 | 'styles' => [ 'res/ext.SimpleBatchUpload.css' ], |
157 | 157 | 'position' => 'top', |
158 | 158 | 'dependencies' => $dependencies, |
159 | 159 | 'messages' => [ 'simplebatchupload-comment', 'simplebatchupload-max-files-alert' ], |
160 | - ]); |
|
160 | + ] ); |
|
161 | 161 | |
162 | 162 | } |
163 | 163 |
@@ -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,16 +74,16 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected function getEarlyConfiguration(): array { |
76 | 76 | |
77 | - $configuration = []; |
|
77 | + $configuration = [ ]; |
|
78 | 78 | |
79 | - $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__ . '/SimpleBatchUpload.alias.php'; |
|
80 | - $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__ . '/SimpleBatchUpload.magic.php'; |
|
79 | + $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__.'/SimpleBatchUpload.alias.php'; |
|
80 | + $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__.'/SimpleBatchUpload.magic.php'; |
|
81 | 81 | |
82 | 82 | $configuration[ 'wgSpecialPages' ][ 'BatchUpload' ] = '\SimpleBatchUpload\SpecialBatchUpload'; |
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' => |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | protected function getBasePathsForNonComposerModules() { |
165 | 165 | return [ |
166 | 166 | 'localBasePath' => dirname( __DIR__ ), |
167 | - 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ] . '/SimpleBatchUpload', |
|
167 | + 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ].'/SimpleBatchUpload', |
|
168 | 168 | ]; |
169 | 169 | } |
170 | 170 | |
@@ -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() { |
@@ -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 | } |