Completed
Push — develop ( 24c9de...c5d946 )
by Zack
16:00
created
class-gravityview-plugin-hooks-gravity-forms-coupon.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		 */
54 54
 		$hide_coupon_fields = apply_filters( 'gravityview/edit_entry/hide-coupon-fields', $has_transaction_data );
55 55
 
56
-		return (bool) $hide_coupon_fields;
56
+		return (bool)$hide_coupon_fields;
57 57
 	}
58 58
 
59 59
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	public function edit_entry_field_blocklist( $blocklist = array(), $entry = array() ) {
79 79
 
80 80
 		if ( $this->should_hide_coupon_fields( $entry ) ) {
81
-			$blocklist[] = 'coupon';
81
+			$blocklist[ ] = 'coupon';
82 82
 		}
83 83
 
84 84
 		return $blocklist;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		// No coupons match the codes provided
117 117
 		$discounts = gf_coupons()->get_coupons_by_codes( $coupon_codes, $form );
118 118
 
119
-		if( ! $discounts ) {
119
+		if ( ! $discounts ) {
120 120
 			return $value;
121 121
 		}
122 122
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		 * @see GF_Field_Coupon::get_field_input
126 126
 		 */
127 127
 		$_POST = ! isset( $_POST ) ? array() : $_POST;
128
-		$_POST[ 'gf_coupons_' . $form['id'] ] = json_encode( (array) $discounts );
128
+		$_POST[ 'gf_coupons_' . $form[ 'id' ] ] = json_encode( (array)$discounts );
129 129
 		$_POST[ 'input_' . $field->id ] = implode( ',', $coupon_codes );
130 130
 
131 131
 		return $value;
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-elegant-themes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 		}
80 80
 
81 81
 		$sidebars_widgets = wp_get_sidebars_widgets();
82
-		if ( empty( $sidebars_widgets[ $matches[1] ] ) ) {
82
+		if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) {
83 83
 			return $shortcodes;
84 84
 		}
85 85
 
86
-		foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) {
86
+		foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) {
87 87
 			if (
88 88
 				/**
89 89
 				 * Blocklisted widgets.
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				strpos( $widgets, 'gv_recent_entries' ) === 0
93 93
 			) {
94 94
 
95
-					$shortcodes []= 'et_pb_sidebar';
95
+					$shortcodes [ ] = 'et_pb_sidebar';
96 96
 					break;
97 97
 			}
98 98
 		}
Please login to merge, or discard this patch.
includes/class-cache.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
 		 * @see RGFormsModel::update_lead_property() Trigger when any entry property changes
86 86
 		 */
87
-		foreach( $this->lead_db_columns as $column ) {
87
+		foreach ( $this->lead_db_columns as $column ) {
88 88
 			add_action( 'gform_update_' . $column, array( $this, 'entry_status_changed' ), 10, 3 );
89 89
 		}
90 90
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 			return;
116 116
 		}
117 117
 
118
-		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{lead_id} was deleted', array( 'form_id' => $entry['form_id'], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) );
118
+		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{lead_id} was deleted', array( 'form_id' => $entry[ 'form_id' ], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) );
119 119
 
120
-		$this->blocklist_add( $entry['form_id'] );
120
+		$this->blocklist_add( $entry[ 'form_id' ] );
121 121
 	}
122 122
 
123 123
 	/**
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function entry_updated( $form, $lead_id ) {
132 132
 
133
-		gravityview()->log->debug(' adding form {form_id} to blocklist because entry #{entry_id} was updated', array( 'form_id' => $form['id'], 'entry_id' => $lead_id ) );
133
+		gravityview()->log->debug( ' adding form {form_id} to blocklist because entry #{entry_id} was updated', array( 'form_id' => $form[ 'id' ], 'entry_id' => $lead_id ) );
134 134
 
135
-		$this->blocklist_add( $form['id'] );
135
+		$this->blocklist_add( $form[ 'id' ] );
136 136
 	}
137 137
 
138 138
 	/**
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function entry_created( $entry, $form ) {
149 149
 
150
-		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was created', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) );
150
+		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was created', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) );
151 151
 
152
-		$this->blocklist_add( $form['id'] );
152
+		$this->blocklist_add( $form[ 'id' ] );
153 153
 	}
154 154
 
155 155
 	/**
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 			return;
166 166
 		}
167 167
 
168
-		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was added', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) );
168
+		gravityview()->log->debug( 'adding form {form_id} to blocklist because entry #{entry_id} was added', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) );
169 169
 
170
-		$this->blocklist_add( $form['id'] );
170
+		$this->blocklist_add( $form[ 'id' ] );
171 171
 	}
172 172
 
173 173
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		// Normally just one form, but supports multiple forms
187 187
 		//
188 188
 		// Array of IDs 12, 5, 14 would result in `f:12-f:5-f:14`
189
-		$forms = 'f:' . implode( '-f:', (array) $form_ids );
189
+		$forms = 'f:' . implode( '-f:', (array)$form_ids );
190 190
 
191 191
 		// Prefix for transient keys
192 192
 		// Now the prefix would be: `gv-cache-f:12-f:5-f:14-`
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 		$form_ids = is_array( $form_ids ) ? $form_ids : array( $form_ids );
237 237
 
238 238
 		// Add the passed form IDs
239
-		$blocklist = array_merge( (array) $blocklist, $form_ids );
239
+		$blocklist = array_merge( (array)$blocklist, $form_ids );
240 240
 
241 241
 		// Don't duplicate
242 242
 		$blocklist = array_unique( $blocklist );
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
 		$blocklist = get_option( self::BLOCKLIST_OPTION_NAME, array() );
281 281
 
282
-		$updated_list = array_diff( $blocklist, (array) $form_ids );
282
+		$updated_list = array_diff( $blocklist, (array)$form_ids );
283 283
 
284 284
 		gravityview()->log->debug( 'Removing form IDs from cache blocklist', array( 'data' => array(
285 285
 			'$form_ids'     => $form_ids,
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 			return false;
338 338
 		}
339 339
 
340
-		foreach ( (array) $form_ids as $form_id ) {
340
+		foreach ( (array)$form_ids as $form_id ) {
341 341
 
342 342
 			if ( in_array( $form_id, $blocklist ) ) {
343 343
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			 * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache
412 412
 			 * @param int $time_in_seconds Default: `DAY_IN_SECONDS`
413 413
 			 */
414
-			$cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
414
+			$cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS );
415 415
 
416 416
 			gravityview()->log->debug( 'Setting cache with transient key {key} for {cache_time} seconds', array( 'key' => $this->key, 'cache_time' => $cache_time ) );
417 417
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 			return;
448 448
 		}
449 449
 
