Completed
Push — develop ( 578953...555ad7 )
by Zack
26:20 queued 13:08
created
future/includes/class-gv-request.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function is_add_oembed_preview() {
47 47
 		/** The preview request is a parse-embed AJAX call without a type set. */
48
-		return ( self::is_ajax() && ! empty( $_POST['action'] ) && $_POST['action'] == 'parse-embed' && ! isset( $_POST['type'] ) );
48
+		return ( self::is_ajax() && ! empty( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'parse-embed' && ! isset( $_POST[ 'type' ] ) );
49 49
 	}
50 50
 
51 51
 	/**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return boolean
64 64
 	 */
65 65
 	public static function is_rest() {
66
-		return ! empty( $GLOBALS['wp']->query_vars['rest_route'] );
66
+		return ! empty( $GLOBALS[ 'wp' ]->query_vars[ 'rest_route' ] );
67 67
 	}
68 68
 
69 69
 	/**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 						return false;
126 126
 					}
127 127
 
128
-					if ( ! in_array( $e['form_id'], $valid_forms ) ) {
128
+					if ( ! in_array( $e[ 'form_id' ], $valid_forms ) ) {
129 129
 						return false;
130 130
 					}
131 131
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				}
142 142
 
143 143
 				$entry = Multi_Entry::from_entries( array_filter( $multientry ) );
144
-			}  else {
144
+			} else {
145 145
 				/**
146 146
 				 * A regular one.
147 147
 				 */
@@ -196,15 +196,15 @@  discard block
 block discarded – undo
196 196
 			$get = $_GET;
197 197
 		}
198 198
 
199
-		unset( $get['mode'] );
199
+		unset( $get[ 'mode' ] );
200 200
 
201 201
 		$get = array_filter( $get, 'gravityview_is_not_empty_string' );
202 202
 
203
-		if( $has_field_key = $this->_has_field_key( $get ) ) {
203
+		if ( $has_field_key = $this->_has_field_key( $get ) ) {
204 204
 			return true;
205 205
 		}
206 206
 
207
-		return isset( $get['gv_search'] ) || isset( $get['gv_start'] ) || isset( $get['gv_end'] ) || isset( $get['gv_by'] ) || isset( $get['gv_id'] );
207
+		return isset( $get[ 'gv_search' ] ) || isset( $get[ 'gv_start' ] ) || isset( $get[ 'gv_end' ] ) || isset( $get[ 'gv_by' ] ) || isset( $get[ 'gv_id' ] );
208 208
 	}
209 209
 
210 210
 	/**
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
 
228 228
 		$meta = array();
229 229
 		foreach ( $fields as $field ) {
230
-			if( empty( $field->_gf_field_class_name ) ) {
231
-				$meta[] = preg_quote( $field->name );
230
+			if ( empty( $field->_gf_field_class_name ) ) {
231
+				$meta[ ] = preg_quote( $field->name );
232 232
 			}
233 233
 		}
234 234
 
235 235
 		foreach ( $get as $key => $value ) {
236
-			if ( preg_match('/^filter_(([0-9_]+)|'. implode( '|', $meta ) .')$/sm', $key ) ) {
236
+			if ( preg_match( '/^filter_(([0-9_]+)|' . implode( '|', $meta ) . ')$/sm', $key ) ) {
237 237
 				$has_field_key = true;
238 238
 				break;
239 239
 			}
Please login to merge, or discard this patch.
future/includes/class-gv-template-entry-list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return string
27 27
 	 */
28 28
 	public function the_field( \GV\Field $field, $extras = null ) {
29
-		$form = \GV\GF_Form::by_id( $field->form_id ) ? : $this->view->form;
29
+		$form = \GV\GF_Form::by_id( $field->form_id ) ?: $this->view->form;
30 30
 		$entry = $this->entry->from_field( $field );
31 31
 
32 32
 		if ( ! $entry ) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		}
35 35
 
36 36
 		$renderer = new Field_Renderer();
