Completed
Pull Request — develop (#1620)
by Zack
15:37
created
future/includes/class-gv-utils.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		 * Try subkeys after split.
92 92
 		 */
93 93
 		if ( count( $parts = explode( '/', $key, 2 ) ) > 1 ) {
94
-			return self::get( self::get( $array, $parts[0] ), $parts[1], $default );
94
+			return self::get( self::get( $array, $parts[ 0 ] ), $parts[ 1 ], $default );
95 95
 		}
96 96
 
97 97
 		return $default;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	public static function gf_query_debug( $query ) {
146 146
 		$introspect = $query->_introspect();
147 147
 		return array(
148
-			'where' => $query->_where_unwrap( $introspect['where'] )
148
+			'where' => $query->_where_unwrap( $introspect[ 'where' ] )
149 149
 		);
150 150
 	}
151 151
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		if ( $condition->expressions ) {
159 159
 			$conditions = array();
160 160
 			foreach ( $condition->expressions as $expression ) {
161
-				$conditions[] = self::gf_query_strip_condition_column_aliases( $expression );
161
+				$conditions[ ] = self::gf_query_strip_condition_column_aliases( $expression );
162 162
 			}
163 163
 			return call_user_func_array(
164 164
 				array( '\GF_Query_Condition', $condition->operator == 'AND' ? '_and' : '_or' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-date-updated.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
49 49
 
50
-		if( 'edit' === $context ) {
50
+		if ( 'edit' === $context ) {
51 51
 			return $field_options;
52 52
 		}
53 53
 
54
-		$this->add_field_support('date_display', $field_options );
54
+		$this->add_field_support( 'date_display', $field_options );
55 55
 
56 56
 		return $field_options;
57 57
 	}
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) {
72 72
 
73 73
 		/** Overridden by a template. */
74
-		if( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) {
74
+		if ( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) {
75 75
 			return $output;
76 76
 		}
77 77
 
78
-		return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
78
+		return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
79 79
 	}
80 80
 }
81 81
 
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravity-flow.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 		parent::add_hooks();
35 35
 
36
-		add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown'), 10, 2 );
36
+		add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown' ), 10, 2 );
37 37
 
38 38
 		add_filter( 'gravityview/admin/available_fields', array( $this, 'maybe_add_non_default_fields' ), 10, 3 );
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @return void
54 54
 	 */
55 55
 	public function clear_cache_after_workflow( $form, $entry_id, $step_id, $starting_step_id ) {
56
-		do_action( 'gravityview_clear_form_cache', $form['id'] );
56
+		do_action( 'gravityview_clear_form_cache', $form[ 'id' ] );
57 57
 	}
58 58
 
59 59
 	/**
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function get_status_options( $form_id = 0, $status_key = 'workflow_final_status' ) {
72 72
 
73
-		if( empty( $form_id ) ) {
73
+		if ( empty( $form_id ) ) {
74 74
 			$form_id = GravityView_View::getInstance()->getFormId();
75 75
 		}
76 76
 
77 77
 		$entry_meta = gravity_flow()->get_entry_meta( array(), $form_id );
78 78
 
79
-		return (array) \GV\Utils::get( $entry_meta, $status_key . '/filter/choices' );
79
+		return (array)\GV\Utils::get( $entry_meta, $status_key . '/filter/choices' );
80 80
 	}
81 81
 
82 82
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 		$workflow_steps = $GFlow->get_steps();
100 100
 
101
-		if( $workflow_steps ) {
101
+		if ( $workflow_steps ) {
102 102
 
103 103
 			foreach ( $workflow_steps as $step ) {
104 104
 
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 				);
111 111
 			}
112 112
 
113
-			$fields['workflow_step'] = array(
113
+			$fields[ 'workflow_step' ] = array(
114 114
 				'label' => esc_html__( 'Workflow Step', 'gravityview' ),
115 115
 				'type'  => 'select',
116 116
 			);
117 117
 
118
-			$fields['workflow_final_status'] = array(
118
+			$fields[ 'workflow_final_status' ] = array(
119 119
 				'label' => esc_html__( 'Workflow Status', 'gravityview' ),
120 120
 				'type'  => 'select',
121 121
 			);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		if ( ( $insert_at = array_search( 'workflow_final_status', wp_list_pluck( $fields, 'key' ) ) ) !== false ) {
132 132
 			$fields_end = array_splice( $fields, $insert_at + 1 );
133 133
 
134
-			$fields[] = array(
134
+			$fields[ ] = array(
135 135
 				'text' => __( 'Workflow Current Status Timestamp', 'gravityview' ),
136 136
 				'operators' => array( '>', '<' ),
137 137
 				'placeholder' => 'yyyy-mm-dd',
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 				$keys_end = array_splice( $keys, $insert_at + 1 );
158 158
 				$values_end = array_splice( $values, $insert_at + 1 );
159 159
 
160
-				$keys[] = 'workflow_current_status_timestamp';
161
-				$values[] = array(
160
+				$keys[ ] = 'workflow_current_status_timestamp';
161
+				$values[ ] = array(
162 162
 					'label' => __( 'Workflow Current Status Timestamp', 'gravityview' ),
163 163
 					'type' => 'workflow_current_status_timestamp',
164 164
 				);
Please login to merge, or discard this patch.
future/includes/class-gv-shortcode-gravityview.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 			'class' => '',
44 44
 		) );
45 45
 
46
-		if ( ! $view_id = $atts['id'] ? : $atts['view_id'] ) {
47
-			if ( $atts['detail'] && $view = $request->is_view() ) {
46
+		if ( ! $view_id = $atts[ 'id' ] ?: $atts[ 'view_id' ] ) {
47
+			if ( $atts[ 'detail' ] && $view = $request->is_view() ) {
48 48
 				$view_id = $view->ID;
49 49
 			}
50 50
 		}
@@ -114,12 +114,12 @@  discard block
 block discarded – undo
114 114
 			}
115 115
 		}
116 116
 
117
-		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID );
117
+		$is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID );
118 118
 
119 119
 		/**
120 120
 		 * View details.
121 121
 		 */
122
-		if ( $atts['detail'] ) {
122
+		if ( $atts[ 'detail' ] ) {
123 123
 			$entries = $view->get_entries( $request );
124 124
 			return self::_return( $this->detail( $view, $entries, $atts ) );
125 125
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 				return self::_return( '' );
137 137
 			}
138 138
 
139
-			if ( $entry['status'] != 'active' ) {
139
+			if ( $entry[ 'status' ] != 'active' ) {
140 140
 				gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
141 141
 				return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
142 142
 			}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			}
148 148
 
149 149
 			if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
150
-				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
150
+				if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
151 151
 					gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
152 152
 					return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
153 153
 				}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			$entryset = $entry->is_multi() ? $entry->entries : array( $entry );
171 171
 
172 172
 			foreach ( $entryset as $e ) {
173
-				if ( $e['status'] != 'active' ) {
173
+				if ( $e[ 'status' ] != 'active' ) {
174 174
 					gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) );
175 175
 					return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
176 176
 				}
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 				}
182 182
 
183 183
 				if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) {
184
-					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
184
+					if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
185 185
 						gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) );