450
-		foreach ( (array) $form_ids as $form_id ) {
450
+		foreach ( (array)$form_ids as $form_id ) {
451 451
 
452 452
 			$key = '_transient_gv-cache-';
453 453
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 	public function use_cache() {
559 559
 
560 560
 		// Exit early if debugging (unless running PHPUnit)
561
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined('DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) {
561
+		if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined( 'DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) {
562 562
 			return apply_filters( 'gravityview_use_cache', false, $this );
563 563
 		}
564 564
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 
567 567
 		if ( GVCommon::has_cap( 'edit_gravityviews' ) ) {
568 568
 
569
-			if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) {
569
+			if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) {
570 570
 
571 571
 				gravityview()->log->debug( 'Not using cache: ?cache or ?nocache is in the URL' );
572 572
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 		 */
594 594
 		$use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this );
595 595
 
596
-		return (boolean) $use_cache;
596
+		return (boolean)$use_cache;
597 597
 	}
598 598
 
599 599
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-custom.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) {
58 58
 
59
-		$entry_default_fields['custom']	= array(
59
+		$entry_default_fields[ 'custom' ] = array(
60 60
 			'label'	=> $this->label,
61 61
 			'type'	=> $this->name,
62 62
 			'desc'	=> $this->description,
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
71 71
 
72
-		unset ( $field_options['search_filter'], $field_options['show_as_link'], $field_options['new_window'] );
72
+		unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ], $field_options[ 'new_window' ] );
73 73
 
74 74
 		$new_fields = array(
75 75
 			'content' => array(
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		);
113 113
 
114 114
 		if ( 'edit' === $context ) {
115
-			unset( $field_options['custom_label'], $field_options['show_label'], $field_options['allow_edit_cap'], $new_fields['wpautop'], $new_fields['oembed'] );
115
+			unset( $field_options[ 'custom_label' ], $field_options[ 'show_label' ], $field_options[ 'allow_edit_cap' ], $new_fields[ 'wpautop' ], $new_fields[ 'oembed' ] );
116 116
 		}
117 117
 
118 118
 		return $new_fields + $field_options;
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 
147 147
 		// Loop through the configured Edit Entry fields and add Custom Content fields if there are any
148 148
 		// TODO: Make this available to other custom GV field types
149
-		foreach ( (array) $edit_fields as $edit_field ) {
149
+		foreach ( (array)$edit_fields as $edit_field ) {
150 150
 
151
-			if( 'custom' === \GV\Utils::get( $edit_field, 'id') ) {
151
+			if ( 'custom' === \GV\Utils::get( $edit_field, 'id' ) ) {
152 152
 
153 153
 				$field_data = array(
154 154
 					'label' => \GV\Utils::get( $edit_field, 'custom_label' ),
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
 					$field_data[ $key ] = GravityView_Merge_Tags::replace_variables( $field_datum, $form, $entry_data, false, false );
163 163
 				}
164 164
 
165
-				$field_data['cssClass'] = \GV\Utils::get( $edit_field, 'custom_class' );
165
+				$field_data[ 'cssClass' ] = \GV\Utils::get( $edit_field, 'custom_class' );
166 166
 
167
-				$new_fields[] = new GF_Field_HTML( $field_data );
167
+				$new_fields[ ] = new GF_Field_HTML( $field_data );
168 168
 
169 169
 			} else {
170
-				if( isset( $fields[ $i ] ) ) {
171
-					$new_fields[] =  $fields[ $i ];
170
+				if ( isset( $fields[ $i ] ) ) {
171
+					$new_fields[ ] = $fields[ $i ];
172 172
 				}
173 173
 				$i++;
174 174
 			}
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-signature.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$signature_fields = GFAPI::get_fields_by_type( $form, 'signature' );
54 54
 
55 55
 		foreach ( $signature_fields as $field ) {
56
-			unset( $_POST["input_{$field->id}"] );
56
+			unset( $_POST[ "input_{$field->id}" ] );
57 57
 		}
58 58
 	}
59 59
 
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	function edit_entry_field_input( $field_content = '', $field = null, $value = '', $lead_id = 0, $form_id = 0 ) {
74 74
 
75
-		$context = function_exists('gravityview_get_context') ? gravityview_get_context() : '';
75
+		$context = function_exists( 'gravityview_get_context' ) ? gravityview_get_context() : '';
76 76
 
77
-		if( 'signature' !== $field->type || 'edit' !== $context ) {
77
+		if ( 'signature' !== $field->type || 'edit' !== $context ) {
78 78
 			return $field_content;
79 79
 		}
80 80
 
81 81
 		// We need to fetch a fresh version of the entry, since the saved entry hasn't refreshed in GV yet.
82 82
 		$entry = GravityView_View::getInstance()->getCurrentEntry();
83
-		$entry = GFAPI::get_entry( $entry['id'] );
83
+		$entry = GFAPI::get_entry( $entry[ 'id' ] );
84 84
 		$entry_value = \GV\Utils::get( $entry, $field->id );
85 85
 
86
-		$_POST["input_{$field->id}"] = $entry_value; // Used when Edit Entry form *is* submitted
87
-		$_POST["input_{$form_id}_{$field->id}_signature_filename"] = $entry_value; // Used when Edit Entry form *is not* submitted
86
+		$_POST[ "input_{$field->id}" ] = $entry_value; // Used when Edit Entry form *is* submitted
87
+		$_POST[ "input_{$form_id}_{$field->id}_signature_filename" ] = $entry_value; // Used when Edit Entry form *is not* submitted
88 88
 
89 89
 		return ''; // Return empty string to force using $_POST values instead
90 90
 	}
Please login to merge, or discard this patch.
includes/class-gravityview-change-entry-creator.php 1 patch
Spacing   +16 added lines, -18 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
 	}
@@ -283,16 +283,14 @@  discard block
 block discarded – undo
283 283
 				$originally_created_by_user_data = get_userdata( $originally_created_by );
284 284
 
285 285
 				$original_name = ! empty( $originally_created_by_user_data ) ?
286
-					sprintf( $user_format, $originally_created_by_user_data->display_name, $originally_created_by_user_data->ID ) :
287
-					esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' );
286
+					sprintf( $user_format, $originally_created_by_user_data->display_name, $originally_created_by_user_data->ID ) : esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' );
288 287
 			}
289 288
 
290 289
 			if ( ! empty( $created_by ) ) {
291 290
 				$created_by_user_data = get_userdata( $created_by );
292 291
 
293 292
 				$created_by_name = ! empty( $created_by_user_data ) ?
294
-					sprintf( $user_format, $created_by_user_data->display_name, $created_by_user_data->ID ) :
295
-					esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' );
293
+					sprintf( $user_format, $created_by_user_data->display_name, $created_by_user_data->ID ) : esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gravityview' );
296 294
 			}
297 295
 
298 296
 			GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $user_data->display_name, sprintf( __( 'Changed entry creator from %s to %s', 'gravityview' ), $original_name, $created_by_name ), 'note' );
@@ -322,7 +320,7 @@  discard block
 block discarded – undo
322 320
 		$entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' );
323 321
 
324 322
 		$entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) );
325
-		$entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array();
323
+		$entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array();
326 324
 
327 325
 		$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>';
328 326
 
@@ -341,18 +339,18 @@  discard block
 block discarded – undo
341 339
 		}
342 340
 
343 341
 		$user_count      = count_users();
344
-		$user_count      = $user_count['total_users'];
342
+		$user_count      = $user_count[ 'total_users' ];
345 343
 		$users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 );
346 344
 		if ( $user_count > $users_displayed ) {
347 345
 			$remaining_users = $user_count - $users_displayed;
348
-			$user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users );
346
+			$user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users );
349 347
 			$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' );