37
-		$source = is_numeric( $field->ID ) ? ( GF_Form::by_id( $field->form_id ) ? : $this->view->form ) : new Internal_Source();
37
+		$source = is_numeric( $field->ID ) ? ( GF_Form::by_id( $field->form_id ) ?: $this->view->form ) : new Internal_Source();
38 38
 		
39 39
 		$value = $renderer->render( $field, $this->view, $source, $entry, $this->request );
40 40
 		
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context );
63 63
 
64 64
 		if ( is_numeric( $field->ID ) ) {
65
-			$extras['field'] = $field->as_configuration();
65
+			$extras[ 'field' ] = $field->as_configuration();
66 66
 		}
67 67
 
68
-		$extras['entry'] = $this->entry->as_entry();
69
-		$extras['hide_empty'] = $hide_empty;
70
-		$extras['label'] = $label;
71
-		$extras['value'] = $value;
68
+		$extras[ 'entry' ] = $this->entry->as_entry();
69
+		$extras[ 'hide_empty' ] = $hide_empty;
70
+		$extras[ 'label' ] = $label;
71
+		$extras[ 'value' ] = $value;
72 72
 
73 73
 		return \gravityview_field_output( $extras, $context );
74 74
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-template-view-list.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	public function the_field( \GV\Field $field, \GV\Entry $entry, $extras = null ) {
30 30
 		$form = $this->view->form;
31 31
 
32
-		if ( isset( $this->view->unions[ $entry['form_id'] ] ) ) {
33
-			if ( isset( $this->view->unions[ $entry['form_id'] ][ $field->ID ] ) ) {
34
-				$field = $this->view->unions[ $entry['form_id'] ][ $field->ID ];
32
+		if ( isset( $this->view->unions[ $entry[ 'form_id' ] ] ) ) {
33
+			if ( isset( $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ] ) ) {
34
+				$field = $this->view->unions[ $entry[ 'form_id' ] ][ $field->ID ];
35 35
 			} elseif ( ! $field instanceof Internal_Field ) {
36 36
 				$field = Internal_Field::from_configuration( array( 'id' => 'custom' ) );
37 37
 			}
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 		$hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context );
82 82
 
83 83
 		if ( is_numeric( $field->ID ) ) {
84
-			$extras['field'] = $field->as_configuration();
84
+			$extras[ 'field' ] = $field->as_configuration();
85 85
 		}
86 86
 
87
-		$extras['entry'] = $entry->as_entry();
88
-		$extras['hide_empty'] = $hide_empty;
89
-		$extras['label'] = $label;
90
-		$extras['value'] = $value;
87
+		$extras[ 'entry' ] = $entry->as_entry();
88
+		$extras[ 'hide_empty' ] = $hide_empty;
89
+		$extras[ 'label' ] = $label;
90
+		$extras[ 'value' ] = $value;
91 91
 
92 92
 		return \gravityview_field_output( $extras, $context );
93 93
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-plugin.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	/**
90 90
 	 * @var string The REST API functionality identifier.
91 91
 	 */
92
-	const FEATURE_REST  = 'rest_api';
92
+	const FEATURE_REST = 'rest_api';
93 93
 
94 94
 	/**
95 95
 	 * Get the global instance of \GV\Plugin.
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		include_once $this->dir( 'includes/class-frontend-views.php' );
216 216
 		include_once $this->dir( 'includes/class-gravityview-admin-bar.php' );
217 217
 		include_once $this->dir( 'includes/class-gravityview-entry-list.php' );
218
-		include_once $this->dir( 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
218
+		include_once $this->dir( 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
219 219
 		include_once $this->dir( 'includes/class-data.php' );
220 220
 		include_once $this->dir( 'includes/class-gravityview-shortcode.php' );
221 221
 		include_once $this->dir( 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 
270 270
 		// Pre-4.6 loading
271 271
 		// TODO: Remove when GV minimum version is WordPress 4.6.0
272
-		$locale = apply_filters( 'plugin_locale', ( ( function_exists('get_user_locale') && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
272
+		$locale = apply_filters( 'plugin_locale', ( ( function_exists( 'get_user_locale' ) && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
273 273
 
274
-		$loaded = load_textdomain( 'gravityview', sprintf( '%s/%s-%s.mo', $this->dir('languages'), $domain, $locale ) );
274
+		$loaded = load_textdomain( 'gravityview', sprintf( '%s/%s-%s.mo', $this->dir( 'languages' ), $domain, $locale ) );
275 275
 
276
-		if( $loaded ) {
276
+		if ( $loaded ) {
277 277
 			return;
278 278
 		}
279 279
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	public function is_compatible_wordpress( $version = null ) {
426 426
 
427
-		if( ! $version ) {
427
+		if ( ! $version ) {
428 428
 			$version = self::$min_wp_version;
429 429
 		}
430 430
 
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 	 * @return string The version of PHP.
466 466
 	 */
467 467
 	private function get_php_version() {
468
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
469
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
468
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
469
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
470 470
 	}
471 471
 
472 472
 	/**
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 	 * @return string The version of WordPress.
478 478
 	 */
479 479
 	private function get_wordpress_version() {
480
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
481
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
480
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
481
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
482 482
 	}
483 483
 
484 484
 	/**
@@ -489,13 +489,13 @@  discard block
 block discarded – undo
489 489
 	 * @return string|null The version of Gravity Forms or null if inactive.
490 490
 	 */
491 491
 	private function get_gravityforms_version() {
492
-		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
492
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) ) {
493 493
 			gravityview()->log->error( 'Gravity Forms is inactive or not installed.' );
494 494
 			return null;
495 495
 		}
496 496
 
497
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
498
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
497
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
498
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
499 499
 	}
