Completed
Push — develop ( 0e0535...cdf6c3 )
by Zack
26:37 queued 06:33
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/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/extensions/edit-entry/partials/form-buttons.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,16 +20,16 @@  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
-     * @since 2.11 The cancel link now uses history.back() so the $back_link URL matters less.
27
-     * @param string $back_link Existing URL of the Cancel link
28
-     * @param array $form The Gravity Forms form
29
-     * @param array $entry The Gravity Forms entry
30
-     * @param int $view_id The current View ID
31
-     */
32
-    $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
+	 * @since 2.11 The cancel link now uses history.back() so the $back_link URL matters less.
27
+	 * @param string $back_link Existing URL of the Cancel link
28
+	 * @param array $form The Gravity Forms form
29
+	 * @param array $entry The Gravity Forms entry
30
+	 * @param int $view_id The current View ID
31
+	 */
32
+	$back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id );
33 33
 
34 34
 	/**
35 35
 	 * @action `gravityview/edit-entry/publishing-action/before` Triggered before the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container.
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 	 * @used-by GravityView_Delete_Entry::add_delete_button()
85 85
 	 *
86 86
 	 * @since 1.5.1
87
-     * @since 2.0.13 Added $post_id
87
+	 * @since 2.0.13 Added $post_id
88 88
 	 * @param array $form The Gravity Forms form
89 89
 	 * @param array $entry The Gravity Forms entry
90 90
 	 * @param int $view_id The current View ID
91
-     * @param int $post_id The current Post ID
91
+	 * @param int $post_id The current Post ID
92 92
 	 */
93 93
 	do_action( 'gravityview/edit-entry/publishing-action/after', $object->form, $object->entry, $object->view_id, $object->post_id );
94 94
 	?>
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,35 +44,35 @@  discard block
 block discarded – undo
44 44
 
45 45
 	if ( $object->show_previous_button ) {
46 46
 		$previous_tabindex = GFCommon::get_tabindex();
47
-		$previous_label = GFCommon::replace_variables( $labels['previous'], $object->form, $object->entry );
47
+		$previous_label = GFCommon::replace_variables( $labels[ 'previous' ], $object->form, $object->entry );
48 48
 		?>
49
-		<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
+		<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" />
50 50
 		<?php
51 51
 	}
52 52
 
53 53
 	if ( $object->show_next_button ) {
54
-		$next_tabindex    = GFCommon::get_tabindex();
55
-		$next_label = GFCommon::replace_variables( $labels['next'], $object->form, $object->entry );
54
+		$next_tabindex = GFCommon::get_tabindex();
55
+		$next_label = GFCommon::replace_variables( $labels[ 'next' ], $object->form, $object->entry );
56 56
 		?>
57
-		<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
+		<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" />
58 58
 		<?php
59 59
 	}
60 60
 
61 61
 	if ( $object->show_update_button ) {
62
-		$update_tabindex  = GFCommon::get_tabindex();
63
-		$update_label = GFCommon::replace_variables( $labels['submit'], $object->form, $object->entry );
62
+		$update_tabindex = GFCommon::get_tabindex();
63
+		$update_label = GFCommon::replace_variables( $labels[ 'submit' ], $object->form, $object->entry );
64 64
 		?>
65
-		<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
+		<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" />
66 66
 		<?php
67 67
 	}
68 68
 
69
-	$cancel_tabindex   = GFCommon::get_tabindex();
70
-	$cancel_label = GFCommon::replace_variables( $labels['cancel'], $object->form, $object->entry );
69
+	$cancel_tabindex = GFCommon::get_tabindex();
70
+	$cancel_label = GFCommon::replace_variables( $labels[ 'cancel' ], $object->form, $object->entry );
71 71
 
72 72
 	// If the entry has been edited, history.back() will keep pointing to the Edit Entry screen. Go back before editing, please!
73 73
 	// On first visit, will be history.go(-1) because (0 + 1 * -1).
74 74
 	// After updating twice, history.go(-3) because (2 + 1 * -1)
75
-	$update_count = (int) \GV\Utils::_POST( 'update_count', 0 );
75
+	$update_count = (int)\GV\Utils::_POST( 'update_count', 0 );
76 76
 	$cancel_onclick = 'history.go(' . ( $update_count + 1 ) * -1 . '); return false;';
77 77
 	?>
78 78
 	<a class="btn btn-sm button button-small gv-button-cancel" onclick="<?php echo esc_attr( $cancel_onclick ); ?>" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $cancel_label ); ?></a>
@@ -94,5 +94,5 @@  discard block
 block discarded – undo
94 94
 	?>
95 95
 	<input type='hidden' name='update_count' value='<?php echo $update_count + 1; ?>'/>
96 96
 	<input type="hidden" name="action" value="update" />
97
-	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" />
97
+	<input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" />
98 98
 </div>
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;
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
 				'text' => __( 'Text value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ),
81 81
 			);
82 82
 
83
-			if( $field->field->gsurveyLikertEnableScoring ) {
84
-				$likert_display_options['score'] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
83
+			if ( $field->field->gsurveyLikertEnableScoring ) {
84
+				$likert_display_options[ 'score' ] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix );
85 85
 			}
86 86
 
87 87
 			// Maintain for back-compatibility
88
-			$add_options['score'] = array(
88
+			$add_options[ 'score' ] = array(
89 89
 				'type' => 'hidden',
90 90
 				'value' => '',
91 91
 				'group' => 'display',
92 92
 			);
93 93
 
94
-			$add_options['choice_display'] = array(
94
+			$add_options[ 'choice_display' ] = array(
95 95
 				'type' => 'radio',
96 96
 				'label' => __( 'What should be displayed:', 'gravityview' ),
97 97
 				'options' => $likert_display_options,
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 			);
104 104
 		}
105 105
 
106
-		if( 'checkbox' === $field->field->inputType && $input_id ) {
107
-			$field_options['choice_display'] = array(
106
+		if ( 'checkbox' === $field->field->inputType && $input_id ) {
107
+			$field_options[ 'choice_display' ] = array(
108 108
 				'type'    => 'radio',
109 109
 				'class'   => 'vertical',
110 110
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 
122 122
 		if ( 'rating' === $field->field->inputType ) {
123
-			$field_options['choice_display'] = array(
123
+			$field_options[ 'choice_display' ] = array(
124 124
 				'type'    => 'radio',
125 125
 				'class'   => 'vertical',
126 126
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.