350 348
 			$message = sprintf( $message, $remaining_users, $user_users );
351
-			$output  .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
349
+			$output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>';
352 350
 		}
353 351
 
354 352
 		$output .= '</select>';
355
-		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />';
353
+		$output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />';
356 354
 		$output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false );
357 355
 
358 356
 		echo $output;
@@ -366,8 +364,8 @@  discard block
 block discarded – undo
366 364
 	 * @return array
367 365
 	 */
368 366
 	function register_gform_noconflict( $assets ) {
369
-		$assets[] = 'gravityview_selectwoo';
370
-		$assets[] = 'gravityview_entry_creator';
367
+		$assets[ ] = 'gravityview_selectwoo';
368
+		$assets[ ] = 'gravityview_entry_creator';
371 369
 
372 370
 		return $assets;
373 371
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-approval.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 		$this->label = esc_attr__( 'Approve Entries', 'gravityview' );
28 28
 
29
-		$this->description =  esc_attr__( 'Approve and reject entries from the View.', 'gravityview' );
29
+		$this->description = esc_attr__( 'Approve and reject entries from the View.', 'gravityview' );
30 30
 
31 31
 		$this->add_hooks();
32 32
 
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
50 50
 
51
-		unset( $field_options['only_loggedin'] );
51
+		unset( $field_options[ 'only_loggedin' ] );
52 52
 
53
-		unset( $field_options['new_window'] );
53
+		unset( $field_options[ 'new_window' ] );
54 54
 
55
-		unset( $field_options['show_as_link'] );
55
+		unset( $field_options[ 'show_as_link' ] );
56 56
 
57 57
 		return $field_options;
58 58
 	}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 		add_action( 'gravityview/field/approval/load_scripts', array( $this, 'enqueue_and_localize_script' ) );
77 77
 
78
-		add_action( 'gravityview_datatables_scripts_styles',  array( $this, 'enqueue_and_localize_script' ) );
78
+		add_action( 'gravityview_datatables_scripts_styles', array( $this, 'enqueue_and_localize_script' ) );
79 79
 
80 80
 		add_filter( 'gravityview_get_entries', array( $this, 'modify_search_parameters' ), 1000 );
