Completed
Push — develop ( 217520...0586aa )
by Zack
15:56
created
future/includes/class-gv-plugin.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	/**
85 85
 	 * @var string The REST API functionality identifier.
86 86
 	 */
87
-	const FEATURE_REST  = 'rest_api';
87
+	const FEATURE_REST = 'rest_api';
88 88
 
89 89
 	/**
90 90
 	 * Get the global instance of \GV\Plugin.
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		include_once $this->dir( 'includes/class-frontend-views.php' );
211 211
 		include_once $this->dir( 'includes/class-gravityview-admin-bar.php' );
212 212
 		include_once $this->dir( 'includes/class-gravityview-entry-list.php' );
213
-		include_once $this->dir( 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
213
+		include_once $this->dir( 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
214 214
 		include_once $this->dir( 'includes/class-data.php' );
215 215
 		include_once $this->dir( 'includes/class-gravityview-shortcode.php' );
216 216
 		include_once $this->dir( 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 
245 245
 			$locale = get_locale();
246 246
 
247
-			if ( function_exists('get_user_locale') && is_admin() ) {
247
+			if ( function_exists( 'get_user_locale' ) && is_admin() ) {
248 248
 				$locale = get_user_locale();
249 249
 			}
250 250
 
251 251
 			$locale = apply_filters( 'plugin_locale', $locale, 'gravityview' );
252
-			$mofile = $this->dir( 'languages' ) . '/gravityview-'. $locale .'.mo';
252
+			$mofile = $this->dir( 'languages' ) . '/gravityview-' . $locale . '.mo';
253 253
 			load_textdomain( 'gravityview', $mofile );
254 254
 		}
255 255
 	}
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	public function is_compatible_wordpress( $version = null ) {
384 384
 
385
-		if( ! $version ) {
385
+		if ( ! $version ) {
386 386
 			$version = self::$min_wp_version;
387 387
 		}
388 388
 
@@ -423,8 +423,8 @@  discard block
 block discarded – undo
423 423
 	 * @return string The version of PHP.
424 424
 	 */
425 425
 	private function get_php_version() {
426
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
427
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
426
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
427
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
428 428
 	}
429 429
 
430 430
 	/**
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
 	 * @return string The version of WordPress.
436 436
 	 */
437 437
 	private function get_wordpress_version() {
438
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
439
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
438
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
439
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
440 440
 	}
441 441
 
442 442
 	/**
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
 	 * @return string|null The version of Gravity Forms or null if inactive.
448 448
 	 */
449 449
 	private function get_gravityforms_version() {
450
-		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
450
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) ) {
451 451
 			gravityview()->log->error( 'Gravity Forms is inactive or not installed.' );
452 452
 			return null;
453 453
 		}
454 454
 
455
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
456
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
455
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
456
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
457 457
 	}
458 458
 