500 500
 
501 501
 	/**
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 		$tables = array();
553 553
 
554 554
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) {
555
-			$tables []= \GFFormsModel::get_entry_meta_table_name();
555
+			$tables [ ] = \GFFormsModel::get_entry_meta_table_name();
556 556
 		}
557
-		$tables []= \GFFormsModel::get_lead_meta_table_name();
557
+		$tables [ ] = \GFFormsModel::get_lead_meta_table_name();
558 558
 
559 559
 		foreach ( $tables as $meta_table ) {
560 560
 			$sql = "
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 		$tables = array();
573 573
 
574 574
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
575
-			$tables[] = \GFFormsModel::get_entry_notes_table_name();
575
+			$tables[ ] = \GFFormsModel::get_entry_notes_table_name();
576 576
 		}
577 577
 
578
-		$tables[] = \GFFormsModel::get_lead_notes_table_name();
578
+		$tables[ ] = \GFFormsModel::get_lead_notes_table_name();
579 579
 
580
-		$disapproved = __('Disapproved the Entry for GravityView', 'gravityview');
581
-		$approved = __('Approved the Entry for GravityView', 'gravityview');
580
+		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
581
+		$approved = __( 'Approved the Entry for GravityView', 'gravityview' );
582 582
 
583 583
 		$suppress = $wpdb->suppress_errors();
584 584
 		foreach ( $tables as $notes_table ) {
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-views-route.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			'total' => wp_count_posts( 'gravityview' )->publish,
64 64
 		);
65 65
 		foreach ( $items as $item ) {
66
-			$data['views'][] = $this->prepare_view_for_response( $item, $request );
66
+			$data[ 'views' ][ ] = $this->prepare_view_for_response( $item, $request );
67 67
 		}
68 68
 
69 69
 		return new \WP_REST_Response( $data, 200 );
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 		$url = $request->get_url_params();
84 84
 
85
-		$view_id = intval( $url['id'] );
85
+		$view_id = intval( $url[ 'id' ] );
86 86
 
87 87
 		$item = get_post( $view_id );
88 88
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		// Only output the fields that should be displayed.
115 115
 		$allowed = array();
116 116
 		foreach ( $view->fields->by_position( "{$context}_*" )->by_visible()->all() as $field ) {
117
-			$allowed[] = $field;
117
+			$allowed[ ] = $field;
118 118
 		}
119 119
 
120 120
 		/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
 		// Tack on additional fields if needed
135 135
 		foreach ( array_diff( $allowed_field_ids, wp_list_pluck( $allowed, 'ID' ) ) as $field_id ) {
136
-			$allowed[] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
136
+			$allowed[ ] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
137 137
 		}
138 138
 
139 139
 		$r = new Request( $request );
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 	public function get_sub_items( $request ) {
202 202
 
203 203
 		$url     = $request->get_url_params();
204
-		$view_id = intval( $url['id'] );
204
+		$view_id = intval( $url[ 'id' ] );
205 205
 		$format  = \GV\Utils::get( $url, 'format', 'json' );
206 206
 
207
-		if( $post_id = $request->get_param('post_id') ) {
207
+		if ( $post_id = $request->get_param( 'post_id' ) ) {
208 208
 			global $post;
209 209
 
210 210
 			$post = get_post( $post_id );
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
 		$data = array( 'entries' => $entries->all(), 'total' => $entries->total() );
304 304
 
305
-		foreach ( $data['entries'] as &$entry ) {
305
+		foreach ( $data[ 'entries' ] as &$entry ) {
306 306
 			$entry = $this->prepare_entry_for_response( $view, $entry, $request, 'directory' );
307 307
 		}
308 308
 
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
 	 */
