Completed
Pull Request — develop (#1620)
by Zack
15:37
created
future/includes/class-gv-settings-view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		if ( ! $detailed ) {
556 556
 			$defaults = array();
557 557
 			foreach ( $default_settings as $key => $value ) {
558
-				$defaults[ $key ] = $value['value'];
558
+				$defaults[ $key ] = $value[ 'value' ];
559 559
 			}
560 560
 			return $defaults;
561 561
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				// If the $group argument is set for the method,
567 567
 				// ignore any settings that aren't in that group.
568 568
 				if ( ! empty( $group ) && is_string( $group ) ) {
569
-					if ( empty( $value['group'] ) || $value['group'] !== $group ) {
569
+					if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) {
570 570
 						unset( $default_settings[ $key ] );
571 571
 					}
572 572
 				}
Please login to merge, or discard this patch.
future/includes/class-gv-plugin.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			return;
305 305
 		}
306 306
 
307
-		$locale = apply_filters( 'plugin_locale', ( ( function_exists('get_user_locale') && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
307
+		$locale = apply_filters( 'plugin_locale', ( ( function_exists( 'get_user_locale' ) && is_admin() ) ? get_user_locale() : get_locale() ), 'gravityview' );
308 308
 
309 309
 		gravityview()->log->error( sprintf( 'Unable to load textdomain for %s locale.', $locale ) );
310 310
 	}
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 	 */
527 527
 	private function get_php_version() {
528 528
 
529
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
530
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
529
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
530
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
531 531
 	}
532 532
 
533 533
 	/**
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 	 */
540 540
 	private function get_wordpress_version() {
541 541
 
542
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
543
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
542
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
543
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
544 544
 	}
545 545
 
546 546
 	/**
@@ -552,14 +552,14 @@  discard block
 block discarded – undo
552 552
 	 */
553 553
 	private function get_gravityforms_version() {
554 554
 
555
-		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
555
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) ) {
556 556
 			gravityview()->log->error( 'Gravity Forms is inactive or not installed.' );
557 557
 
558 558
 			return null;
559 559
 		}
560 560
 
561
-		return ! empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
562
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
561
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
562
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
563 563
 	}
564 564
 
565 565
 	/**
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		$items = get_posts( array(
606 606
 			'post_type'   => 'gravityview',
607 607
 			'post_status' => 'any',
608
-			'numberposts' => - 1,
608
+			'numberposts' => -1,
609 609
 			'fields'      => 'ids',
610 610
 		) );
611 611
 
@@ -619,9 +619,9 @@  discard block
 block discarded – undo
619 619
 		$tables = array();
620 620
 
621 621
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) {
622
-			$tables [] = \GFFormsModel::get_entry_meta_table_name();
622
+			$tables [ ] = \GFFormsModel::get_entry_meta_table_name();
623 623
 		} elseif ( ! $this->is_GF_25() ) {
624
-			$tables [] = \GFFormsModel::get_lead_meta_table_name();
624
+			$tables [ ] = \GFFormsModel::get_lead_meta_table_name();
625 625
 		}
626 626
 
627 627
 		foreach ( $tables as $meta_table ) {
@@ -640,9 +640,9 @@  discard block
 block discarded – undo
640 640
 		$tables = array();
641 641
 
642 642
 		if ( version_compare( \GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) {
643
-			$tables[] = \GFFormsModel::get_entry_notes_table_name();
643
+			$tables[ ] = \GFFormsModel::get_entry_notes_table_name();
644 644
 		} elseif ( ! $this->is_GF_25() ) {
645
-			$tables[] = \GFFormsModel::get_lead_notes_table_name();
645
+			$tables[ ] = \GFFormsModel::get_lead_notes_table_name();
646 646
 		}
647 647
 
648 648
 		$disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' );
Please login to merge, or discard this patch.
includes/extensions/edit-entry/partials/form-buttons.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 <div id="publishing-action">
21 21
 	<?php
22 22
 
23
-    /**
24
-     * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL
25
-     * @since 1.11.1
26
-     * @param string $back_link Existing URL of the Cancel link
27
-     * @param array $form The Gravity Forms form
28
-     * @param array $entry The Gravity Forms entry
29
-     * @param int $view_id The current View ID
30
-     */
31
-    $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id );
23
+	/**
24
+	 * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL
25
+	 * @since 1.11.1
26
+	 * @param string $back_link Existing URL of the Cancel link
27
+	 * @param array $form The Gravity Forms form
28
+	 * @param array $entry The Gravity Forms entry
29
+	 * @param int $view_id The current View ID
30
+	 */
31
+	$back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id );
32 32
 