459 459
 	/**
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
 		$tables = array();
510 510
 
511 511
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) {
512
-			$tables []= \GFFormsModel::get_entry_meta_table_name();
512
+			$tables [ ] = \GFFormsModel::get_entry_meta_table_name();
513 513
 		}
514
-		$tables []= \GFFormsModel::get_lead_meta_table_name();
514
+		$tables [ ] = \GFFormsModel::get_lead_meta_table_name();
515 515
 
516 516
 		foreach ( $tables as $meta_table ) {
517 517
 			$sql = "
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
 		$tables = array();
530 530
 
531 531
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
532
-			$tables[] = \GFFormsModel::get_entry_notes_table_name();
532
+			$tables[ ] = \GFFormsModel::get_entry_notes_table_name();
533 533
 		}
534 534
 
535
-		$tables[] = \GFFormsModel::get_lead_notes_table_name();
535
+		$tables[ ] = \GFFormsModel::get_lead_notes_table_name();
536 536
 
537
-		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
538
-		$approved = __('Approved the Entry for GravityView', 'gravityview');
537
+		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
538
+		$approved = __( 'Approved the Entry for GravityView', 'gravityview' );
539 539
 
540 540
 		$suppress = $wpdb->suppress_errors();
541 541
 		foreach ( $tables as $notes_table ) {
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		$tab = wp_parse_args( $tab_settings, $tab_defaults );
181 181
 
182 182
 		// Force the screen to be GravityView
183
-		$tab['screen'] = 'gravityview';
183
+		$tab[ 'screen' ] = 'gravityview';
184 184
 
185 185
 		if ( class_exists( 'GravityView_Metabox_Tab' ) ) {
186
-			$metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] );
186
+			$metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] );
187 187
 			\GravityView_Metabox_Tabs::add( $metabox );
188 188
 		} else {
189
-			add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] );
189
+			add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] );
190 190
 		}
191 191
 	}
192 192
 
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
214
-		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible );
214
+		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible );
215 215
 
216 216
 		if ( ! function_exists( 'gravityview' ) ) {
217 217
 			$message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) );
218
-		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) {
219
-			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' );
220
-		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) {
221
-			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' );
218
+		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) {
219
+			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' );
220
+		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) {
221
+			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' );
222 222
 		} else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) {
223 223
 			$message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) );
224 224
 		} else {
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$locale = get_locale();
260 260
 
261
-		if ( function_exists('get_user_locale') && is_admin() ) {
261
+		if ( function_exists( 'get_user_locale' ) && is_admin() ) {
262 262
 			$locale = get_user_locale();
263 263
 		}
264 264
 
265 265
 		// Traditional WordPress plugin locale filter
266
-		$locale = apply_filters( 'plugin_locale',  $locale, $this->_text_domain );
266
+		$locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain );
267 267
 
268 268
 		$mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale );
269 269
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 */
291 291
 	public function settings() {
292 292
 		// If doing ajax, get outta here
293
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )  {
293
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
294 294
 			return;
295 295
 		}
296 296
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		}
302 302
 
303 303
 		// Don't update if invalid license.
304
-		if ( false === $license || empty( $license['status'] ) || strtolower( $license['status'] ) !== 'valid' ) {
304
+		if ( false === $license || empty( $license[ 'status' ] ) || strtolower( $license[ 'status' ] ) !== 'valid' ) {
305 305
 			return;
306 306
 		}
307 307
 
@@ -310,9 +310,9 @@  discard block
 block discarded – undo
310 310
 			$this->_path,
311 311
 			array(
312 312
             	'version'	=> $this->_version, // current version number
313
-            	'license'	=> $license['license'],
313
+            	'license'	=> $license[ 'license' ],
314 314
 	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
315
-            	'item_name' => $this->_title,  // name of this plugin
315
+            	'item_name' => $this->_title, // name of this plugin
316 316
             	'author' 	=> strip_tags( $this->_author )  // author of this plugin
317 317
           	)
318 318
         );
@@ -341,16 +341,16 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	public static function add_notice( $notice = array() ) {
343 343
 
344
-		if ( is_array( $notice ) && empty( $notice['message'] ) ) {
344
+		if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) {
345 345
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
346 346
 			return;
347 347
 		} else if ( is_string( $notice ) ) {
348 348
 			$notice = array( 'message' => $notice );
349 349
 		}
350 350
 
351
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
351
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
352 352
 
353
-		self::$admin_notices []= $notice;
353
+		self::$admin_notices [ ] = $notice;
354 354
 	}
355 355
 
356 356
 	/**
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 		}
365 365
 
366 366
 		foreach ( self::$admin_notices as $key => $notice ) {
367
-			echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">';
368
-			echo wpautop( $notice['message'] );
367
+			echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">';
368
+			echo wpautop( $notice[ 'message' ] );
369 369
 			echo '<div class="clear"></div>';
370 370
 			echo '</div>';
371 371
 		}
Please login to merge, or discard this patch.