81 81
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	public function maybe_prevent_field_render( $html, $args ) {
98 98
 
99 99
 		// If the field is `entry_approval` type but the user doesn't have the moderate entries cap, don't render.
100
-		if( $this->name === \GV\Utils::get( $args['field'], 'id' ) && ! GVCommon::has_cap('gravityview_moderate_entries') ) {
100
+		if ( $this->name === \GV\Utils::get( $args[ 'field' ], 'id' ) && ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
101 101
 			return '';
102 102
 		}
103 103
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	public function modify_search_parameters( $parameters ) {
128 128
 
129 129
 		if ( $this->name === \GV\Utils::get( $parameters, 'sorting/key' ) ) {
130
-			$parameters['sorting']['key'] = 'is_approved';
130
+			$parameters[ 'sorting' ][ 'key' ] = 'is_approved';
131 131
 		}
132 132
 
133 133
 		return $parameters;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
150 150
 
151
-		wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval'.$script_debug.'.js', array( 'jquery' ), GravityView_Plugin::version, true );
151
+		wp_register_script( 'gravityview-field-approval', GRAVITYVIEW_URL . 'assets/js/field-approval' . $script_debug . '.js', array( 'jquery' ), GravityView_Plugin::version, true );
152 152
 
153 153
 		wp_register_script( 'gravityview-field-approval-popper', GRAVITYVIEW_URL . 'assets/lib/tippy/popper.min.js', array(), GravityView_Plugin::version, true );
154 154
 		wp_register_script( 'gravityview-field-approval-tippy', GRAVITYVIEW_URL . 'assets/lib/tippy/tippy.min.js', array(), GravityView_Plugin::version, true );
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
 
157 157
 		$style_path = GRAVITYVIEW_DIR . 'templates/css/field-approval.css';
158 158
 
159
-		if( class_exists( 'GravityView_View' ) ) {
159
+		if ( class_exists( 'GravityView_View' ) ) {
160 160
 			/**
161 161
 			 * Override CSS file by placing in your theme's /gravityview/css/ sub-directory.
162 162
 			 */
163 163
 			$style_path = GravityView_View::getInstance()->locate_template( 'css/field-approval.css', false );
164 164
 		}
165 165
 
166
-		$style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) )  );
166
+		$style_url = plugins_url( 'css/field-approval.css', trailingslashit( dirname( $style_path ) ) );
167 167
 
168 168
 		/**
169 169
 		 * @filter `gravityview/field/approval/css_url` URL to the Approval field CSS file.
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		 */
173 173
 		$style_url = apply_filters( 'gravityview/field/approval/css_url', $style_url );
174 174
 
175
-		if( ! empty( $style_url ) ) {
175
+		if ( ! empty( $style_url ) ) {
176 176
 			wp_register_style( 'gravityview-field-approval', $style_url, array( 'dashicons' ), GravityView_Plugin::version, 'screen' );
177 177
 		}
178 178
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	public function enqueue_and_localize_script() {
188 188
 
189 189
 		// The script is already registered and enqueued
190
-		if( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) {
190
+		if ( wp_script_is( 'gravityview-field-approval', 'enqueued' ) ) {
191 191
 			return;
192 192
 		}
193 193
 
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 
201 201
 		wp_localize_script( 'gravityview-field-approval', 'gvApproval', array(
202 202
 			'ajaxurl' => admin_url( 'admin-ajax.php' ),
203
-			'nonce' => wp_create_nonce('gravityview_entry_approval'),
203
+			'nonce' => wp_create_nonce( 'gravityview_entry_approval' ),
204 204
 			'status' => GravityView_Entry_Approval_Status::get_all(),
205 205
 			'status_popover_template' => GravityView_Entry_Approval::get_popover_template(),
206 206
 			'status_popover_placement' => GravityView_Entry_Approval::get_popover_placement(),
207
-		));
207
+		) );
208 208
 
209 209
 	}
210 210
 
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 */
222 222
 	public function filter_gravityview_entry_default_field( $entry_default_fields, $form, $context ) {
223 223
 
224
-		if ( ! isset( $entry_default_fields["{$this->name}"] ) && 'edit' !== $context ) {
225
-			$entry_default_fields["{$this->name}"] = array(
224
+		if ( ! isset( $entry_default_fields[ "{$this->name}" ] ) && 'edit' !== $context ) {
225
+			$entry_default_fields[ "{$this->name}" ] = array(
226 226
 				'label' => $this->label,
227 227
 				'desc'  => $this->description,
228 228
 				'type'  => $this->name,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-address.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 				continue;
75 75
 			}
76 76
 
77
-			$field_id = intval( floor( $search_field['key'] ) );
78
-			$input_id = gravityview_get_input_id_from_id( $search_field['key'] );
77
+			$field_id = intval( floor( $search_field[ 'key' ] ) );
78
+			$input_id = gravityview_get_input_id_from_id( $search_field[ 'key' ] );
79 79
 			$form = GravityView_View::getInstance()->getForm();
80 80
 
81 81
 			/** @type GF_Field_Address $address_field */
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			$choices = array();
85 85
 
86 86
 			$method_name = 'get_choices_' . self::get_input_type_from_input_id( $input_id );
87
-			if( method_exists( $this, $method_name ) ) {
87
+			if ( method_exists( $this, $method_name ) ) {
88 88
 				/**
89 89
 				 * @uses GravityView_Field_Address::get_choices_country()
90 90
 				 * @uses GravityView_Field_Address::get_choices_state()
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 				$choices = $this->{$method_name}( $address_field, $form );
93 93
 			}
94 94
 
95
-			if( ! empty( $choices ) ) {
96
-				$search_field['choices'] = $choices;
97
-				$search_field['type'] = \GV\Utils::get( $search_field, 'input');
95
+			if ( ! empty( $choices ) ) {
96
+				$search_field[ 'choices' ] = $choices;
97
+				$search_field[ 'type' ] = \GV\Utils::get( $search_field, 'input' );
98 98
 			} else {
99
-				$search_field['type'] = 'text';
100
-				$search_field['input'] = 'input_text';
99
+				$search_field[ 'type' ] = 'text';
100
+				$search_field[ 'input' ] = 'input_text';
101 101
 			}
102 102
 		}
103 103
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$country_choices = array();
123 123
 
124 124
 		foreach ( $countries as $key => $country ) {
125
-			$country_choices[] = array(
125
+			$country_choices[ ] = array(
126 126
 				'value' => $country,
127 127
 				'text' => $country,
128 128
 			);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	private function get_choices_state( $address_field, $form ) {
149 149
 
150
-		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form['id'] ) : $address_field->addressType;
150
+		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form[ 'id' ] ) : $address_field->addressType;
151 151
 
152 152
 		$state_choices = array();
153 153
 
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 				$states = GFCommon::get_canadian_provinces();
160 160
 				break;
161 161
 			default:
162
-				$address_types = $address_field->get_address_types( $form['id'] );
163
-				$states = empty( $address_types[ $address_type ]['states'] ) ? array() : $address_types[ $address_type ]['states'];
162
+				$address_types = $address_field->get_address_types( $form[ 'id' ] );
163
+				$states = empty( $address_types[ $address_type ][ 'states' ] ) ? array() : $address_types[ $address_type ][ 'states' ];
164 164
 				break;
165 165
 		}
166 166
 
@@ -169,19 +169,19 @@  discard block
 block discarded – undo
169 169
 				$state_subchoices = array();
170 170
 
171 171
 				foreach ( $state as $key => $substate ) {
172
-					$state_subchoices[] = array(
172
+					$state_subchoices[ ] = array(
173 173
 						'value' => is_numeric( $key ) ? $substate : $key,
174 174
 						'text' => $substate,
175 175
 					);
176 176
 				}
177 177
 
178
-				$state_choices[] = array(
178
+				$state_choices[ ] = array(
179 179
 					'text' => $key,
180 180
 					'value' => $state_subchoices,
181 181
 				);
182 182
 
183 183
 			} else {
184
-				$state_choices[] = array(
184
+				$state_choices[ ] = array(
185 185
 					'value' => is_numeric( $key ) ? $state : $key,
186 186
 					'text' => $state,
187 187
 				);
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
 		// Use the same inputs as the "text" input type allows
206 206
 		$text_inputs = \GV\Utils::get( $input_types, 'text' );
207 207
 
208
-		$input_types['street'] = $text_inputs;
209
-		$input_types['street2'] = $text_inputs;
210
-		$input_types['city'] = $text_inputs;
208
+		$input_types[ 'street' ] = $text_inputs;
209
+		$input_types[ 'street2' ] = $text_inputs;
210
+		$input_types[ 'city' ] = $text_inputs;
211 211
 
212
-		$input_types['state'] = array( 'select', 'radio', 'link' ) + $text_inputs;
213
-		$input_types['zip'] = array( 'input_text' );
214
-		$input_types['country'] = array( 'select', 'radio', 'link' ) + $text_inputs;
212
+		$input_types[ 'state' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
213
+		$input_types[ 'zip' ] = array( 'input_text' );
214
+		$input_types[ 'country' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
215 215
 
216 216
 		return $input_types;
217 217
 	}
@@ -232,12 +232,12 @@  discard block
 block discarded – undo
232 232
 		// Is this search field for an input (eg: 4.2) or the whole address field (eg: 4)?
233 233
 		$input_id = gravityview_get_input_id_from_id( $field_id );
234 234
 
235
-		if( 'address' !== $field_type && $input_id ) {
235
+		if ( 'address' !== $field_type && $input_id ) {
236 236
 			return $input_type;
237 237
 		}
238 238
 
239 239
 		// If the input ID matches an expected address input, set to that. Otherwise, keep existing input type.
240
-		if( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
240
+		if ( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
241 241
 			$input_type = $address_field_name;
242 242
 		}
243 243
 
@@ -284,17 +284,17 @@  discard block
 block discarded – undo
284 284
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
285 285
 
286 286
 		// If this is NOT the full address field, return default options.
287
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
287
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
288 288
 			return $field_options;
289 289
 		}
290 290
 
291
-		if( 'edit' === $context ) {
291
+		if ( 'edit' === $context ) {
292 292
 			return $field_options;
293 293
 		}
294 294
 
295 295
 		$add_options = array();
296 296
 
297
-		$add_options['show_map_link'] = array(
297
+		$add_options[ 'show_map_link' ] = array(
298 298
 			'type'       => 'checkbox',
299 299
 			'label'      => __( 'Show Map Link:', 'gravityview' ),
300 300
 			'desc'       => __( 'Display a "Map It" link below the address', 'gravityview' ),
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			'priority'   => 98,
305 305
 		);
306 306
 
307
-		$add_options['show_map_link_new_window'] = array(
307
+		$add_options[ 'show_map_link_new_window' ] = array(
308 308
 			'type'       => 'checkbox',
309 309
 			'label'      => __( 'Open map link in a new tab or window?', 'gravityview' ),
310 310
 			'value'      => false,
Please login to merge, or discard this patch.
future/includes/class-gv-view.php 1 patch
Spacing   +81 added lines, -82 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$supports = array( 'title', 'revisions' );
126 126
 
127 127
 		if ( $is_hierarchical ) {
128
-			$supports[] = 'page-attributes';
128
+			$supports[ ] = 'page-attributes';
129 129
 		}
130 130
 
131 131
 		/**
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
 		$tsv_rule = array( sprintf( '%s/([^/]+)/tsv/?', $slug ), 'index.php?gravityview=$matches[1]&tsv=1', 'top' );
230 230
 
231 231
 		add_filter( 'query_vars', function( $query_vars ) {
232
-			$query_vars[] = 'csv';
233
-			$query_vars[] = 'tsv';
232
+			$query_vars[ ] = 'csv';
233
+			$query_vars[ ] = 'tsv';
234 234
 			return $query_vars;
235 235
 		} );
236 236
 
237
-		if ( ! isset( $wp_rewrite->extra_rules_top[ $csv_rule[0] ] ) ) {
237
+		if ( ! isset( $wp_rewrite->extra_rules_top[ $csv_rule[ 0 ] ] ) ) {
238 238
 			call_user_func_array( 'add_rewrite_rule', $csv_rule );
239 239
 			call_user_func_array( 'add_rewrite_rule', $tsv_rule );
240 240
 		}
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 						$message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' );
297 297
 
298
-						$image =  sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', esc_attr__( 'Data Source', 'gravityview' ), esc_url( plugins_url( 'assets/images/screenshots/data-source.png', GRAVITYVIEW_FILE ) ) );
298
+						$image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', esc_attr__( 'Data Source', 'gravityview' ), esc_url( plugins_url( 'assets/images/screenshots/data-source.png', GRAVITYVIEW_FILE ) ) );
299 299
 
300 300
 						return \GVCommon::generate_notice( '<h3>' . $title . '</h3>' . wpautop( $message . $image ), 'notice' );
301 301
 					}
@@ -321,13 +321,13 @@  discard block
 block discarded – undo
321 321
 			return $content;
322 322
 		}
323 323
 
324
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
324
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
325 325
 
326 326
 		/**
327 327
 		 * Editing a single entry.
328 328
 		 */
329 329
 		if ( $entry = $request->is_edit_entry( $view->form ? $view->form->ID : 0 ) ) {
330
-			if ( $entry['status'] != 'active' ) {
330
+			if ( $entry[ 'status' ] != 'active' ) {
331 331
 				gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
332 332
 				return __( 'You are not allowed to view this content.', 'gravityview' );
333 333
 			}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 			}
339 339
 
340 340
 			if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
341
-				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
341
+				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
342 342
 					gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
343 343
 					return __( 'You are not allowed to view this content.', 'gravityview' );
344 344
 				}
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
 			foreach ( $entryset as $e ) {
363 363
 
364
-				if ( 'active' !== $e['status'] ) {
364
+				if ( 'active' !== $e[ 'status' ] ) {
365 365
 					gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) );
366 366
 					return __( 'You are not allowed to view this content.', 'gravityview' );
367 367
 				}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				}
373 373
 
374 374
 				if ( $show_only_approved && ! $is_admin_and_can_view ) {
375
-					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
375
+					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
376 376
 						gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) );
377 377
 						return __( 'You are not allowed to view this content.', 'gravityview' );
378 378
 					}
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 			$join_column    = is_numeric( $join_column ) ? GF_Field::by_id( $join, $join_column ) : Internal_Field::by_id( $join_column );
548 548
 			$join_on_column = is_numeric( $join_on_column ) ? GF_Field::by_id( $join_on, $join_on_column ) : Internal_Field::by_id( $join_on_column );
549 549
 
550
-			$joins [] = new Join( $join, $join_column, $join_on, $join_on_column );
550
+			$joins [ ] = new Join( $join, $join_column, $join_on, $join_on_column );
551 551
 		}
552 552
 
553 553
 		return $joins;
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
 			}
638 638
 
639 639
 			foreach ( $_fields as $field ) {
640
-				if ( ! empty( $field['unions'] ) ) {
641
-					foreach ( $field['unions'] as $form_id => $field_id ) {
640
+				if ( ! empty( $field[ 'unions' ] ) ) {
641
+					foreach ( $field[ 'unions' ] as $form_id => $field_id ) {
642 642
 						if ( ! isset( $unions[ $form_id ] ) ) {
643 643
 							$unions[ $form_id ] = array();
644 644
 						}
645 645
 
646
-						$unions[ $form_id ][ $field['id'] ] =
646
+						$unions[ $form_id ][ $field[ 'id' ] ] =
647 647
 							is_numeric( $field_id ) ? \GV\GF_Field::by_id( \GV\GF_Form::by_id( $form_id ), $field_id ) : \GV\Internal_Field::by_id( $field_id );
648 648
 					}
649 649
 				}
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 		if ( ! $view->form ) {
699 699
 			gravityview()->log->error( 'View #{view_id} tried attaching non-existent Form #{form_id} to it.', array(
700 700
 				'view_id' => $view->ID,
701
-				'form_id' => $view->_gravityview_form_id ? : 0,
701
+				'form_id' => $view->_gravityview_form_id ?: 0,
702 702
 			) );
703 703
 		}
704 704
 
@@ -942,11 +942,11 @@  discard block
 block discarded – undo
942 942
 		 * Remove multiple sorting before calling legacy filters.
943 943
 		 * This allows us to fake it till we make it.
944 944
 		 */
945
-		if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) {
945
+		if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) {
946 946
 			$has_multisort = true;
947
-			$parameters['sort_field'] = reset( $parameters['sort_field'] );
948
-			if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) {
949
-				$parameters['sort_direction'] = reset( $parameters['sort_direction'] );
947
+			$parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] );
948
+			if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) {
949
+				$parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] );
950 950
 			}
