Completed
Pull Request — master (#3)
by Mark A.
05:46
created
src/SimpleBatchUpload.alias.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,6 +27,6 @@
 block discarded – undo
27 27
 /** English
28 28
  * @author <your username>
29 29
  */
30
-$specialPageAliases['en'] = array(
31
-	'BatchUpload' => array( 'BatchUpload' ),
30
+$specialPageAliases[ 'en' ] = array(
31
+	'BatchUpload' => array('BatchUpload'),
32 32
 );
Please login to merge, or discard this patch.
src/SimpleBatchUpload.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return SimpleBatchUpload
36 36
 	 */
37 37
 	public static function singleton() {
38
-		if ( !isset( self::$singleton ) ) {
38
+		if (!isset(self::$singleton)) {
39 39
 			self::$singleton = new self();
40 40
 		}
41 41
 
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 
62 62
 		$moduleDescription = [
63 63
 			'scripts' => [ '/vendor/blueimp/jquery-file-upload/js/jquery.fileupload.js' ],
64
-			'styles'       => [	'/vendor/blueimp/jquery-file-upload/css/jquery.fileupload.css' ],
64
+			'styles'       => [ '/vendor/blueimp/jquery-file-upload/css/jquery.fileupload.css' ],
65 65
 			'position'     => 'top',
66 66
 			'dependencies' => [ 'jquery.ui.widget' ],
67 67
 		];
68 68
 
69
-		$this->registerResourceModule( 'ext.SimpleBatchUpload.jquery-file-upload', $moduleDescription, true );
69
+		$this->registerResourceModule('ext.SimpleBatchUpload.jquery-file-upload', $moduleDescription, true);
70 70
 
71 71
 	}
72 72
 
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 			'dependencies'  => [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title' ],
80 80
 		];
81 81
 
82
-		$this->registerResourceModule( 'ext.SimpleBatchUpload', $moduleDescription, false );
82
+		$this->registerResourceModule('ext.SimpleBatchUpload', $moduleDescription, false);
83 83
 	}
84 84
 
85 85
 	/**
86 86
 	 * @return array
87 87
 	 */
88
-	protected function registerResourceModule( $moduleName, $moduleDefinition, $isDependency = false ) {
88
+	protected function registerResourceModule($moduleName, $moduleDefinition, $isDependency = false) {
89 89
 
90
-		if ( file_exists( dirname( __DIR__ ) . '/vendor' ) || !$isDependency ) {
91
-			$localBasePath = dirname( __DIR__ );
90
+		if (file_exists(dirname(__DIR__) . '/vendor') || !$isDependency) {
91
+			$localBasePath = dirname(__DIR__);
92 92
 			$remoteBasePath = $GLOBALS[ 'wgExtensionAssetsPath' ] . '/SimpleBatchUpload';
93 93
 		} else {
94 94
 			$localBasePath = $GLOBALS[ 'IP' ];
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		}
97 97
 
98 98
 		$GLOBALS[ 'wgResourceModules' ][ $moduleName ] =
99
-			array_merge( [ 'localBasePath'  => $localBasePath, 'remoteBasePath' => $remoteBasePath ], $moduleDefinition );
99
+			array_merge([ 'localBasePath'  => $localBasePath, 'remoteBasePath' => $remoteBasePath ], $moduleDefinition);
100 100
 
101 101
 	}
102 102
 }
Please login to merge, or discard this patch.
src/SpecialBatchUpload.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	 * @param string $restriction User right required, e.g. "block" or "delete"
40 40
 	 * @param bool $listed Whether the page is listed in Special:Specialpages
41 41
 	 */
42
-	public function __construct( $name = '', $restriction = '', $listed = true ) {
43
-		parent::__construct( 'BatchUpload', 'upload', $listed );
42
+	public function __construct($name = '', $restriction = '', $listed = true) {
43
+		parent::__construct('BatchUpload', 'upload', $listed);
44 44
 	}
45 45
 
46 46
 	/**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @param null|string $par
59 59
 	 * @throws \MWException
60 60
 	 */
61
-	public function execute( $par ) {
61
+	public function execute($par) {
62 62
 
63 63
 		$this->setHeaders();
64 64
 		$this->checkPermissions();
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
 		$html = '<span id="fileupload-dropzone" class="fileinput-button">
69 69
         <i class="glyphicon glyphicon-plus"></i>
70
-        <span>' . \Message::newFromKey( 'simplebatchupload-buttonlabel' )->escaped() . '</span>
70
+        <span>' . \Message::newFromKey('simplebatchupload-buttonlabel')->escaped() . '</span>
71 71
         <!-- The file input field used as target for the file upload widget -->
72
-        <input id="fileupload" type="file" name="file" data-url="' . wfScript( 'api' ) . '" data-token="' . $this->getUser()->getEditToken() . '" multiple>
72
+        <input id="fileupload" type="file" name="file" data-url="' . wfScript('api') . '" data-token="' . $this->getUser()->getEditToken() . '" multiple>
73 73
         </span><ul id="fileupload-results"></ul>';
74 74
 
75
-		$output->addHTML( $html );
76
-		$output->addModules( 'ext.SimpleBatchUpload' );
77
-		$output->addModuleStyles( [ 'ext.SimpleBatchUpload', 'ext.SimpleBatchUpload.jquery-file-upload' ] );
75
+		$output->addHTML($html);
76
+		$output->addModules('ext.SimpleBatchUpload');
77
+		$output->addModuleStyles([ 'ext.SimpleBatchUpload', 'ext.SimpleBatchUpload.jquery-file-upload' ]);
78 78
 	}
79 79
 
80 80
 }
Please login to merge, or discard this patch.