322 322
 	public function get_sub_item( $request ) {
323 323
 		$url      = $request->get_url_params();
324
-		$view_id  = intval( $url['id'] );
325
-		$entry_id = intval( $url['s_id'] );
324
+		$view_id  = intval( $url[ 'id' ] );
325
+		$entry_id = intval( $url[ 's_id' ] );
326 326
 		$format   = \GV\Utils::get( $url, 'format', 'json' );
327 327
 
328 328
 		$view  = \GV\View::by_id( $view_id );
@@ -357,32 +357,32 @@  discard block
 block discarded – undo
357 357
 		// Add all the WP_Post data
358 358
 		$view_post = $view_post->to_array();
359 359
 
360
-		unset( $view_post['to_ping'], $view_post['ping_status'], $view_post['pinged'], $view_post['post_type'], $view_post['filter'], $view_post['post_category'], $view_post['tags_input'], $view_post['post_content'], $view_post['post_content_filtered'] );
360
+		unset( $view_post[ 'to_ping' ], $view_post[ 'ping_status' ], $view_post[ 'pinged' ], $view_post[ 'post_type' ], $view_post[ 'filter' ], $view_post[ 'post_category' ], $view_post[ 'tags_input' ], $view_post[ 'post_content' ], $view_post[ 'post_content_filtered' ] );
361 361
 
362 362
 		$return = wp_parse_args( $item, $view_post );
363 363
 
364
-		$return['title'] = $return['post_title'];
364
+		$return[ 'title' ] = $return[ 'post_title' ];
365 365
 
366
-		$return['settings'] = isset( $return['atts'] ) ? $return['atts'] : array();
367
-		unset( $return['atts'], $return['view_id'] );
366
+		$return[ 'settings' ] = isset( $return[ 'atts' ] ) ? $return[ 'atts' ] : array();
367
+		unset( $return[ 'atts' ], $return[ 'view_id' ] );
368 368
 
369
-		$return['search_criteria'] = array(
369
+		$return[ 'search_criteria' ] = array(
370 370
 			'page_size' => rgars( $return, 'settings/page_size' ),
371 371
 			'sort_field' => rgars( $return, 'settings/sort_field' ),
372 372
 			'sort_direction' => rgars( $return, 'settings/sort_direction' ),
373 373
 			'offset' => rgars( $return, 'settings/offset' ),
374 374
 		);
375 375
 
376
-		unset( $return['settings']['page_size'], $return['settings']['sort_field'], $return['settings']['sort_direction'] );
376
+		unset( $return[ 'settings' ][ 'page_size' ], $return[ 'settings' ][ 'sort_field' ], $return[ 'settings' ][ 'sort_direction' ] );
377 377
 
378 378
 		// Redact for non-logged ins
379 379
 		if ( ! \GVCommon::has_cap( 'edit_others_gravityviews' ) ) {
380
-			unset( $return['settings'] );
381
-			unset( $return['search_criteria'] );
380
+			unset( $return[ 'settings' ] );
381
+			unset( $return[ 'search_criteria' ] );
382 382
 		}
383 383
 		
384 384
 		if ( ! \GFCommon::current_user_can_any( 'gravityforms_edit_forms' ) ) {
385
-			unset( $return['form'] );
385
+			unset( $return[ 'form' ] );
386 386
 		}
387 387
 
388 388
 		return $return;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			$view_id = func_get_arg( 1 ); // $view_id override
399 399
 		} else {
400 400
 			$url     = $request->get_url_params();
401
-			$view_id = intval( $url['id'] );
401
+			$view_id = intval( $url[ 'id' ] );
402 402
 		}
403 403
 
404 404
 		if ( ! $view = \GV\View::by_id( $view_id ) ) {
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 		}
445 445
 
446 446
 		$url     = $request->get_url_params();
447
-		$view_id = intval( $url['id'] );
448
-		$entry_id = intval( $url['s_id'] );
447
+		$view_id = intval( $url[ 'id' ] );
448
+		$entry_id = intval( $url[ 's_id' ] );
449 449
 
450 450
 		$view = \GV\View::by_id( $view_id );
451 451
 
@@ -453,11 +453,11 @@  discard block
 block discarded – undo
453 453
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
454 454
 		}
