Completed
Push — develop ( 3ab570...56fa65 )
by Zack
06:58
created
includes/fields/class-gravityview-field-address.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 
59 59
 			if ( 'address' === rgar( $search_field, 'type' ) ) {
60 60
 
61
-				$field_id = intval( floor( $search_field['key'] ) );
62
-				$input_id = gravityview_get_input_id_from_id( $search_field['key'] );
61
+				$field_id = intval( floor( $search_field[ 'key' ] ) );
62
+				$input_id = gravityview_get_input_id_from_id( $search_field[ 'key' ] );
63 63
 				$form = GravityView_View::getInstance()->getForm();
64 64
 
65 65
 				/** @var GF_Field_Address $address_field */
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				$choices = array();
69 69
 
70 70
 				$method_name = 'get_choices_' . self::get_input_type_from_input_id( $input_id );
71
-				if( method_exists( $this, $method_name ) ) {
71
+				if ( method_exists( $this, $method_name ) ) {
72 72
 					/**
73 73
 					 * @uses GravityView_Field_Address::get_choices_country()
74 74
 					 * @uses GravityView_Field_Address::get_choices_state()
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 					$choices = $this->{$method_name}( $address_field );
77 77
 				}
78 78
 
79
-				if( ! empty( $choices ) ) {
80
-					$search_field['choices'] = $choices;
81
-					$search_field['type'] = rgar( $search_field, 'input');
79
+				if ( ! empty( $choices ) ) {
80
+					$search_field[ 'choices' ] = $choices;
81
+					$search_field[ 'type' ] = rgar( $search_field, 'input' );
82 82
 				} else {
83
-					$search_field['type'] = 'text';
84
-					$search_field['input'] = 'input_text';
83
+					$search_field[ 'type' ] = 'text';
84
+					$search_field[ 'input' ] = 'input_text';
85 85
 				}
86 86
 			}
87 87
 		}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$country_choices = array();
108 108
 
109 109
 		foreach ( $countries as $key => $country ) {
110
-			$country_choices[] = array(
110
+			$country_choices[ ] = array(
111 111
 				'value' => $country,
112 112
 				'text' => $country,
113 113
 			);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	private function get_choices_state( $address_field ) {
133 133
 
134
-		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form['id'] ) : $address_field->addressType;
134
+		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form[ 'id' ] ) : $address_field->addressType;
135 135
 
136 136
 		$state_choices = array();
137 137
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 				$states = GFCommon::get_canadian_provinces();
144 144
 				break;
145 145
 			default:
146
-				$states = empty( $address_types[ $address_type ]['states'] ) ? array() : $address_types[ $address_type ]['states'];
146
+				$states = empty( $address_types[ $address_type ][ 'states' ] ) ? array() : $address_types[ $address_type ][ 'states' ];
147 147
 				break;
148 148
 		}
149 149
 
150 150
 		foreach ( $states as $key => $state ) {
151
-			$state_choices[] = array(
151
+			$state_choices[ ] = array(
152 152
 				'value' => $state,
153 153
 				'text' => $state,
154 154
 			);
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 		// Use the same inputs as the "text" input type allows
172 172
 		$text_inputs = rgar( $input_types, 'text' );
173 173
 
174
-		$input_types['street'] = $text_inputs;
175
-		$input_types['street2'] = $text_inputs;
176
-		$input_types['city'] = $text_inputs;
174
+		$input_types[ 'street' ] = $text_inputs;
175
+		$input_types[ 'street2' ] = $text_inputs;
176
+		$input_types[ 'city' ] = $text_inputs;
177 177
 
178
-		$input_types['state'] = array( 'select', 'radio', 'link' ) + $text_inputs;
179
-		$input_types['zip'] = array( 'input_text' );
180
-		$input_types['country'] = array( 'select', 'radio', 'link' ) + $text_inputs;
178
+		$input_types[ 'state' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
179
+		$input_types[ 'zip' ] = array( 'input_text' );
180
+		$input_types[ 'country' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
181 181
 
182 182
 		return $input_types;
183 183
 	}
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 		// Is this search field for an input (eg: 4.2) or the whole address field (eg: 4)?
199 199
 		$input_id = gravityview_get_input_id_from_id( $field_id );
200 200
 
201
-		if( 'address' === $field_type && $input_id ) {
201
+		if ( 'address' === $field_type && $input_id ) {
202 202
 
203 203
 			// If the input ID matches an expected address input, set to that. Otherwise, keep existing input type.
204
-			if( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
204
+			if ( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
205 205
 				$input_type = $address_field_name;
206 206
 			}
207 207
 		}
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
 	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
251 251
 
252 252
 		// If this is NOT the full address field, return default options.
253
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
253
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
254 254
 			return $field_options;
255 255
 		}
256 256
 
257
-		if( 'edit' === $context ) {
257
+		if ( 'edit' === $context ) {
258 258
 			return $field_options;
259 259
 		}
260 260
 
261 261
 		$add_options = array();
262 262
 
263
-		$add_options['show_map_link'] = array(
263
+		$add_options[ 'show_map_link' ] = array(
264 264
 			'type' => 'checkbox',
265 265
 			'label' => __( 'Show Map Link:', 'gravityview' ),
266
-			'desc' => __('Display a "Map It" link below the address', 'gravityview'),
266
+			'desc' => __( 'Display a "Map It" link below the address', 'gravityview' ),
267 267
 			'value' => true,
268 268
 			'merge_tags' => false,
269 269
 		);
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-transaction-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	var $is_numeric = true;
16 16
 
17
-	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with'  );
17
+	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' );
18 18
 
19 19
 	var $group = 'pricing';
20 20
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-checkbox.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
46 46
 
47 47
 		// It's not the parent field; it's an input
48
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
48
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
49 49
 
50
-			if( $this->is_choice_value_enabled() ) {
50
+			if ( $this->is_choice_value_enabled() ) {
51 51
 
52 52
 				$desc = esc_html__( 'This input has a label and a value. What should be displayed?', 'gravityview' );
53 53
 				$default = 'value';
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 				);
66 66
 			}
67 67
 
68
-			$field_options['choice_display'] = array(
68
+			$field_options[ 'choice_display' ] = array(
69 69
 				'type'    => 'radio',
70 70
 				'class'   => 'vertical',
71 71
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-product.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) {
51 51
 
52
-		if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
52
+		if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
53 53
 			return;
54 54
 		}
55 55
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 * @see GVCommon::entry_has_transaction_data()
102 102
 		 * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine.
103 103
 		 */
104
-		$hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
104
+		$hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
105 105
 
106 106
 		return $hide_product_fields;
107 107
 	}
Please login to merge, or discard this patch.
includes/class-gvlogic-shortcode.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 	 * Does the if and the comparison match?
233 233
 	 * @uses GVCommon::matches_operation
234 234
 	 *
235
-	 * @return boolean True: yep; false: nope
235
+	 * @return boolean|null True: yep; false: nope
236 236
 	 */
237 237
 	private function set_is_match() {
238 238
 		$this->is_match = GVCommon::matches_operation( $this->if, $this->comparison, $this->operation );
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public static function get_instance() {
87 87
 
88
-		if( empty( self::$instance ) ) {
88
+		if ( empty( self::$instance ) ) {
89 89
 			self::$instance = new self;
90 90
 		}
91 91
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
 		$operators = array_merge( self::$SUPPORTED_ARRAY_OPERATORS, self::$SUPPORTED_NUMERIC_OPERATORS, self::$SUPPORTED_SCALAR_OPERATORS, self::$SUPPORTED_CUSTOM_OPERATORS );
120 120
 
121
-		if( $with_values ) {
121
+		if ( $with_values ) {
122 122
 			$operators_with_values = array();
123
-			foreach( $operators as $key ) {
123
+			foreach ( $operators as $key ) {
124 124
 				$operators_with_values[ $key ] = '';
125 125
 			}
126 126
 			return $operators_with_values;
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	function set_operation( $operation = '' ) {
139 139
 
140
-		if( empty( $operation ) ) {
140
+		if ( empty( $operation ) ) {
141 141
 			return false;
142 142
 		}
143 143
 
144 144
 		$operators = $this->get_operators( false );
145 145
 
146
-		if( !in_array( $operation, $operators ) ) {
147
-			do_action( 'gravityview_log_debug', __METHOD__ .' Attempted to add invalid operation type.', $operation );
146
+		if ( ! in_array( $operation, $operators ) ) {
147
+			do_action( 'gravityview_log_debug', __METHOD__ . ' Attempted to add invalid operation type.', $operation );
148 148
 			return false;
149 149
 		}
150 150
 
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	private function setup_operation_and_comparison() {
166 166
 
167
-		foreach( $this->atts as $key => $value ) {
167
+		foreach ( $this->atts as $key => $value ) {
168 168
 
169 169
 			$valid = $this->set_operation( $key );
170 170
 
171
-			if( $valid ) {
171
+			if ( $valid ) {
172 172
 				$this->comparison = $value;
173 173
 				return true;
174 174
 			}
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
 			return null;
195 195
 		}
196 196
 
197
-		if( empty( $atts ) ) {
198
-			do_action( 'gravityview_log_error', __METHOD__.' $atts are empty.', $atts );
197
+		if ( empty( $atts ) ) {
198
+			do_action( 'gravityview_log_error', __METHOD__ . ' $atts are empty.', $atts );
199 199
 			return null;
200 200
 		}
201 201
 
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
 		$this->parse_atts();
207 207
 
208 208
 		// We need an "if"
209
-		if( false === $this->if ) {
210
-			do_action( 'gravityview_log_error', __METHOD__.' $atts->if is empty.', $this->passed_atts );
209
+		if ( false === $this->if ) {
210
+			do_action( 'gravityview_log_error', __METHOD__ . ' $atts->if is empty.', $this->passed_atts );
211 211
 			return null;
212 212
 		}
213 213
 
214 214
 		$setup = $this->setup_operation_and_comparison();
215 215
 
216 216
 		// We need an operation and comparison value
217
-		if( ! $setup ) {
218
-			do_action( 'gravityview_log_error', __METHOD__.' No valid operators were passed.', $this->atts );
217
+		if ( ! $setup ) {
218
+			do_action( 'gravityview_log_error', __METHOD__ . ' No valid operators were passed.', $this->atts );
219 219
 			return null;
220 220
 		}
221 221
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	private function get_output() {
250 250
 
251
-		if( $this->is_match ) {
251
+		if ( $this->is_match ) {
252 252
 			$output = $this->content;
253 253
 		} else {
254 254
 			$output = $this->else_content;
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
 		 * @param string $output HTML/text output
263 263
 		 * @param GVLogic_Shortcode $this This class
264 264
 		 */
265
-		$output = apply_filters('gravityview/gvlogic/output', $output, $this );
265
+		$output = apply_filters( 'gravityview/gvlogic/output', $output, $this );
266 266
 
267
-		do_action( 'gravityview_log_debug', __METHOD__ .' Output: ', $output );
267
+		do_action( 'gravityview_log_debug', __METHOD__ . ' Output: ', $output );
268 268
 
269 269
 		return $output;
270 270
 	}
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
 
281 281
 		$content = explode( '[else]', $this->passed_content );
282 282
 
283
-		$this->content = $content[0];
283
+		$this->content = $content[ 0 ];
284 284
 
285
-		$else_attr = isset( $this->atts['else'] ) ? $this->atts['else'] : NULL;
285
+		$else_attr = isset( $this->atts[ 'else' ] ) ? $this->atts[ 'else' ] : NULL;
286 286
 
287
-		$this->else_content = isset( $content[1] ) ? $content[1] : $else_attr;
287
+		$this->else_content = isset( $content[ 1 ] ) ? $content[ 1 ] : $else_attr;
288 288
 	}
289 289
 
290 290
 	/**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 		$this->atts = function_exists( 'array_intersect_key' ) ? array_intersect_key( $this->passed_atts, $this->atts ) : $this->atts;
308 308
 
309 309
 		// Strip whitespace if it's not default false
310
-		$this->if = ( isset( $this->atts['if'] ) && is_string( $this->atts['if'] ) ) ? trim( $this->atts['if'] ) : false;
310
+		$this->if = ( isset( $this->atts[ 'if' ] ) && is_string( $this->atts[ 'if' ] ) ) ? trim( $this->atts[ 'if' ] ) : false;
311 311
 
312 312
 		/**
313 313
 		 * @action `gravityview/gvlogic/parse_atts/after` Modify shortcode attributes after it's been parsed
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 		do_action( 'gravityview/gvlogic/parse_atts/after', $this );
319 319
 
320 320
 		// Make sure the "if" isn't processed in self::setup_operation_and_comparison()
321
-		unset( $this->atts['if'] );
321
+		unset( $this->atts[ 'if' ] );
322 322
 	}
323 323
 }
324 324
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@
 block discarded – undo
245 245
 	 * @param bool $url_encode Whether to URL-encode output
246 246
 	 * @param bool $esc_html Whether to apply `esc_html()` to output
247 247
 	 *
248
-	 * @return mixed
248
+	 * @return string
249 249
 	 */
250 250
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
251 251
 
Please login to merge, or discard this 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
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 			'type'  => $this->name
176 176
 		);
177 177
 
178
-		$fields["{$this->entry_meta_key}"] = $added_field;
178
+		$fields[ "{$this->entry_meta_key}" ] = $added_field;
179 179
 
180 180
 		return $fields;
181 181
 	}
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	function set_default_search_label( $label = '', $gf_field = null, $field = array() ) {
197 197
 
198
-		if( $this->name === $field['field'] && '' === $label ) {
198
+		if ( $this->name === $field[ 'field' ] && '' === $label ) {
199 199
 			$label = esc_html( $this->default_search_label );
200 200
 		}
201 201
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 *
217 217
 	 * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text.
218 218
 	 */
219
-	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false  ) {
219
+	public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
220 220
 
221 221
 		// Is there is field merge tag? Strip whitespace off the ned, too.
222 222
 		preg_match_all( '/{' . preg_quote( $this->_custom_merge_tag ) . ':?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER );
@@ -247,19 +247,19 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
249 249
 
250
-		foreach( $matches as $match ) {
250
+		foreach ( $matches as $match ) {
251 251
 
252
-			$full_tag = $match[0];
252
+			$full_tag = $match[ 0 ];
253 253
 
254 254
 			// Strip the Merge Tags
255
-			$tag = str_replace( array( '{', '}'), '', $full_tag );
255
+			$tag = str_replace( array( '{', '}' ), '', $full_tag );
256 256
 
257 257
 			// Replace the value from the entry, if exists
258
-			if( isset( $entry[ $tag ] ) ) {
258
+			if ( isset( $entry[ $tag ] ) ) {
259 259
 
260 260
 				$value = $entry[ $tag ];
261 261
 
262
-				if( is_callable( array( $this, 'get_content') ) ) {
262
+				if ( is_callable( array( $this, 'get_content' ) ) ) {
263 263
 					$value = $this->get_content( $value );
264 264
 				}
265 265
 
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
 	 */
333 333
 	public function _filter_sortable_fields( $not_sortable ) {
334 334
 
335
-		if( ! $this->is_sortable ) {
336
-			$not_sortable[] = $this->name;
335
+		if ( ! $this->is_sortable ) {
336
+			$not_sortable[ ] = $this->name;
337 337
 		}
338 338
 
339 339
 		return $not_sortable;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	function add_entry_meta( $entry_meta ) {
352 352
 
353
-		if( ! isset( $entry_meta["{$this->entry_meta_key}"] ) ) {
353
+		if ( ! isset( $entry_meta[ "{$this->entry_meta_key}" ] ) ) {
354 354
 
355 355
 			$added_meta = array(
356 356
 				'label'             => $this->label,
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 			);
360 360
 
361 361
 			if ( $this->entry_meta_update_callback && is_callable( $this->entry_meta_update_callback ) ) {
362
-				$added_meta['update_entry_meta_callback'] = $this->entry_meta_update_callback;
362
+				$added_meta[ 'update_entry_meta_callback' ] = $this->entry_meta_update_callback;
363 363
 			}
364 364
 
365
-			$entry_meta["{$this->entry_meta_key}"] = $added_meta;
365
+			$entry_meta[ "{$this->entry_meta_key}" ] = $added_meta;
366 366
 
367 367
 		} else {
368
-			do_action( 'gravityview_log_error', __METHOD__ . ' Entry meta already set: ' . $this->entry_meta_key, $entry_meta["{$this->entry_meta_key}"] );
368
+			do_action( 'gravityview_log_error', __METHOD__ . ' Entry meta already set: ' . $this->entry_meta_key, $entry_meta[ "{$this->entry_meta_key}" ] );
369 369
 		}
370 370
 
371 371
 		return $entry_meta;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 			'date_display' => array(
395 395
 				'type' => 'text',
396 396
 				'label' => __( 'Override Date Format', 'gravityview' ),
397
-				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
397
+				'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ),
398 398
 				/**
399 399
 				 * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time)
400 400
 				 * @param[in,out] null|string $date_format Date Format (default: null)
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 
420 420
 		$options = $this->field_support_options();
421 421
 
422
-		if( isset( $options[ $key ] ) ) {
422
+		if ( isset( $options[ $key ] ) ) {
423 423
 			$field_options[ $key ] = $options[ $key ];
424 424
 		}
425 425
 
@@ -483,11 +483,11 @@  discard block
 block discarded – undo
483 483
 		$connected_form = rgpost( 'form_id' );
484 484
 
485 485
 		// Otherwise, get the Form ID from the Post page
486
-		if( empty( $connected_form ) ) {
486
+		if ( empty( $connected_form ) ) {
487 487
 			$connected_form = gravityview_get_form_id( get_the_ID() );
488 488
 		}
489 489
 
490
-		if( empty( $connected_form ) ) {
490
+		if ( empty( $connected_form ) ) {
491 491
 			do_action( 'gravityview_log_error', sprintf( '%s: Form not found for form ID "%s"', __METHOD__, $connected_form ) );
492 492
 			return false;
493 493
 		}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-image.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 
24 24
 	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
25 25
 
26
-		unset ( $field_options['search_filter'] );
26
+		unset ( $field_options[ 'search_filter' ] );
27 27
 
28
-		if( 'edit' === $context ) {
28
+		if ( 'edit' === $context ) {
29 29
 			return $field_options;
30 30
 		}
31 31
 
32
-		$this->add_field_support('link_to_post', $field_options );
32
+		$this->add_field_support( 'link_to_post', $field_options );
33 33
 
34 34
 		// @since 1.5.4
35
-		$this->add_field_support('dynamic_data', $field_options );
35
+		$this->add_field_support( 'dynamic_data', $field_options );
36 36
 
37 37
 		return $field_options;
38 38
 	}
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$url = $title = $caption = $description = '';
60 60
 
61 61
 		// If there's a |:| match, process. Otherwise, empty array!
62
-		if( preg_match( '/\|\:\|/', $value ) ) {
62
+		if ( preg_match( '/\|\:\|/', $value ) ) {
63 63
 			list( $url, $title, $caption, $description ) = array_pad( explode( '|:|', $value ), 4, false );
64 64
 		}
65 65
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function get_field_input( $form, $value = '', $entry = null, GF_Field_Post_Image $field ) {
90 90
 
91
-		$id = (int) $field->id;
92
-		$form_id = $form['id'];
91
+		$id = (int)$field->id;
92
+		$form_id = $form[ 'id' ];
93 93
 		$input_name = "input_{$id}";
94 94
 		$field_id = sprintf( 'input_%d_%d', $form_id, $id );
95 95
 		$img_name = null;
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 		// Convert |:| to associative array
98 98
 		$img_array = self::explode_value( $value );
99 99
 
100
-		if( ! empty( $img_array['url'] ) ) {
100
+		if ( ! empty( $img_array[ 'url' ] ) ) {
101 101
 
102
-			$img_name = basename( $img_array['url'] );
102
+			$img_name = basename( $img_array[ 'url' ] );
103 103
 
104 104
 			/**
105 105
 			 * Set the $uploaded_files value so that the .ginput_preview renders, and the file upload is hidden
106 106
 			 * @see GF_Field_Post_Image::get_field_input See the `<span class='ginput_preview'>` code
107 107
 			 * @see GFFormsModel::get_temp_filename See the `rgget( $input_name, self::$uploaded_files[ $form_id ] );` code
108 108
 			 */
109
-			if( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
109
+			if ( empty( GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] ) ) {
110 110
 				GFFormsModel::$uploaded_files[ $form_id ][ $input_name ] = $img_name;
111 111
 			}
112 112
 		}
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 		 * @hack
136 136
 		 */
137 137
 		if ( null !== $img_name ) {
138
-			$current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array['url'] ) );
139
-			$gf_post_image_field_output = str_replace('<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>'.$current_file, $gf_post_image_field_output );
138
+			$current_file = sprintf( "<input name='%s' id='%s' type='hidden' value='%s' />", $input_name, $field_id, esc_url_raw( $img_array[ 'url' ] ) );
139
+			$gf_post_image_field_output = str_replace( '<span class=\'ginput_preview\'>', '<span class=\'ginput_preview\'>' . $current_file, $gf_post_image_field_output );
140 140
 		}
141 141
 
142 142
 		return $gf_post_image_field_output;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-multiselect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 * @see GFCommon::get_field_filter_settings Gravity Forms suggests checkboxes should just be "contains"
14 14
 	 * @var array
15 15
 	 */
16
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
16
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
17 17
 
18 18
 	var $is_searchable = true;
19 19
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	var $is_searchable = true;
13 13
 
14
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
14
+	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains' );
15 15
 
16 16
 	var $_gf_field_class_name = 'GF_Field_Radio';
17 17
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 		// Set the $_field_id var
41 41
 		$field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type );
42 42
 		
43
-		if( $this->is_choice_value_enabled() ) {
44
-			$field_options['choice_display'] = array(
43
+		if ( $this->is_choice_value_enabled() ) {
44
+			$field_options[ 'choice_display' ] = array(
45 45
 				'type'    => 'radio',
46 46
 				'value'   => 'value',
47 47
 				'label'   => __( 'What should be displayed:', 'gravityview' ),
Please login to merge, or discard this patch.