951 951
 		}
952 952
 
@@ -955,31 +955,30 @@  discard block
 block discarded – undo
955 955
 		 */
956 956
 		$parameters = \GravityView_frontend::get_view_entries_parameters( $parameters, $this->form->ID );
957 957
 
958
-		$parameters['context_view_id'] = $this->ID;
958
+		$parameters[ 'context_view_id' ] = $this->ID;
959 959
 		$parameters = \GVCommon::calculate_get_entries_criteria( $parameters, $this->form->ID );
960 960
 
961 961
 		if ( ! is_array( $parameters ) ) {
962 962
 			$parameters = array();
963 963
 		}
964 964
 
965
-		if ( ! is_array( $parameters['search_criteria'] ) ) {
966
-			$parameters['search_criteria'] = array();
965
+		if ( ! is_array( $parameters[ 'search_criteria' ] ) ) {
966
+			$parameters[ 'search_criteria' ] = array();
967 967
 		}
968 968
 
969
-		if ( ( ! isset( $parameters['search_criteria']['field_filters'] ) ) || ( ! is_array( $parameters['search_criteria']['field_filters'] ) ) ) {
970
-			$parameters['search_criteria']['field_filters'] = array();
969
+		if ( ( ! isset( $parameters[ 'search_criteria' ][ 'field_filters' ] ) ) || ( ! is_array( $parameters[ 'search_criteria' ][ 'field_filters' ] ) ) ) {
970
+			$parameters[ 'search_criteria' ][ 'field_filters' ] = array();
971 971
 		}
972 972
 
973 973
 		if ( $request instanceof REST\Request ) {
974 974
 			$atts = $this->settings->as_atts();
975 975
 			$paging_parameters = wp_parse_args( $request->get_paging(), array(
976
-					'paging' => array( 'page_size' => $atts['page_size'] ),
976
+					'paging' => array( 'page_size' => $atts[ 'page_size' ] ),
977 977
 				) );
978
-			$parameters['paging'] = $paging_parameters['paging'];
978
+			$parameters[ 'paging' ] = $paging_parameters[ 'paging' ];
979 979
 		}
980 980
 
981
-		$page = Utils::get( $parameters['paging'], 'current_page' ) ?
982
-			: ( ( ( $parameters['paging']['offset'] - $this->settings->get( 'offset' ) ) / \GV\Utils::get( $parameters, 'paging/page_size', 25 ) ) + 1 );
981
+		$page = Utils::get( $parameters[ 'paging' ], 'current_page' ) ?: ( ( ( $parameters[ 'paging' ][ 'offset' ] - $this->settings->get( 'offset' ) ) / \GV\Utils::get( $parameters, 'paging/page_size', 25 ) ) + 1 );
983 982
 
984 983
 		/**
985 984
 		 * Cleanup duplicate field_filter parameters to simplify the query.
@@ -987,14 +986,14 @@  discard block
 block discarded – undo
987 986
 		$unique_field_filters = array();
988 987
 		foreach ( Utils::get( $parameters, 'search_criteria/field_filters', array() ) as $key => $filter ) {
989 988
 			if ( 'mode' === $key ) {
990
-				$unique_field_filters['mode'] = $filter;
989
+				$unique_field_filters[ 'mode' ] = $filter;
991 990
 			} else if ( ! in_array( $filter, $unique_field_filters ) ) {
992
-				$unique_field_filters[] = $filter;
991
+				$unique_field_filters[ ] = $filter;
993 992
 			}
994 993
 		}
995
-		$parameters['search_criteria']['field_filters'] = $unique_field_filters;
994
+		$parameters[ 'search_criteria' ][ 'field_filters' ] = $unique_field_filters;
996 995
 
997
-		if ( ! empty( $parameters['search_criteria']['field_filters'] ) ) {
996
+		if ( ! empty( $parameters[ 'search_criteria' ][ 'field_filters' ] ) ) {
998 997
 			gravityview()->log->notice( 'search_criteria/field_filters is not empty, third-party code may be using legacy search_criteria filters.' );
999 998
 		}
1000 999
 
@@ -1003,7 +1002,7 @@  discard block
 block discarded – undo
1003 1002
 			$query_class = $this->get_query_class();
1004 1003
 
1005 1004
 			/** @type \GF_Query $query */
1006
-			$query = new $query_class( $this->form->ID, $parameters['search_criteria'], Utils::get( $parameters, 'sorting' ) );
1005
+			$query = new $query_class( $this->form->ID, $parameters[ 'search_criteria' ], Utils::get( $parameters, 'sorting' ) );
1007 1006
 
1008 1007
 			/**
1009 1008
 			 * Apply multisort.
@@ -1014,15 +1013,15 @@  discard block
 block discarded – undo
1014 1013
 				$view_setting_sort_field_ids = \GV\Utils::get( $atts, 'sort_field', array() );
1015 1014
 				$view_setting_sort_directions = \GV\Utils::get( $atts, 'sort_direction', array() );
1016 1015
 
1017
-				$has_sort_query_param = ! empty( $_GET['sort'] ) && is_array( $_GET['sort'] );
1016
+				$has_sort_query_param = ! empty( $_GET[ 'sort' ] ) && is_array( $_GET[ 'sort' ] );
1018 1017
 
1019
-				if( $has_sort_query_param ) {
1020
-					$has_sort_query_param = array_filter( array_values( $_GET['sort'] ) );
1018
+				if ( $has_sort_query_param ) {
1019
+					$has_sort_query_param = array_filter( array_values( $_GET[ 'sort' ] ) );
1021 1020
 				}
1022 1021
 
1023 1022
 				if ( $this->settings->get( 'sort_columns' ) && $has_sort_query_param ) {
1024
-					$sort_field_ids = array_keys( $_GET['sort'] );
1025
-					$sort_directions = array_values( $_GET['sort'] );
1023
+					$sort_field_ids = array_keys( $_GET[ 'sort' ] );
1024
+					$sort_directions = array_values( $_GET[ 'sort' ] );
1026 1025
 				} else {
1027 1026
 					$sort_field_ids = $view_setting_sort_field_ids;
1028 1027
 					$sort_directions = $view_setting_sort_directions;
@@ -1030,7 +1029,7 @@  discard block
 block discarded – undo
1030 1029
 
1031 1030
 				$skip_first = false;
1032 1031
 
1033
-				foreach ( (array) $sort_field_ids as $key => $sort_field_id ) {
1032
+				foreach ( (array)$sort_field_ids as $key => $sort_field_id ) {
1034 1033
 
1035 1034
 					if ( ! $skip_first && ! $has_sort_query_param ) {
1036 1035
 						$skip_first = true; // Skip the first one, it's already in the query
@@ -1060,18 +1059,18 @@  discard block
 block discarded – undo
1060 1059
 
1061 1060
 				$merged_time = false;
1062 1061
 
1063
-				foreach ( $q['order'] as $oid => $order ) {
1062
+				foreach ( $q[ 'order' ] as $oid => $order ) {
1064 1063
 
1065 1064
 					$column = null;
1066 1065
 
1067
-					if ( $order[0] instanceof \GF_Query_Column ) {
1068
-						$column = $order[0];
1069
-					} else if ( $order[0] instanceof \GF_Query_Call ) {
1070
-						if ( count( $order[0]->columns ) != 1 || ! $order[0]->columns[0] instanceof \GF_Query_Column ) {
1066
+					if ( $order[ 0 ] instanceof \GF_Query_Column ) {
1067
+						$column = $order[ 0 ];
1068
+					} else if ( $order[ 0 ] instanceof \GF_Query_Call ) {
1069
+						if ( count( $order[ 0 ]->columns ) != 1 || ! $order[ 0 ]->columns[ 0 ] instanceof \GF_Query_Column ) {
1071 1070
 							$orders[ $oid ] = $order;
1072 1071
 							continue; // Need something that resembles a single sort
1073 1072
 						}
1074
-						$column = $order[0]->columns[0];
1073
+						$column = $order[ 0 ]->columns[ 0 ];
1075 1074
 					}
1076 1075
 
1077 1076
 					if ( ! $column || ( ! $field = \GFAPI::get_field( $column->source, $column->field_id ) ) || $field->type !== 'time' ) {
@@ -1085,7 +1084,7 @@  discard block
 block discarded – undo
1085 1084
 
1086 1085
 					$orders[ $oid ] = array(
1087 1086
 						new \GV\Mocks\GF_Query_Call_TIMESORT( 'timesort', array( $column, $sql ) ),
1088
-						$order[1] // Mock it!
1087
+						$order[ 1 ] // Mock it!
1089 1088
 					);
1090 1089
 
1091 1090
 					$merged_time = true;
@@ -1096,15 +1095,15 @@  discard block
 block discarded – undo
1096 1095
 					 * ORDER again.
1097 1096
 					 */
1098 1097
 					if ( ! empty( $orders ) && $_orders = $query->_order_generate( $orders ) ) {
1099
-						$sql['order'] = 'ORDER BY ' . implode( ', ', $_orders );
1098
+						$sql[ 'order' ] = 'ORDER BY ' . implode( ', ', $_orders );
1100 1099
 					}
1101 1100
 				}
1102 1101
 
1103 1102
 				return $sql;
1104 1103
 			} );