455 455
 
456
-		if ( $entry['form_id'] != $view->form->ID ) {
456
+		if ( $entry[ 'form_id' ] != $view->form->ID ) {
457 457
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
458 458
 		}
459 459
 
460
-		if ( $entry['status'] != 'active' ) {
460
+		if ( $entry[ 'status' ] != 'active' ) {
461 461
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
462 462
 		}
463 463
 
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
 			return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
466 466
 		}
467 467
 
468
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
468
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
469 469
 
470 470
 		if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
471
-			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
471
+			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
472 472
 				return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' );
473 473
 			}
474 474
 		}
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-select.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
 $search_field = $gravityview_view->search_field;
11 11
 
12 12
 // Make sure that there are choices to display
13
-if( empty( $search_field['choices'] ) ) {
13
+if ( empty( $search_field[ 'choices' ] ) ) {
14 14
 	gravityview()->log->debug( 'search-field-select.php - No choices for field' );
15 15
 	return;
16 16
 }
17 17
 
18
-if( is_array( $search_field['value'] ) ) {
18
+if ( is_array( $search_field[ 'value' ] ) ) {
19 19
     gravityview()->log->debug( 'search-field-select.php - Array values passed; using first value.' );
20
-	$search_field['value'] = reset( $search_field['value'] );
20
+	$search_field[ 'value' ] = reset( $search_field[ 'value' ] );
21 21
 }
22 22
 
23 23
 /**
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
  * @param string $default_option Default: `—` (—)
27 27
  * @param string $field_type Field type: "select" or "multiselect"
28 28
  */
29
-$default_option = apply_filters('gravityview/extension/search/select_default', '—', 'select' );
29
+$default_option = apply_filters( 'gravityview/extension/search/select_default', '—', 'select' );
30 30
 
31 31
 ?>
32 32
 <div class="gv-search-box gv-search-field-select">
33
-	<?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?>
34
-		<label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label>
33
+	<?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?>
34
+		<label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label>
35 35
 	<?php } ?>
36 36
 	<p>
37
-		<select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>">
38
-			<option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option>
37
+		<select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>">
38
+			<option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option>
39 39
 			<?php
40
-			foreach( $search_field['choices'] as $choice ) { ?>
41
-				<?php if ( is_array( $choice['value'] ) ) { ?>
42
-					<optgroup label="<?php echo esc_attr( $choice['text'] ); ?>">
43
-						<?php foreach ( $choice['value'] as $subchoice ): ?>
44
-							<option value="<?php echo esc_attr( $subchoice['value'] ); ?>"><?php echo esc_html( $subchoice['text'] ); ?></option>
40
+			foreach ( $search_field[ 'choices' ] as $choice ) { ?>
41
+				<?php if ( is_array( $choice[ 'value' ] ) ) { ?>
42
+					<optgroup label="<?php echo esc_attr( $choice[ 'text' ] ); ?>">
43
+						<?php foreach ( $choice[ 'value' ] as $subchoice ): ?>
44
+							<option value="<?php echo esc_attr( $subchoice[ 'value' ] ); ?>"><?php echo esc_html( $subchoice[ 'text' ] ); ?></option>
45 45
 						<?php endforeach; ?>
46 46
 					</optgroup>
47 47
 				<?php } else { ?>
48
-					<option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $search_field['value'] ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option>
48
+					<option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $search_field[ 'value' ] ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option>
49 49
 				<?php } ?>
50 50
 			<?php } ?>
51 51
 		</select>
Please login to merge, or discard this patch.
includes/admin/class-gravityview-support-port.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 		) );
115 115
 
116 116
 		// This is just HTML we don't need.
117
-		unset( $response['message'] );
117
+		unset( $response[ 'message' ] );
118 118
 
119
-		switch ( intval( $response['price_id'] ) ) {
119
+		switch ( intval( $response[ 'price_id' ] ) ) {
120 120
 			default:
121 121
 			case 1:
122 122
 				$package = 'Core';
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 			'email'                 => $current_user->user_email,
143 143
 			'name'                  => mb_substr( $current_user->display_name, 0, 80 ),
144 144
 			'signature'             => hash_hmac( 'sha256', $current_user->user_email, self::beacon_key ),
145
-			'License Key'           => $response['license_key'] . ' (' . ucwords( $response['license'] ) . ')',
145
+			'License Key'           => $response[ 'license_key' ] . ' (' . ucwords( $response[ 'license' ] ) . ')',
146 146
 			'License Level'         => $package,
147 147
 			'Alt Emails'            => sprintf( "Admin: %s, GV Support: %s", get_bloginfo( 'admin_email' ), gravityview()->plugin->settings->get( 'support-email' ) ),
148
-			'Payment Details'       => $response['customer_name'] . ' ' . $response['customer_email'],
148
+			'Payment Details'       => $response[ 'customer_name' ] . ' ' . $response[ 'customer_email' ],
149 149
 			'WordPress Version'     => get_bloginfo( 'version', 'display' ),
150
-			'PHP Version'           => phpversion() . ' on ' . esc_html( $_SERVER['SERVER_SOFTWARE'] ),
150
+			'PHP Version'           => phpversion() . ' on ' . esc_html( $_SERVER[ 'SERVER_SOFTWARE' ] ),
151 151
 			'No-Conflict Mode'      => empty( $no_conflict_mode ) ? 'Disabled' : 'Enabled',
152 152
 			'GravityView Version'   => \GV\Plugin::$version,
153 153
 			'Gravity Forms Version' => GFForms::$version,
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		ob_get_clean();
158 158
 
159 159
 		// Help Scout length limit is 200 characters
160
-		foreach( $data as $key => $value ) {
160
+		foreach ( $data as $key => $value ) {
161 161
 			if ( ! is_string( $value ) ) {
162 162
                 continue;
163 163
 			}
Please login to merge, or discard this patch.
future/includes/class-gv-shortcode-gravityview.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 			'detail' => null,
42 42
 		) );
43 43
 		
44
-		if ( ! $view_id = $atts['id'] ? : $atts['view_id'] ) {
45
-			if ( $atts['detail'] && $view = $request->is_view() ) {
44
+		if ( ! $view_id = $atts[ 'id' ] ?: $atts[ 'view_id' ] ) {
45
+			if ( $atts[ 'detail' ] && $view = $request->is_view() ) {
46 46
 				$view_id = $view->ID;
47 47
 			}
48 48
 		}
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 			}
112 112
 		}
113 113
 
114
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
114
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
115 115
 
116 116
 		/**
117 117
 		 * View details.
118 118
 		 */
119
-		if ( $atts['detail'] ) {
119
+		if ( $atts[ 'detail' ] ) {
120 120
 			$entries = $view->get_entries( $request );
121 121
 			return self::_return( $this->detail( $view, $entries, $atts ) );
122 122
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 				return self::_return( '' );
134 134
 			}
135 135
 
136
-			if ( $entry['status'] != 'active' ) {
136
+			if ( $entry[ 'status' ] != 'active' ) {
137 137
 				gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
138 138
 				return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
139 139
 			}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			}
145 145
 
146 146
 			if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
147
-				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
147
+				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
148 148
 					gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
149 149
 					return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
150 150
 				}
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 			$entryset = $entry->is_multi() ? $entry->entries : array( $entry );
168 168
 
169 169
 			foreach ( $entryset as $e ) {
170
-				if ( $e['status'] != 'active' ) {
170
+				if ( $e[ 'status' ] != 'active' ) {
171 171
 					gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) );
172 172
 					return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
173 173
 				}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				}
179 179
 
180 180
 				if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
181
-					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
181
+					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
182 182
 						gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) );
