Completed
Push — master ( 7301c6...131523 )
by Sam
24:35 queued 17:33
created
src/Menus.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 			WP_Filesystem();
59 59
 		}
60 60
 		require_once ABSPATH . "wp-admin/includes/class-wp-filesystem-direct.php";
61
-		$this->filesystem = new WP_Filesystem_Direct( [] );
61
+		$this->filesystem = new WP_Filesystem_Direct( [ ] );
62 62
 	}
63 63
 
64 64
 	/**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 		// Home page (also change the first submenu item's title).
106 106
 		add_menu_page( 'Tabulate', 'Tabulate', 'read', TABULATE_SLUG, $dispatch_callback );
107
-		$page_title = ( isset( $_GET['table'] ) ) ? Text::titlecase( $_GET['table'] ) : 'Tabulate';
107
+		$page_title = ( isset( $_GET[ 'table' ] ) ) ? Text::titlecase( $_GET[ 'table' ] ) : 'Tabulate';
108 108
 		add_submenu_page( TABULATE_SLUG, $page_title, 'Overview', 'read', TABULATE_SLUG, $dispatch_callback );
109 109
 
110 110
 		// Add submenu pages.
@@ -161,17 +161,17 @@  discard block
 block discarded – undo
161 161
 
162 162
 		// Only dispatch when it's our page.
163 163
 		$slug_lenth = strlen( TABULATE_SLUG );
164
-		if ( ! isset( $request['page'] ) || substr( $request['page'], 0, $slug_lenth ) !== TABULATE_SLUG ) {
164
+		if ( ! isset( $request[ 'page' ] ) || substr( $request[ 'page' ], 0, $slug_lenth ) !== TABULATE_SLUG ) {
165 165
 			return;
166 166
 		}
167 167
 
168 168
 		// Discern the controller name, based on an explicit request parameter, or
169 169
 		// the trailing part of the page slug (i.e. after 'tabulate_').
170 170
 		$controller_name = 'home';
171
-		if ( isset( $request['controller'] ) && strlen( $request['controller'] ) > 0 ) {
172
-			$controller_name = $request['controller'];
173
-		} elseif ( isset( $request['page'] ) && strlen( $request['page'] ) > $slug_lenth ) {
174
-			$controller_name = substr( $request['page'], $slug_lenth + 1 );
171
+		if ( isset( $request[ 'controller' ] ) && strlen( $request[ 'controller' ] ) > 0 ) {
172
+			$controller_name = $request[ 'controller' ];
173
+		} elseif ( isset( $request[ 'page' ] ) && strlen( $request[ 'page' ] ) > $slug_lenth ) {
174
+			$controller_name = substr( $request[ 'page' ], $slug_lenth + 1 );
175 175
 		}
176 176
 
177 177
 		// Create the controller and run the action.
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 		}
182 182
 		$controller = new $controller_classname( $this->wpdb );
183 183
 		$controller->set_filesystem( $this->filesystem );
184
-		$action = ! empty( $request['action'] ) ? $request['action'] : 'index';
185
-		unset( $request['page'], $request['controller'], $request['action'] );
184
+		$action = ! empty( $request[ 'action' ] ) ? $request[ 'action' ] : 'index';
185
+		unset( $request[ 'page' ], $request[ 'controller' ], $request[ 'action' ] );
186 186
 		try {
187 187
 			$this->output = $controller->$action( $request );
188 188
 		} catch ( Exception $e ) {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		$script_url = plugins_url( TABULATE_SLUG ) . '/assets/scripts.js';
230 230
 		$deps = array( 'jquery-ui-autocomplete', 'tabulate-omnivore', 'tabulate-maskedinput', 'tabulate-timepicker' );
231 231
 		if ( Util::is_plugin_active( 'rest-api/plugin.php' ) ) {
232
-			$deps[] = 'wp-api';
232
+			$deps[ ] = 'wp-api';
233 233
 		}
234 234
 		wp_enqueue_script( 'tabulate-scripts', $script_url, $deps, TABULATE_VERSION, true );
235 235
 
Please login to merge, or discard this patch.