1105 1104
 
1106
-			$query->limit( $parameters['paging']['page_size'] )
1107
-				->offset( ( ( $page - 1 ) * $parameters['paging']['page_size'] ) + $this->settings->get( 'offset' ) );
1105
+			$query->limit( $parameters[ 'paging' ][ 'page_size' ] )
1106
+				->offset( ( ( $page - 1 ) * $parameters[ 'paging' ][ 'page_size' ] ) + $this->settings->get( 'offset' ) );
1108 1107
 
1109 1108
 			/**
1110 1109
 			 * Any joins?
@@ -1127,7 +1126,7 @@  discard block
 block discarded – undo
1127 1126
 
1128 1127
 						$query_parameters = $query->_introspect();
1129 1128
 
1130
-						$query->where( \GF_Query_Condition::_and( $query_parameters['where'], $condition ) );
1129
+						$query->where( \GF_Query_Condition::_and( $query_parameters[ 'where' ], $condition ) );
1131 1130
 					}
1132 1131
 
1133 1132
 					/**
@@ -1161,7 +1160,7 @@  discard block
 block discarded – undo
1161 1160
 					}
1162 1161
 
1163 1162
 					$q = $query->_introspect();
1164
-					$query->where( \GF_Query_Condition::_and( $q['where'], $condition ) );
1163
+					$query->where( \GF_Query_Condition::_and( $q[ 'where' ], $condition ) );
1165 1164
 
1166 1165
 					if ( $this->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
1167 1166
 
@@ -1186,7 +1185,7 @@  discard block
 block discarded – undo
1186 1185
 
1187 1186
 						$query_parameters = $query->_introspect();
1188 1187
 
1189
-						$query->where( \GF_Query_Condition::_and( $query_parameters['where'], $condition ) );
1188
+						$query->where( \GF_Query_Condition::_and( $query_parameters[ 'where' ], $condition ) );
1190 1189
 					}
1191 1190
 				}
1192 1191
 
@@ -1210,7 +1209,7 @@  discard block
 block discarded – undo
1210 1209
 						$conditions = array();
1211 1210
 
1212 1211
 						foreach ( $condition->expressions as $_condition ) {
1213
-							$conditions[] = $recurse( $_condition, $fields, $recurse );
1212
+							$conditions[ ] = $recurse( $_condition, $fields, $recurse );
1214 1213
 						}
1215 1214
 
1216 1215
 						return call_user_func_array(
@@ -1239,10 +1238,10 @@  discard block
 block discarded – undo
1239 1238
 					$q = new $query_class( $form_id );
1240 1239
 
1241 1240
 					// Copy the WHERE clauses but substitute the field_ids to the respective ones
1242
-					$q->where( $where_union_substitute( $query_parameters['where'], $fields, $where_union_substitute ) );
1241
+					$q->where( $where_union_substitute( $query_parameters[ 'where' ], $fields, $where_union_substitute ) );
1243 1242
 
1244 1243
 					// Copy the ORDER clause and substitute the field_ids to the respective ones
1245
-					foreach ( $query_parameters['order'] as $order ) {
1244
+					foreach ( $query_parameters[ 'order' ] as $order ) {
1246 1245
 						list( $column, $_order ) = $order;
1247 1246
 
1248 1247
 						if ( $column && $column instanceof \GF_Query_Column ) {
@@ -1256,15 +1255,15 @@  discard block
 block discarded – undo
1256 1255
 
1257 1256
 					add_filter( 'gform_gf_query_sql', $gf_query_sql_callback = function( $sql ) use ( &$unions_sql ) {
1258 1257
 						// Remove SQL_CALC_FOUND_ROWS as it's not needed in UNION clauses
1259
-						$select = 'UNION ALL ' . str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql['select'] );
1258
+						$select = 'UNION ALL ' . str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql[ 'select' ] );
1260 1259
 
1261 1260
 						// Record the SQL
1262
-						$unions_sql[] = array(
1261
+						$unions_sql[ ] = array(
1263 1262
 							// Remove columns, we'll rebuild them
1264 1263
 							'select'  => preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $select ),
1265
-							'from'    => $sql['from'],
1266
-							'join'    => $sql['join'],
1267
-							'where'   => $sql['where'],
1264
+							'from'    => $sql[ 'from' ],
1265
+							'join'    => $sql[ 'join' ],
1266
+							'where'   => $sql[ 'where' ],
1268 1267
 							// Remove order and limit
1269 1268
 						);
1270 1269
 
@@ -1281,11 +1280,11 @@  discard block
 block discarded – undo
1281 1280
 
1282 1281
 				add_filter( 'gform_gf_query_sql', $gf_query_sql_callback = function( $sql ) use ( $unions_sql ) {
1283 1282
 					// Remove SQL_CALC_FOUND_ROWS as it's not needed in UNION clauses
1284
-					$sql['select'] = str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql['select'] );
1283
+					$sql[ 'select' ] = str_replace( 'SQL_CALC_FOUND_ROWS ', '', $sql[ 'select' ] );
1285 1284
 
1286 1285
 					// Remove columns, we'll rebuild them
1287
-					preg_match( '#DISTINCT (`[motc]\d+`.`.*?`)#', $sql['select'], $select_match );
1288
-					$sql['select'] = preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $sql['select'] );
1286
+					preg_match( '#DISTINCT (`[motc]\d+`.`.*?`)#', $sql[ 'select' ], $select_match );
1287
+					$sql[ 'select' ] = preg_replace( '#DISTINCT (.*)#', 'DISTINCT ', $sql[ 'select' ] );
1289 1288
 
1290 1289
 					$unions = array();
1291 1290
 
@@ -1296,30 +1295,30 @@  discard block
 block discarded – undo
1296 1295
 					};
1297 1296
 
1298 1297
 					// Add all the order columns into the selects, so we can order by the whole union group
1299
-					preg_match_all( '#(`[motc]\d+`.`.*?`)#', $sql['order'], $order_matches );
1298
+					preg_match_all( '#(`[motc]\d+`.`.*?`)#', $sql[ 'order' ], $order_matches );
1300 1299
 
1301 1300
 					$columns = array(
1302
-						sprintf( '%s AS %s', $select_match[1], $column_to_alias( $select_match[1] ) )
1301
+						sprintf( '%s AS %s', $select_match[ 1 ], $column_to_alias( $select_match[ 1 ] ) )
1303 1302
 					);
1304 1303
 
1305 1304
 					foreach ( array_slice( $order_matches, 1 ) as $match ) {
1306
-						$columns[] = sprintf( '%s AS %s', $match[0], $column_to_alias( $match[0] ) );
1305
+						$columns[ ] = sprintf( '%s AS %s', $match[ 0 ], $column_to_alias( $match[ 0 ] ) );
1307 1306
 
1308 1307
 						// Rewrite the order columns to the shared aliases
1309
-						$sql['order'] = str_replace( $match[0], $column_to_alias( $match[0] ), $sql['order'] );
1308
+						$sql[ 'order' ] = str_replace( $match[ 0 ], $column_to_alias( $match[ 0 ] ), $sql[ 'order' ] );
1310 1309
 					}
1311 1310
 
1312 1311
 					$columns = array_unique( $columns );
1313 1312
 
1314 1313
 					// Add the columns to every UNION
1315 1314
 					foreach ( $unions_sql as $union_sql ) {
1316
-						$union_sql['select'] .= implode( ', ', $columns );
1317
-						$unions []= implode( ' ', $union_sql );
1315
+						$union_sql[ 'select' ] .= implode( ', ', $columns );
1316
+						$unions [ ] = implode( ' ', $union_sql );
1318 1317
 					}
1319 1318
 
1320 1319
 					// Add the columns to the main SELECT, but only grab the entry id column
1321
-					$sql['select'] = 'SELECT SQL_CALC_FOUND_ROWS t1_id FROM (' . $sql['select'] . implode( ', ', $columns );
1322
-					$sql['order'] = implode( ' ', $unions ) . ') AS u ' . $sql['order'];
1320
+					$sql[ 'select' ] = 'SELECT SQL_CALC_FOUND_ROWS t1_id FROM (' . $sql[ 'select' ] . implode( ', ', $columns );
1321
+					$sql[ 'order' ] = implode( ' ', $unions ) . ') AS u ' . $sql[ 'order' ];
1323 1322
 
1324 1323
 					return $sql;
1325 1324
 				} );
@@ -1364,20 +1363,20 @@  discard block
 block discarded – undo
1364 1363
 			} );
1365 1364
 		} else {
1366 1365
 			$entries = $this->form->entries
1367
-				->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters['search_criteria'] ) )
1366
+				->filter( \GV\GF_Entry_Filter::from_search_criteria( $parameters[ 'search_criteria' ] ) )
1368 1367
 				->offset( $this->settings->get( 'offset' ) )
1369
-				->limit( $parameters['paging']['page_size'] )
1368
+				->limit( $parameters[ 'paging' ][ 'page_size' ] )
1370 1369
 				->page( $page );
1371 1370
 
1372
-			if ( ! empty( $parameters['sorting'] ) && is_array( $parameters['sorting'] && ! isset( $parameters['sorting']['key'] ) ) ) {
1371
+			if ( ! empty( $parameters[ 'sorting' ] ) && is_array( $parameters[ 'sorting' ] && ! isset( $parameters[ 'sorting' ][ 'key' ] ) ) ) {
1373 1372
 				// Pluck off multisort arrays
1374
-				$parameters['sorting'] = $parameters['sorting'][0];
1373
+				$parameters[ 'sorting' ] = $parameters[ 'sorting' ][ 0 ];
1375 1374
 			}
1376 1375
 
1377
-			if ( ! empty( $parameters['sorting'] ) && ! empty( $parameters['sorting']['key'] ) ) {
1376
+			if ( ! empty( $parameters[ 'sorting' ] ) && ! empty( $parameters[ 'sorting' ][ 'key' ] ) ) {
1378 1377
 				$field = new \GV\Field();
1379
-				$field->ID = $parameters['sorting']['key'];
1380
-				$direction = strtolower( $parameters['sorting']['direction'] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC;
1378
+				$field->ID = $parameters[ 'sorting' ][ 'key' ];
1379
+				$direction = strtolower( $parameters[ 'sorting' ][ 'direction' ] ) == 'asc' ? \GV\Entry_Sort::ASC : \GV\Entry_Sort::DESC;
1381 1380
 				$entries = $entries->sort( new \GV\Entry_Sort( $field, $direction ) );
1382 1381
 			}
1383 1382
 		}
@@ -1461,7 +1460,7 @@  discard block
 block discarded – undo
1461 1460
 		$allowed = $headers = array();
1462 1461
 
1463 1462
 		foreach ( $view->fields->by_position( "directory_*" )->by_visible( $view )->all() as $id => $field ) {
1464
-			$allowed[] = $field;
1463
+			$allowed[ ] = $field;
1465 1464
 		}
1466 1465
 
1467 1466
 		$renderer = new Field_Renderer();
@@ -1483,17 +1482,17 @@  discard block
 block discarded – undo
1483 1482
 			} );
1484 1483
 
1485 1484
 			foreach ( array_diff( $allowed_field_ids, wp_list_pluck( $allowed, 'ID' ) ) as $field_id ) {
1486
-				$allowed[] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
1485
+				$allowed[ ] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id );
1487 1486
 			}
1488 1487
 
1489 1488
 			foreach ( $allowed as $field ) {
1490 1489
 				$source = is_numeric( $field->ID ) ? $view->form : new \GV\Internal_Source();
1491 1490
 
1492
-				$return[] = $renderer->render( $field, $view, $source, $entry, gravityview()->request, '\GV\Field_CSV_Template' );
1491
+				$return[ ] = $renderer->render( $field, $view, $source, $entry, gravityview()->request, '\GV\Field_CSV_Template' );
1493 1492
 
1494 1493
 				if ( ! $headers_done ) {
1495 1494
 					$label = $field->get_label( $view, $source, $entry );
1496
-					$headers[] = $label ? $label : $field->ID;
1495
+					$headers[ ] = $label ? $label : $field->ID;
1497 1496
 				}
1498 1497
 			}
1499 1498
 
Please login to merge, or discard this patch.