183 183
 						return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
184 184
 					}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 				
204 204
 				// Mock the request with the actual View, not the global one
205 205
 				$mock_request = new \GV\Mock_Request();
206
-				$mock_request->returns['is_view'] = $view;
207
-				$mock_request->returns['is_entry'] = $request->is_entry( $view->form ? $view->form->ID : 0 );
208
-				$mock_request->returns['is_edit_entry'] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
209
-				$mock_request->returns['is_search'] = $request->is_search();
206
+				$mock_request->returns[ 'is_view' ] = $view;
207
+				$mock_request->returns[ 'is_entry' ] = $request->is_entry( $view->form ? $view->form->ID : 0 );
208
+				$mock_request->returns[ 'is_edit_entry' ] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
209
+				$mock_request->returns[ 'is_search' ] = $request->is_search();
210 210
 
211 211
 				$request = $mock_request;
212 212
 			}
@@ -242,16 +242,16 @@  discard block
 block discarded – undo
242 242
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
243 243
 
244 244
 		// Only keep the passed attributes after making sure that they're valid pairs
245
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
245
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
246 246
 
247 247
 		$atts = array();
248 248
 
249
-		foreach( $filtered_atts as $key => $passed_value ) {
249
+		foreach ( $filtered_atts as $key => $passed_value ) {
250 250
 
251 251
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
252 252
 			$passed_value = \GravityView_Merge_Tags::replace_variables( $passed_value );
253 253
 
254
-			switch( $defaults[ $key ]['type'] ) {
254
+			switch ( $defaults[ $key ][ 'type' ] ) {
255 255
 
256 256
 				/**
257 257
 				 * Make sure number fields are numeric.
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
260 260
 				 */
261 261
 				case 'number':
262
-					if( is_numeric( $passed_value ) ) {
262
+					if ( is_numeric( $passed_value ) ) {
263 263
 						$atts[ $key ] = ( $passed_value + 0 );
264 264
 					}
265 265
 					break;
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 				 */
275 275
 				case 'select':
276 276
 				case 'radio':
277
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
278
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
277
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
278
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
279 279
 						$atts[ $key ] = $passed_value;
280 280
 					}
281 281
 					break;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			}
288 288
 		}
289 289
 
290
-		$atts['detail'] = \GV\Utils::get( $passed_atts, 'detail', null );
290
+		$atts[ 'detail' ] = \GV\Utils::get( $passed_atts, 'detail', null );
291 291
 
292 292
 		return $atts;
293 293
 	}
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	private function detail( $view, $entries, $atts ) {
305 305
 		$output = '';
306 306
 
307
-		switch ( $key = $atts['detail'] ):
307
+		switch ( $key = $atts[ 'detail' ] ):
308 308
 			case 'total_entries':
309 309
 				$output = number_format_i18n( $entries->total() );
310 310
 				break;
Please login to merge, or discard this patch.
future/includes/class-gv-template-legacy-override.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 		$additional = array();
99 99
 
100 100
 		// form-19-table-body.php
101
-		$additional[] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name );
101
+		$additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name );
102 102
 
