Passed
Push — master ( 119246...75c57e )
by Jeroen De
26:26
created
src/SimpleBatchUpload.alias.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
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
 ];
Please login to merge, or discard this patch.
src/SimpleBatchUpload.magic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
tests/phpunit/SimpleBatchUploadTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/SimpleBatchUpload.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 		$simpleBatchUpload->registerEarlyConfiguration( $GLOBALS );
43 43
 	}
44 44
 
45
-	public function registerEarlyConfiguration( &$targetConfiguration ){
45
+	public function registerEarlyConfiguration( &$targetConfiguration ) {
46 46
 		$sourceConfiguration = $this->getEarlyConfiguration();
47 47
 		$this->mergeConfiguration( $sourceConfiguration, $targetConfiguration );
48 48
 	}
49 49
 
50
-	public function registerLateConfiguration( &$targetConfiguration ){
50
+	public function registerLateConfiguration( &$targetConfiguration ) {
51 51
 		$sourceConfiguration = $this->getLateConfiguration();
52 52
 		$this->mergeConfiguration( $sourceConfiguration, $targetConfiguration );
53 53
 	}
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	protected function mergeConfiguration( $sourceConfiguration, &$targetConfiguration ) {
59 59
 		foreach ( $sourceConfiguration as $varname => $value ) {
60
-			$targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration )?array_replace_recursive( $targetConfiguration[ $varname ], $value ):$value;
60
+			$targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration ) ?array_replace_recursive( $targetConfiguration[ $varname ], $value ) : $value;
61 61
 		}
62 62
 	}
63 63
 
64 64
 	protected function getEarlyConfiguration(): array {
65 65
 
66
-		$configuration = [];
66
+		$configuration = [ ];
67 67
 
68 68
 		$configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__ . '/SimpleBatchUpload.alias.php';
69 69
 		$configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__ . '/SimpleBatchUpload.magic.php';
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
 
73 73
 		$configuration[ 'wgHooks' ][ 'ParserFirstCallInit' ][ 'ext.simplebatchupload' ] = [ $this, 'registerParserFunction' ];
74 74
 		$configuration[ 'wgHooks' ][ 'MakeGlobalVariablesScript' ][ 'ext.simplebatchupload' ] = [ $this, 'onMakeGlobalVariablesScript' ];
75
-		$configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache'];
75
+		$configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache' ];
76 76
 
77 77
 		return $configuration;
78 78
 	}
79 79
 
80 80
 	protected function getLateConfiguration(): array {
81 81
 
82
-		$configuration = [];
82
+		$configuration = [ ];
83 83
 		$configuration[ 'wgResourceModules' ] = $this->getUploadSupportModuleDefinition() + $this->getUploadModuleDefinition();
84 84
 
85 85
 		return $configuration;
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 		$dependencies = [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.jqueryMsg' ];
116 116
 
117 117
 		if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.32.0', '>' ) ) {
118
-			$dependencies[] = 'mediawiki.api';
118
+			$dependencies[ ] = 'mediawiki.api';
119 119
 		} else {
120
-			$dependencies[] = 'mediawiki.api.edit';
120
+			$dependencies[ ] = 'mediawiki.api.edit';
121 121
 		}
122 122
 
123 123
 		return [ 'ext.SimpleBatchUpload' =>
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 * @param \OutputPage $out
150 150
 	 */
151 151
 	public function onMakeGlobalVariablesScript( &$vars, $out ) {
152
-		$vars['simpleBatchUploadMaxFilesPerBatch'] = $this->getMaxFilesPerBatchConfig();
152
+		$vars[ 'simpleBatchUploadMaxFilesPerBatch' ] = $this->getMaxFilesPerBatchConfig();
153 153
 	}
154 154
 
155 155
 	public function onSetupAfterCache() {
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
 		$simpleBatchUpload->registerEarlyConfiguration( $GLOBALS );
43 43
 	}
44 44
 
45
-	public function registerEarlyConfiguration( &$targetConfiguration ){
45
+	public function registerEarlyConfiguration( &$targetConfiguration ) {
46 46
 		$sourceConfiguration = $this->getEarlyConfiguration();
47 47
 		$this->mergeConfiguration( $sourceConfiguration, $targetConfiguration );
48 48
 	}
49 49
 
50
-	public function registerLateConfiguration( &$targetConfiguration ){
50
+	public function registerLateConfiguration( &$targetConfiguration ) {
51 51
 		$sourceConfiguration = $this->getLateConfiguration();
52 52
 		$this->mergeConfiguration( $sourceConfiguration, $targetConfiguration );
53 53
 	}
Please login to merge, or discard this patch.