33 33
 	/**
34 34
 	 * @action `gravityview/edit-entry/publishing-action/before` Triggered before the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container.
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 	 * @used-by GravityView_Delete_Entry::add_delete_button()
75 75
 	 *
76 76
 	 * @since 1.5.1
77
-     * @since 2.0.13 Added $post_id
77
+	 * @since 2.0.13 Added $post_id
78 78
 	 * @param array $form The Gravity Forms form
79 79
 	 * @param array $entry The Gravity Forms entry
80 80
 	 * @param int $view_id The current View ID
81
-     * @param int $post_id The current Post ID
81
+	 * @param int $post_id The current Post ID
82 82
 	 */
83 83
 	do_action( 'gravityview/edit-entry/publishing-action/after', $object->form, $object->entry, $object->view_id, $object->post_id );
84 84
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,30 +43,30 @@  discard block
 block discarded – undo
43 43
 
44 44
 	if ( $object->show_previous_button ) {
45 45
 		$previous_tabindex = GFCommon::get_tabindex();
46
-		$previous_label = GFCommon::replace_variables( $labels['previous'], $object->form, $object->entry );
46
+		$previous_label = GFCommon::replace_variables( $labels[ 'previous' ], $object->form, $object->entry );
47 47
 		?>
48
-		<input id="gform_previous_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
48
+		<input id="gform_previous_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" />
49 49
 		<?php
50 50
 	}
51 51
 
52 52
 	if ( $object->show_next_button ) {
53
-		$next_tabindex    = GFCommon::get_tabindex();
54
-		$next_label = GFCommon::replace_variables( $labels['next'], $object->form, $object->entry );
53
+		$next_tabindex = GFCommon::get_tabindex();
54
+		$next_label = GFCommon::replace_variables( $labels[ 'next' ], $object->form, $object->entry );
55 55
 		?>
56
-		<input id="gform_next_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
56
+		<input id="gform_next_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" />
57 57
 		<?php
58 58
 	}
59 59
 
60 60
 	if ( $object->show_update_button ) {
61
-		$update_tabindex  = GFCommon::get_tabindex();
62
-		$update_label = GFCommon::replace_variables( $labels['submit'], $object->form, $object->entry );
61
+		$update_tabindex = GFCommon::get_tabindex();
62
+		$update_label = GFCommon::replace_variables( $labels[ 'submit' ], $object->form, $object->entry );
63 63
 		?>
64
-		<input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
64
+		<input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" />
65 65
 		<?php
66 66
 	}
67 67
 
68
-	$cancel_tabindex   = GFCommon::get_tabindex();
69
-	$cancel_label = GFCommon::replace_variables( $labels['cancel'], $object->form, $object->entry );
68
+	$cancel_tabindex = GFCommon::get_tabindex();
69
+	$cancel_label = GFCommon::replace_variables( $labels[ 'cancel' ], $object->form, $object->entry );
70 70
 	?>
71 71
 	<a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $cancel_label ); ?></a>
72 72
 	<?php
@@ -87,5 +87,5 @@  discard block
 block discarded – undo
87 87
 
88 88
 	?>
89 89
 	<input type="hidden" name="action" value="update" />
90
-	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" />
90
+	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" />
91 91
 </div>
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			array(
84 84
 				'ajaxurl'  => admin_url( 'admin-ajax.php' ),
85 85
 				'action'   => 'entry_creator_get_users',
86
-				'gf25'    => (bool) gravityview()->plugin->is_GF_25(),
86
+				'gf25'    => (bool)gravityview()->plugin->is_GF_25(),
87 87
 				'language' => array(
88 88
 					'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ),
89 89
 				),
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 			)
108 108
 		);
109 109
 
110
-		if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) {
110
+		if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) {
111 111
 			die();
112 112
 		}
113 113
 
114
-		$search_string = $post_var['q'];
114
+		$search_string = $post_var[ 'q' ];
115 115
 
116 116
 		if ( is_numeric( $search_string ) ) {
117 117
 			$user_args = array(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 
160 160
 		// Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing
161
-		$result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true );
161
+		$result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true );
162 162
 
163 163
 		if ( false === $result ) {
164 164
 			$status = __( 'Error', 'gravityview' );
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			return;
181 181
 		}
182 182
 
183
-		GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' );
183
+		GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' );
184 184
 
185 185
 	}