103 103
 		// view-3-table-body.php
104
-		$additional[] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name );
104
+		$additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name );
105 105
 
106 106
 		global $post;
107 107
 		if ( $post ) {
108 108
 			// page-19-table-body.php
109
-			$additional[] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name );
109
+			$additional[ ] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name );
110 110
 		}
111 111
 
112 112
 		// Combine with existing table-body.php and table.php
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		ob_start();
131 131
 
132 132
 		$request = new Mock_Request();
133
-		$request->returns['is_view'] = $this->view;
133
+		$request->returns[ 'is_view' ] = $this->view;
134 134
 
135 135
 		/**
136 136
 		 * You got one shot. One opportunity. To render all the widgets you have ever wanted.
@@ -144,17 +144,17 @@  discard block
 block discarded – undo
144 144
 		foreach ( array( 'gravityview_before', 'gravityview_after' ) as $hook ) {
145 145
 			/** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */
146 146
 			if ( is_array( $wp_filter[ $hook ] ) ) {
147
-				if ( ! empty( $wp_filter[ $hook ][10] ) ) {
148
-					foreach ( $wp_filter[ $hook ][10] as $function_key => $callback ) {
147
+				if ( ! empty( $wp_filter[ $hook ][ 10 ] ) ) {
148
+					foreach ( $wp_filter[ $hook ][ 10 ] as $function_key => $callback ) {
149 149
 						if ( strpos( $function_key, 'render_widget_hooks' ) ) {
150
-							unset( $wp_filter[ $hook ][10][ $function_key ] );
150
+							unset( $wp_filter[ $hook ][ 10 ][ $function_key ] );
151 151
 						}
152 152
 					}
153 153
 				}
154 154
 			} else {
155
-				foreach ( $wp_filter[ $hook ]->callbacks[10] as $function_key => $callback ) {
155
+				foreach ( $wp_filter[ $hook ]->callbacks[ 10 ] as $function_key => $callback ) {
156 156
 					if ( strpos( $function_key, 'render_widget_hooks' ) ) {
157
-						unset( $wp_filter[ $hook ]->callbacks[10][ $function_key ] );
157
+						unset( $wp_filter[ $hook ]->callbacks[ 10 ][ $function_key ] );
158 158
 					}
159 159
 				}
160 160
 			}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		 */
166 166
 		if ( $this->entry ) {
167 167
 
168
-			$request->returns['is_entry'] = $this->entry;
168
+			$request->returns[ 'is_entry' ] = $this->entry;
169 169
 
170 170
 			global $post;
171 171
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 			 * This allows us to fake it till we make it.
200 200
 			 */
201 201
 			$parameters = $this->view->settings->as_atts();
202
-			if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) {
202
+			if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) {
203 203
 				$has_multisort = true;
204
-				$parameters['sort_field'] = reset( $parameters['sort_field'] );
205
-				if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) {
206
-					$parameters['sort_direction'] = reset( $parameters['sort_direction'] );
204
+				$parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] );
205
+				if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) {
206
+					$parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] );
207 207
 				}
208 208
 			}
209 209
 
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 					'fields' => $this->view->fields->by_visible(),
223 223
 					'in_the_loop' => true,
224 224
 				), empty( $parameters ) ? array() : array(
225
-					'paging' => $parameters['paging'],
226
-					'sorting' => $parameters['sorting'],
225
+					'paging' => $parameters[ 'paging' ],
226
+					'sorting' => $parameters[ 'sorting' ],
227 227
 				), $post ? array(
228 228
 					'post' => $post,
229 229
 				) : array() ) );
Please login to merge, or discard this patch.