186 186
 						return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) );
187 187
 					}
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 
207 207
 				// Mock the request with the actual View, not the global one
208 208
 				$mock_request = new \GV\Mock_Request();
209
-				$mock_request->returns['is_view'] = $view;
210
-				$mock_request->returns['is_entry'] = $request->is_entry( $view->form ? $view->form->ID : 0 );
211
-				$mock_request->returns['is_edit_entry'] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
212
-				$mock_request->returns['is_search'] = $request->is_search();
209
+				$mock_request->returns[ 'is_view' ] = $view;
210
+				$mock_request->returns[ 'is_entry' ] = $request->is_entry( $view->form ? $view->form->ID : 0 );
211
+				$mock_request->returns[ 'is_edit_entry' ] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 );
212
+				$mock_request->returns[ 'is_search' ] = $request->is_search();
213 213
 
214 214
 				$request = $mock_request;
215 215
 			}
@@ -245,16 +245,16 @@  discard block
 block discarded – undo
245 245
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
246 246
 
247 247
 		// Only keep the passed attributes after making sure that they're valid pairs
248
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
248
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
249 249
 
250 250
 		$atts = array();
251 251
 
252
-		foreach( $filtered_atts as $key => $passed_value ) {
252
+		foreach ( $filtered_atts as $key => $passed_value ) {
253 253
 
254 254
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
255 255
 			$passed_value = \GravityView_Merge_Tags::replace_variables( $passed_value );
256 256
 
257
-			switch( $defaults[ $key ]['type'] ) {
257
+			switch ( $defaults[ $key ][ 'type' ] ) {
258 258
 
259 259
 				/**
260 260
 				 * Make sure number fields are numeric.
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
263 263
 				 */
264 264
 				case 'number':
265
-					if( is_numeric( $passed_value ) ) {
265
+					if ( is_numeric( $passed_value ) ) {
266 266
 						$atts[ $key ] = ( $passed_value + 0 );
267 267
 					}
268 268
 					break;
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 				 */
278 278
 				case 'select':
279 279
 				case 'radio':
280
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
281
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
280
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
281
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
282 282
 						$atts[ $key ] = $passed_value;
283 283
 					}
284 284
 					break;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 			}
291 291
 		}
292 292
 
293
-		$atts['detail'] = \GV\Utils::get( $passed_atts, 'detail', null );
293
+		$atts[ 'detail' ] = \GV\Utils::get( $passed_atts, 'detail', null );
294 294
 
295 295
 		return $atts;
296 296
 	}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	private function detail( $view, $entries, $atts ) {
308 308
 		$output = '';
309 309
 
310
-		switch ( $key = $atts['detail'] ):
310
+		switch ( $key = $atts[ 'detail' ] ):
311 311
 			case 'total_entries':
312 312
 				$output = number_format_i18n( $entries->total() );
313 313
 				break;
Please login to merge, or discard this patch.
includes/extensions/lightbox/class-gravityview-lightbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public function set_provider( $provider = null ) {
40 40
 
41
-		if( gravityview()->request->is_admin() ) {
41
+		if ( gravityview()->request->is_admin() ) {
42 42
 			return;
43 43
 		}
44 44
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 
59 59
 		// We're switching providers; remove the hooks that were added.
60
-		if( self::$active_provider ) {
60
+		if ( self::$active_provider ) {
61 61
 			self::$active_provider->remove_hooks();
62 62
 		}
63 63
 
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-gravityforms.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 	function __construct() {
15 15
 
16
-		$this->widget_description = __('Display a Gravity Forms form.', 'gravityview' );
16
+		$this->widget_description = __( 'Display a Gravity Forms form.', 'gravityview' );
17 17
 
18 18
 		$default_values = array(
19 19
 			'header' => 1,
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 		add_filter( 'gravityview/widget/hide_until_searched/whitelist', array( $this, 'add_to_allowlist' ) );
56 56
 
57
-		parent::__construct( __( 'Gravity Forms', 'gravityview' ) , 'gravityforms', $default_values, $settings );
57
+		parent::__construct( __( 'Gravity Forms', 'gravityview' ), 'gravityforms', $default_values, $settings );
58 58
 	}
59 59
 
60 60
 	/**
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 		 * gravityview_get_forms() is currently running too early as widgets_init runs before init and
82 82
 		 * when most Gravity Forms plugins register their own fields like GP Terms of Service.
83 83
 		 */
84
-		if( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) {
84
+		if ( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) {
85 85
 
86 86
 			// check for available gravity forms
87 87
 			$forms = gravityview_get_forms();
88 88
 
89 89
 			foreach ( $forms as $form ) {
90
-				$choices[ $form['id'] ] = $form['title'];
90
+				$choices[ $form[ 'id' ] ] = $form[ 'title' ];
91 91
 			}
92 92
 		}
93 93
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	function add_to_allowlist( $allowlist ) {
105 105
 
106
-		$allowlist[] = 'gravityforms';
106
+		$allowlist[ ] = 'gravityforms';
107 107
 
108 108
 		return $allowlist;
109 109
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 * @param string $content
114 114
 	 * @param string $context
115 115
 	 */
116
-	public function render_frontend( $widget_args, $content = '', $context = '') {
116
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
117 117
 
118 118
 		if ( ! $this->pre_render_frontend() ) {
119 119
 			return;
Please login to merge, or discard this patch.
includes/load-plugin-and-theme-hooks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 $plugin_hooks_files = glob( $include_path . 'class-gravityview-plugin-hooks-*.php' );
22 22
 
23 23
 // Load all plugin files automatically
24
-foreach ( (array) $plugin_hooks_files as $plugin_hooks_file ) {
24
+foreach ( (array)$plugin_hooks_files as $plugin_hooks_file ) {
25 25
 	include $plugin_hooks_file;
26 26
 }
27 27
 
28 28
 $theme_hooks_files = glob( $include_path . 'class-gravityview-theme-hooks-*.php' );
29 29
 
30 30
 // Load all theme files automatically
31
-foreach ( (array) $theme_hooks_files as $theme_hooks_file ) {
31
+foreach ( (array)$theme_hooks_files as $theme_hooks_file ) {
32 32
 	include $theme_hooks_file;
33 33
 }
Please login to merge, or discard this patch.
includes/plugin-and-theme-hooks/class-gravityview-theme-hooks-wpml.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 		add_filter( 'icl_ls_languages', array( $this, 'wpml_ls_filter' ) );
66 66
 
67
-		add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link') );
67
+		add_filter( 'gravityview_directory_link', array( $this, 'filter_gravityview_back_link' ) );
68 68
 	}
69 69
 
70 70
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	function filter_gravityview_back_link( $link ) {
85 85
 		global $wpml_url_filters;
86 86
 
87
-		if( $wpml_url_filters ) {
87
+		if ( $wpml_url_filters ) {
88 88
 			$link = $wpml_url_filters->permalink_filter( $link, GravityView_frontend::getInstance()->getPostId() );
89 89
 		}
90 90
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	private function remove_url_hooks() {
102 102
 		global $wpml_url_filters;
103 103
 
104
-		if( ! $wpml_url_filters ) {
104
+		if ( ! $wpml_url_filters ) {
105 105
 			return;
106 106
 		}
107 107
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	private function add_url_hooks() {
130 130
 		global $wpml_url_filters;
131 131
 
132
-		if( ! $wpml_url_filters ) {
132
+		if ( ! $wpml_url_filters ) {
133 133
 			return;
134 134
 		}
135 135
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 					break;
227 227
 			}
228 228
 
229
-			$languages[ $lang_code ]['url'] = $entry_link;
229
+			$languages[ $lang_code ][ 'url' ] = $entry_link;
230 230
 		}
231 231
 
232 232
 		$this->add_url_hooks();
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 
135 135
 		add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 );
136 136
 
137
-		if( $this->entry_meta_key ) {
137
+		if ( $this->entry_meta_key ) {
138 138
 			add_filter( 'gform_entry_meta', array( $this, 'add_entry_meta' ) );
139 139
 			add_filter( 'gravityview/common/sortable_fields', array( $this, 'add_sortable_field' ), 10, 2 );
140 140
 		}
141 141
 
142
-		if( $this->_custom_merge_tag ) {
142
+		if ( $this->_custom_merge_tag ) {
143 143
 			add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 );
144 144
 			add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 );
145 145
 		}
146 146
 
147
-		if( 'meta' === $this->group || '' !== $this->default_search_label ) {
147
+		if ( 'meta' === $this->group || '' !== $this->default_search_label ) {
148 148
 			add_filter( 'gravityview_search_field_label', array( $this, 'set_default_search_label' ), 10, 3 );
149 149
 		}
150 150
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		 * Auto-assign label from Gravity Forms label, if exists
153 153
 		 * @since 1.20
154 154
 		 */
155
-		if( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) {
155
+		if ( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) {
156 156
 			$this->label = ucfirst( GF_Fields::get( $this->name )->get_form_editor_field_title() );
157 157
 		}
158 158
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			'type'  => $this->name
180 180
 		);
181 181
 
182
-		$fields["{$this->entry_meta_key}"] = $added_field;
182
+		$fields[ "{$this->entry_meta_key}" ] = $added_field;
183 183
 
184 184
 		return $fields;
185 185
 	}
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	function set_default_search_label( $label = '', $gf_field = null, $field = array() ) {
201 201
 
202
-		if( $this->name === $field['field'] && '' === $label ) {
202
+		if ( $this->name === $field[ 'field' ] && '' === $label ) {
203 203
 			$label = esc_html( $this->default_search_label );
204 204
 		}
205 205
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 *
221 221
 	 * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text.
222 222
 	 */
223
-	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
223
+	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
224 224
 
225 225
 		// Is there is field merge tag? Strip whitespace off the ned, too.
226 226
 		preg_match_all( '/{' . preg_quote( $this->_custom_merge_tag ) . ':?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER );
@@ -253,19 +253,19 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
255 255
 
256
-		foreach( $matches as $match ) {
256
+		foreach ( $matches as $match ) {
257 257
 
258
-			$full_tag = $match[0];
258
+			$full_tag = $match[ 0 ];
259 259
 
260 260
 			// Strip the Merge Tags
261
-			$tag = str_replace( array( '{', '}'), '', $full_tag );
261
+			$tag = str_replace( array( '{', '}' ), '', $full_tag );
262 262
 
263 263
 			// Replace the value from the entry, if exists
264
-			if( isset( $entry[ $tag ] ) ) {
264
+			if ( isset( $entry[ $tag ] ) ) {
265 265
 
266 266
 				$value = $entry[ $tag ];
267 267
 
268
-				if( is_callable( array( $this, 'get_content') ) ) {
268
+				if ( is_callable( array( $this, 'get_content' ) ) ) {
269 269
 					$value = $this->get_content( $value );
270 270
 				}
271 271
 
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 	 */
339 339
 	public function _filter_sortable_fields( $not_sortable ) {
340 340
 
341
-		if( ! $this->is_sortable ) {
342
-			$not_sortable[] = $this->name;
341
+		if ( ! $this->is_sortable ) {
342
+			$not_sortable[ ] = $this->name;
343 343
 		}
344 344
 
345 345
 		return $not_sortable;
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 	 */
357 357
 	function add_entry_meta( $entry_meta ) {
358 358
 
359
-		if( ! isset( $entry_meta["{$this->entry_meta_key}"] ) ) {
359
+		if ( ! isset( $entry_meta[ "{$this->entry_meta_key}" ] ) ) {
360 360
 
361 361
 			$added_meta = array(
362 362
 				'label'             => $this->label,
@@ -365,13 +365,13 @@  discard block
 block discarded – undo
365 365
 			);
366 366
 
367 367
 			if ( $this->entry_meta_update_callback && is_callable( $this->entry_meta_update_callback ) ) {
368
-				$added_meta['update_entry_meta_callback'] = $this->entry_meta_update_callback;
368
+				$added_meta[ 'update_entry_meta_callback' ] = $this->entry_meta_update_callback;
369 369
 			}
370 370
 
371
-			$entry_meta["{$this->entry_meta_key}"] = $added_meta;
371
+			$entry_meta[ "{$this->entry_meta_key}" ] = $added_meta;
372 372
 
373 373
 		} else {
374
-			gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' =>  $entry_meta["{$this->entry_meta_key}"] ) );
374
+			gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' =>  $entry_meta[ "{$this->entry_meta_key}" ] ) );
375 375
 		}
376 376
 
377 377
 		return $entry_meta;
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 			'date_display' => array(
401 401
 				'type' => 'text',
402 402
 				'label' => __( 'Override Date Format', 'gravityview' ),
403
-				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ),
403
+				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ),
404 404
 				/**
405 405
 				 * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time)
406 406
 				 * @param[in,out] null|string $date_format Date Format (default: null)
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 
427 427
 		$options = $this->field_support_options();
428 428
 
429
-		if( isset( $options[ $key ] ) ) {
429
+		if ( isset( $options[ $key ] ) ) {
430 430
 			$field_options[ $key ] = $options[ $key ];
431 431
 		}
432 432
 
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 		$connected_form = \GV\Utils::_POST( 'form_id' );
491 491
 
492 492
 		// Otherwise, get the Form ID from the Post page
493
-		if( empty( $connected_form ) ) {
493
+		if ( empty( $connected_form ) ) {
494 494
 			$connected_form = gravityview_get_form_id( get_the_ID() );
495 495
 		}
496 496
 
497
-		if( empty( $connected_form ) ) {
497
+		if ( empty( $connected_form ) ) {
498 498
 			gravityview()->log->error( 'Form not found for form ID "{form_id}"', array( 'form_id' => $connected_form ) );
499 499
 			return false;
500 500
 		}
Please login to merge, or discard this patch.