186 186
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		}
216 216
 
217 217
 		// If screen mode isn't set, then we're in the wrong place.
218
-		if ( empty( $_REQUEST['screen_mode'] ) ) {
218
+		if ( empty( $_REQUEST[ 'screen_mode' ] ) ) {
219 219
 			return;
220 220
 		}
221 221
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 		// If $_GET['screen_mode'] is set to edit, set $_POST value
243 243
 		if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) {
244
-			$_POST["screen_mode"] = 'edit';
244
+			$_POST[ "screen_mode" ] = 'edit';
245 245
 		}
246 246
 
247 247
 	}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
317 317
 
318 318
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
319
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
319
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
320 320
 
321 321
 		$output .= '<option value="0" ' . selected( true, empty( $entry_creator_user_id ), false ) . '> &mdash; ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' &mdash; </option>';
322 322
 
@@ -335,18 +335,18 @@  discard block
 block discarded – undo
335 335
 		}
336 336
 
337 337
 		$user_count      = count_users();
338
-		$user_count      = $user_count['total_users'];
338
+		$user_count      = $user_count[ 'total_users' ];
339 339
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
340 340
 		if ( $user_count > $users_displayed ) {
341 341
 			$remaining_users = $user_count - $users_displayed;
342
-			$user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users );
342
+			$user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users );
343 343
 			$message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' );
344 344
 			$message = sprintf( $message, $remaining_users, $user_users );
345
-			$output  .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
345
+			$output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
346 346
 		}
347 347
 
348 348
 		$output .= '</select>';
349
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
349
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
350 350
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
351 351
 
352 352
 		echo $output;
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 	 * @return array
361 361
 	 */
362 362
 	function register_gform_noconflict( $assets ) {
363
-		$assets[] = 'gravityview_selectwoo';
364
-		$assets[] = 'gravityview_entry_creator';
363
+		$assets[ ] = 'gravityview_selectwoo';
364
+		$assets[ ] = 'gravityview_entry_creator';
365 365
 
366 366
 		return $assets;
367 367
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-survey.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 		foreach ( $field->choices as $choice ) {
49 49
 			if ( is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value[ $input_id ] ) ) {
50
-				return $choice['score'];
50
+				return $choice[ 'score' ];
51 51
 			} else if ( ! is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value ) ) {
52
-				return $choice['score'];
52
+				return $choice[ 'score' ];
53 53
 			}
54 54
 		}
55 55
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
60 60
 
61
-		unset( $field_options['search_filter'] );
61
+		unset( $field_options[ 'search_filter' ] );
62 62
 
63 63
 		if ( 'edit' === $context ) {
64 64
 			return $field_options;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 		$glue = apply_filters( 'gravityview/template/field/survey/glue', '; ' );
74 74
 		$multiple_rows_suffix = sprintf( _x( ' (separated by %s)', 'text added to a label if multiple rows are enabled for the field)', 'gravityview' ), esc_html( trim( $glue ) ) );
75
-		$show_suffix = (bool) $input_id;
75
+		$show_suffix = (bool)$input_id;
76 76
 
77 77
 		if ( 'likert' === $field->field->inputType ) {
78 78
 
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
 				'text' => __( 'Text value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ),
84 84
 			);
85 85
 
86
-			if( $field->field->gsurveyLikertEnableScoring ) {
87
-				$likert_display_options['score'] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
86
+			if ( $field->field->gsurveyLikertEnableScoring ) {
87
+				$likert_display_options[ 'score' ] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
88 88
 			}
89 89
 
90
-			$add_options['choice_display'] = array(
90
+			$add_options[ 'choice_display' ] = array(
91 91
 				'type' => 'radio',
92 92
 				'label' => __( 'What should be displayed:', 'gravityview' ),
93 93
 				'options' => $likert_display_options,
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 			);
100 100
 		}
101 101
 
102
-		if( 'checkbox' === $field->field->inputType && $input_id ) {
103
-			$field_options['choice_display'] = array(
102
+		if ( 'checkbox' === $field->field->inputType && $input_id ) {
103
+			$field_options[ 'choice_display' ] = array(
104 104
 				'type'    => 'radio',
105 105
 				'class'   => 'vertical',
106 106
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		}
117 117
 
118 118
 		if ( 'rating' === $field->field->inputType ) {
119
-			$field_options['choice_display'] = array(
119
+			$field_options[ 'choice_display' ] = array(
120 120
 				'type'    => 'radio',
121 121
 				'class'   => 'vertical',
122 122
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.