Completed
Pull Request — master (#1147)
by Gennady
20:27 queued 16:17
created
includes/fields/class-gravityview-field-hidden.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
 	function edit_entry_fix_hidden_fields( $fields ) {
50 50
 
51 51
 		/** @var GF_Field $field */
52
-		foreach( $fields as &$field ) {
52
+		foreach ( $fields as &$field ) {
53 53
 			if ( 'hidden' === $field->type ) {
54 54
 
55 55
 				/**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 				 */
61 61
 				$reveal_hidden_field = apply_filters( 'gravityview/edit_entry/reveal_hidden_field', true, $field );
62 62
 
63
-				if( ! $reveal_hidden_field ) {
63
+				if ( ! $reveal_hidden_field ) {
64 64
 					continue;
65 65
 				}
66 66
 
Please login to merge, or discard this patch.
future/_mocks.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -10,6 +10,7 @@  discard block
 block discarded – undo
10 10
  * @internal
11 11
  * @since 2.0
12 12
  *
13
+ * @param \GravityView_View_Data $_this
13 14
  * @return array|false The old array data, or false on error.
14 15
  */
15 16
 function GravityView_View_Data_add_view( $view_id, $atts, $_this ) {
@@ -62,6 +63,8 @@  discard block
 block discarded – undo
62 63
  * @internal
63 64
  * @since 2.0
64 65
  *
66
+ * @param integer $form_id
67
+ * @param integer $count
65 68
  * @return array The old associative array data as returned by
66 69
  *  \GravityView_frontend::get_view_entries(), the paging parameters
67 70
  *  and a total count of all entries.
@@ -155,6 +158,7 @@  discard block
 block discarded – undo
155 158
  * @internal
156 159
  * @since 2.0
157 160
  *
161
+ * @param string $format
158 162
  * @return null|string The value of a field in an entry.
159 163
  */
160 164
 function GravityView_API_field_value( $entry, $field_settings, $format ) {
Please login to merge, or discard this patch.
Spacing   +43 added lines, -46 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@  discard block
 block discarded – undo
101 101
 			$entries = $view->get_entries( gravityview()->request );
102 102
 		}
103 103
 
104
-		$page = \GV\Utils::get( $parameters['paging'], 'current_page' ) ?
105
-			: ( ( ( $parameters['paging']['offset'] - $view->settings->get( 'offset' ) ) / $parameters['paging']['page_size'] ) + 1 );
104
+		$page = \GV\Utils::get( $parameters[ 'paging' ], 'current_page' ) ?: ( ( ( $parameters[ 'paging' ][ 'offset' ] - $view->settings->get( 'offset' ) ) / $parameters[ 'paging' ][ 'page_size' ] ) + 1 );
106 105
 
107 106
 		/** Set paging, count and unwrap the entries. */
108 107
 		$paging = array(
@@ -141,16 +140,16 @@  discard block
 block discarded – undo
141 140
  * @return null|string The value of a field in an entry.
142 141
  */
143 142
 function GravityView_API_field_value( $entry, $field_settings, $format ) {
144
-	if ( empty( $entry['form_id'] ) || empty( $field_settings['id'] ) ) {
143
+	if ( empty( $entry[ 'form_id' ] ) || empty( $field_settings[ 'id' ] ) ) {
145 144
 		gravityview()->log->error( 'No entry or field_settings[id] supplied', array( 'data' => array( func_get_args() ) ) );
146 145
 		return null;
147 146
 	}
148 147
 
149
-	if ( ! empty( $entry['_multi'] ) && ! empty( $field_settings['form_id'] ) && ! empty( $entry['_multi'][ $field_settings['form_id'] ] ) ) {
150
-		$entry = $entry['_multi'][ $field_settings['form_id'] ];
148
+	if ( ! empty( $entry[ '_multi' ] ) && ! empty( $field_settings[ 'form_id' ] ) && ! empty( $entry[ '_multi' ][ $field_settings[ 'form_id' ] ] ) ) {
149
+		$entry = $entry[ '_multi' ][ $field_settings[ 'form_id' ] ];
151 150
 	}
152 151
 
153
-	if ( empty( $entry['id'] ) || ! $entry = \GV\GF_Entry::by_id( $entry['id'] ) ) {
152
+	if ( empty( $entry[ 'id' ] ) || ! $entry = \GV\GF_Entry::by_id( $entry[ 'id' ] ) ) {
154 153
 		gravityview()->log->error( 'Invalid \GV\GF_Entry supplied', array( 'data' => $entry ) );
155 154
 		return null;
156 155
 	}
@@ -160,18 +159,18 @@  discard block
 block discarded – undo
160 159
 	 *
161 160
 	 * Fields with a numeric ID are Gravity Forms ones.
162 161
 	 */
163
-	$source = is_numeric( $field_settings['id'] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;;
162
+	$source = is_numeric( $field_settings[ 'id' ] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL; ;
164 163
 
165 164
 	/** Initialize the future field. */
166 165
 	switch ( $source ):
167 166
 		/** The Gravity Forms backend. */
168 167
 		case \GV\Source::BACKEND_GRAVITYFORMS:
169
-			if ( ! $form = \GV\GF_Form::by_id( $entry['form_id'] ) ) {
168
+			if ( ! $form = \GV\GF_Form::by_id( $entry[ 'form_id' ] ) ) {
170 169
 				gravityview()->log->error( 'No form Gravity Form found for entry', array( 'data' => $entry ) );
171 170
 				return null;
172 171
 			}
173 172
 
174
-			if ( ! $field = $form::get_field( $form, $field_settings['id'] ) ) {
173
+			if ( ! $field = $form::get_field( $form, $field_settings[ 'id' ] ) ) {
175 174
 				return null;
176 175
 			}
177 176
 
@@ -179,7 +178,7 @@  discard block
 block discarded – undo
179 178
 
180 179
 		/** Our internal backend. */
181 180
 		case \GV\Source::BACKEND_INTERNAL:
182
-			if ( ! $field = \GV\Internal_Source::get_field( $field_settings['id'] ) ) {
181
+			if ( ! $field = \GV\Internal_Source::get_field( $field_settings[ 'id' ] ) ) {
183 182
 				return null;
184 183
 			}
185 184
 
@@ -213,13 +212,13 @@  discard block
 block discarded – undo
213 212
 
214 213
 	/** A bail condition. */
215 214
 	$bail = function( $label, $field_settings, $entry, $force_show_label, $form ) {
216
-		if ( ! empty( $field_settings['show_label'] ) || $force_show_label ) {
215
+		if ( ! empty( $field_settings[ 'show_label' ] ) || $force_show_label ) {
217 216
 
218
-			$label = isset( $field_settings['label'] ) ? $field_settings['label'] : '';
217
+			$label = isset( $field_settings[ 'label' ] ) ? $field_settings[ 'label' ] : '';
219 218
 
220 219
 			// Use Gravity Forms label by default, but if a custom label is defined in GV, use it.
221
-			if ( ! empty( $field_settings['custom_label'] ) ) {
222
-				$label = \GravityView_API::replace_variables( $field_settings['custom_label'], $form, $entry );
220
+			if ( ! empty( $field_settings[ 'custom_label' ] ) ) {
221
+				$label = \GravityView_API::replace_variables( $field_settings[ 'custom_label' ], $form, $entry );
223 222
 			}
224 223
 
225 224
 			/**
@@ -245,19 +244,19 @@  discard block
 block discarded – undo
245 244
 
246 245
 	$label = '';
247 246
 
248
-	if ( ! empty( $entry['_multi'] ) && ! empty( $field_settings['form_id'] ) && ! empty( $entry['_multi'][ $field_settings['form_id'] ] ) ) {
249
-		$entry = $entry['_multi'][ $field_settings['form_id'] ];
250
-		if ( $_form = \GV\GF_Form::by_id( $field_settings['form_id'] ) ) {
247
+	if ( ! empty( $entry[ '_multi' ] ) && ! empty( $field_settings[ 'form_id' ] ) && ! empty( $entry[ '_multi' ][ $field_settings[ 'form_id' ] ] ) ) {
248
+		$entry = $entry[ '_multi' ][ $field_settings[ 'form_id' ] ];
249
+		if ( $_form = \GV\GF_Form::by_id( $field_settings[ 'form_id' ] ) ) {
251 250
 			$form = $_form->form;
252 251
 		}
253 252
 	}
254 253
 
255
-	if ( empty( $entry['form_id'] ) || empty( $field_settings['id'] ) ) {
254
+	if ( empty( $entry[ 'form_id' ] ) || empty( $field_settings[ 'id' ] ) ) {
256 255
 		gravityview()->log->error( 'No entry or field_settings[id] supplied', array( 'data' => array( func_get_args() ) ) );
257 256
 		return $bail( $label, $field_settings, $entry, $force_show_label, $form );
258 257
 	}
259 258
 
260
-	if ( empty( $entry['id'] ) || ! $gv_entry = \GV\GF_Entry::by_id( $entry['id'] ) ) {
259
+	if ( empty( $entry[ 'id' ] ) || ! $gv_entry = \GV\GF_Entry::by_id( $entry[ 'id' ] ) ) {
261 260
 		gravityview()->log->error( 'Invalid \GV\GF_Entry supplied', array( 'data' => $entry ) );
262 261
 		return $bail( $label, $field_settings, $entry, $force_show_label, $form );
263 262
 	}
@@ -269,31 +268,31 @@  discard block
 block discarded – undo
269 268
 	 *
270 269
 	 * Fields with a numeric ID are Gravity Forms ones.
271 270
 	 */
272
-	$source = is_numeric( $field_settings['id'] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;
271
+	$source = is_numeric( $field_settings[ 'id' ] ) ? \GV\Source::BACKEND_GRAVITYFORMS : \GV\Source::BACKEND_INTERNAL;
273 272
 
274 273
 	/** Initialize the future field. */
275 274
 	switch ( $source ):
276 275
 		/** The Gravity Forms backend. */
277 276
 		case \GV\Source::BACKEND_GRAVITYFORMS:
278
-			if ( ! $gf_form = \GV\GF_Form::by_id( $entry['form_id'] ) ) {
277
+			if ( ! $gf_form = \GV\GF_Form::by_id( $entry[ 'form_id' ] ) ) {
279 278
 				gravityview()->log->error( 'No form Gravity Form found for entry', array( 'data' => $entry ) );
280 279
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $form );
281 280
 			}
282 281
 
283
-			if ( ! $field = $gf_form::get_field( $gf_form, $field_settings['id'] ) ) {
284
-				gravityview()->log->error( 'No field found for specified form and field ID #{field_id}', array( 'field_id' => $field_settings['id'], 'data' => $form ) );
282
+			if ( ! $field = $gf_form::get_field( $gf_form, $field_settings[ 'id' ] ) ) {
283
+				gravityview()->log->error( 'No field found for specified form and field ID #{field_id}', array( 'field_id' => $field_settings[ 'id' ], 'data' => $form ) );
285 284
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $gf_form->form );
286 285
 			}
287
-			if ( empty( $field_settings['show_label'] ) ) {
286
+			if ( empty( $field_settings[ 'show_label' ] ) ) {
288 287
 				/** The label never wins... */
289
-				$field_settings['label'] = '';
288
+				$field_settings[ 'label' ] = '';
290 289
 			}
291 290
 
292 291
 			break;
293 292
 
294 293
 		/** Our internal backend. */
295 294
 		case \GV\Source::BACKEND_INTERNAL:
296
-			if ( ! $field = \GV\Internal_Source::get_field( $field_settings['id'] ) ) {
295
+			if ( ! $field = \GV\Internal_Source::get_field( $field_settings[ 'id' ] ) ) {
297 296
 				return $bail( $label, $field_settings, $entry->as_entry(), $force_show_label, $form );
298 297
 			}
299 298
 			break;
@@ -305,8 +304,8 @@  discard block
 block discarded – undo
305 304
 			break;
306 305
 	endswitch;
307 306
 
308
-	if( $force_show_label ) {
309
-		$field_settings['show_label'] = '1';
307
+	if ( $force_show_label ) {
308
+		$field_settings[ 'show_label' ] = '1';
310 309
 	}
311 310
 
312 311
 	/** Add the field settings. */
@@ -440,7 +439,7 @@  discard block
 block discarded – undo
440 439
 			'\GravityView_frontend::entry' => \GravityView_frontend::getInstance()->getEntry(),
441 440
 			'\GravityView_View::_current_entry' => \GravityView_View::getInstance()->getCurrentEntry(),
442 441
 			'\GravityView_View::fields' => \GravityView_View::getInstance()->getFields(),
443
-			'wp_actions[loop_start]' => empty( $wp_actions['loop_start'] ) ? 0 : $wp_actions['loop_start'],
442
+			'wp_actions[loop_start]' => empty( $wp_actions[ 'loop_start' ] ) ? 0 : $wp_actions[ 'loop_start' ],
444 443
 			'wp_query::in_the_loop' => $wp_query->in_the_loop,
445 444
 		);
446 445
 	}
@@ -522,7 +521,7 @@  discard block
 block discarded – undo
522 521
 					break;
523 522
 				case 'wp_actions[loop_start]':
524 523
 					global $wp_actions;
525
-					$wp_actions['loop_start'] = $value;
524
+					$wp_actions[ 'loop_start' ] = $value;
526 525
 					break;
527 526
 				case 'wp_query::in_the_loop':
528 527
 					global $wp_query;
@@ -600,9 +599,7 @@  discard block
 block discarded – undo
600 599
 				case 'request':
601 600
 					self::thaw( array(
602 601
 						'\GravityView_View::context' => (
603
-							$value->is_entry() ? 'single' :
604
-								( $value->is_edit_entry() ? 'edit' :
605
-									( $value->is_view() ? 'directory': null )
602
+							$value->is_entry() ? 'single' : ( $value->is_edit_entry() ? 'edit' : ( $value->is_view() ? 'directory' : null )
606 603
 								)
607 604
 						),
608 605
 						'\GravityView_frontend::is_search' => $value->is_search(),
@@ -656,14 +653,14 @@  discard block
 block discarded – undo
656 653
 		global $wp_query, $wp_actions;
657 654
 
658 655
 		$wp_query->in_the_loop = false;
659
-		$wp_actions['loop_start'] = 0;
656
+		$wp_actions[ 'loop_start' ] = 0;
660 657
 	}
661 658
 }
662 659
 
663 660
 
664 661
 /** Add some global fix for field capability discrepancies. */
665 662
 add_filter( 'gravityview/configuration/fields', function( $fields ) {
666
-	if ( empty( $fields  ) ) {
663
+	if ( empty( $fields ) ) {
667 664
 		return $fields;
668 665
 	}
669 666
 
@@ -690,11 +687,11 @@  discard block
 block discarded – undo
690 687
 		}
691 688
 
692 689
 		foreach ( $_fields as $uid => &$_field ) {
693
-			if ( ! isset( $_field['only_loggedin'] ) ) {
690
+			if ( ! isset( $_field[ 'only_loggedin' ] ) ) {
694 691
 				continue;
695 692
 			}
696 693
 			/** If we do not require login, we don't require a cap. */
697
-			$_field['only_loggedin'] != '1' && ( $_field['only_loggedin_cap'] = '' );
694
+			$_field[ 'only_loggedin' ] != '1' && ( $_field[ 'only_loggedin_cap' ] = '' );
698 695
 		}
699 696
 	}
700 697
 	return $fields;
@@ -725,8 +722,8 @@  discard block
 block discarded – undo
725 722
 		}
726 723
 
727 724
 		foreach ( $_fields as $uid => &$_field ) {
728
-			if ( ! empty( $_field['id'] ) && is_numeric( $_field['id'] ) && empty( $_field['form_id'] ) ) {
729
-				$_field['form_id'] = $view->form->ID;
725
+			if ( ! empty( $_field[ 'id' ] ) && is_numeric( $_field[ 'id' ] ) && empty( $_field[ 'form_id' ] ) ) {
726
+				$_field[ 'form_id' ] = $view->form->ID;
730 727
 			}
731 728
 		}
732 729
 	}
@@ -740,25 +737,25 @@  discard block
 block discarded – undo
740 737
 	if ( class_exists( '\GravityView_frontend' ) ) {
741 738
 		global $wp_filter;
742 739
 
743
-		if ( empty( $wp_filter['gravityview_after'] ) ) {
740
+		if ( empty( $wp_filter[ 'gravityview_after' ] ) ) {
744 741
 			return;
745 742
 		}
746 743
 
747 744
 		/** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */
748
-		if ( is_array( $wp_filter['gravityview_after'] ) ) {
749
-			if ( ! empty( $wp_filter['gravityview_after'][10] ) ) {
750
-				foreach ( $wp_filter['gravityview_after'][10] as $function_key => $callback ) {
745
+		if ( is_array( $wp_filter[ 'gravityview_after' ] ) ) {
746
+			if ( ! empty( $wp_filter[ 'gravityview_after' ][ 10 ] ) ) {
747
+				foreach ( $wp_filter[ 'gravityview_after' ][ 10 ] as $function_key => $callback ) {
751 748
 					if ( strpos( $function_key, 'context_not_configured_warning' ) ) {
752
-						unset( $wp_filter['gravityview_after'][10][ $function_key ] );
749
+						unset( $wp_filter[ 'gravityview_after' ][ 10 ][ $function_key ] );
753 750
 					}
754 751
 				}
755 752
 			}
756 753
 			return;
757 754
 		}
758 755
 
759
-		foreach ( $wp_filter['gravityview_after']->callbacks[10] as $function_key => $callback ) {
756
+		foreach ( $wp_filter[ 'gravityview_after' ]->callbacks[ 10 ] as $function_key => $callback ) {
760 757
 			if ( strpos( $function_key, 'context_not_configured_warning' ) ) {
761
-				unset( $wp_filter['gravityview_after']->callbacks[10][ $function_key ] );
758
+				unset( $wp_filter[ 'gravityview_after' ]->callbacks[ 10 ][ $function_key ] );
762 759
 			}
763 760
 		}
764 761
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-extension.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 * - Checks PHP version numbers
208 208
 	 * - Sets self::$is_compatible[__CLASS__] to boolean value
209 209
 	 *
210
-	 * @return boolean Is the extension supported?
210
+	 * @return boolean|null Is the extension supported?
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	/**
330 330
 	 * Add a notice to be displayed in the admin.
331 331
 	 *
332
-	 * @param array $notice Array with `class` and `message` keys. The message is not escaped.
332
+	 * @param string $notice Array with `class` and `message` keys. The message is not escaped.
333 333
 	 *
334 334
 	 * @return void
335 335
 	 */
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -291,7 +291,7 @@
 block discarded – undo
291 291
 	public function settings() {
292 292
 
293 293
 		// If doing ajax, get outta here
294
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) )  {
294
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) {
295 295
 			return;
296 296
 		}
297 297
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -305,13 +305,13 @@
 block discarded – undo
305 305
 			$this->_remote_update_url,
306 306
 			$this->_path,
307 307
 			array(
308
-            	'version'	=> $this->_version, // current version number
309
-            	'license'	=> \GV\Utils::get( $license, 'license_key', $license['license'] ),
310
-	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
312
-            	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
-          	)
314
-        );
308
+				'version'	=> $this->_version, // current version number
309
+				'license'	=> \GV\Utils::get( $license, 'license_key', $license['license'] ),
310
+				'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
+				'item_name' => $this->_title,  // name of this plugin
312
+				'author' 	=> strip_tags( $this->_author )  // author of this plugin
313
+		  	)
314
+		);
315 315
 	}
316 316
 
317 317
 	/**
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
 		$tab = wp_parse_args( $tab_settings, $tab_defaults );
181 181
 
182 182
 		// Force the screen to be GravityView
183
-		$tab['screen'] = 'gravityview';
183
+		$tab[ 'screen' ] = 'gravityview';
184 184
 
185 185
 		if ( class_exists( 'GravityView_Metabox_Tab' ) ) {
186
-			$metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] );
186
+			$metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] );
187 187
 			\GravityView_Metabox_Tabs::add( $metabox );
188 188
 		} else {
189
-			add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] );
189
+			add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] );
190 190
 		}
191 191
 	}
192 192
 
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	protected function is_extension_supported() {
213 213
 
214
-		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible );
214
+		self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible );
215 215
 
216 216
 		if ( ! function_exists( 'gravityview' ) ) {
217 217
 			$message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) );
218
-		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) {
219
-			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' );
220
-		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) {
221
-			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' );
218
+		} else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) {
219
+			$message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' );
220
+		} else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) {
221
+			$message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' );
222 222
 		} else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) {
223 223
 			$message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) );
224 224
 		} else {
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$locale = get_locale();
260 260
 
261
-		if ( function_exists('get_user_locale') && is_admin() ) {
261
+		if ( function_exists( 'get_user_locale' ) && is_admin() ) {
262 262
 			$locale = get_user_locale();
263 263
 		}
264 264
 
265 265
 		// Traditional WordPress plugin locale filter
266
-		$locale = apply_filters( 'plugin_locale',  $locale, $this->_text_domain );
266
+		$locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain );
267 267
 
268 268
 		$mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale );
269 269
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	public function settings() {
292 292
 
293 293
 		// If doing ajax, get outta here
294
-		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) )  {
294
+		if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) {
295 295
 			return;
296 296
 		}
297 297
 
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 			$this->_path,
307 307
 			array(
308 308
             	'version'	=> $this->_version, // current version number
309
-            	'license'	=> \GV\Utils::get( $license, 'license_key', $license['license'] ),
309
+            	'license'	=> \GV\Utils::get( $license, 'license_key', $license[ 'license' ] ),
310 310
 	            'item_id'   => $this->_item_id, // The ID of the download on _remote_update_url
311
-            	'item_name' => $this->_title,  // name of this plugin
311
+            	'item_name' => $this->_title, // name of this plugin
312 312
             	'author' 	=> strip_tags( $this->_author )  // author of this plugin
313 313
           	)
314 314
         );
@@ -337,16 +337,16 @@  discard block
 block discarded – undo
337 337
 	 */
338 338
 	public static function add_notice( $notice = array() ) {
339 339
 
340
-		if ( is_array( $notice ) && empty( $notice['message'] ) ) {
340
+		if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) {
341 341
 			gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) );
342 342
 			return;
343 343
 		} else if ( is_string( $notice ) ) {
344 344
 			$notice = array( 'message' => $notice );
345 345
 		}
346 346
 
347
-		$notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class'];
347
+		$notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ];
348 348
 
349
-		self::$admin_notices []= $notice;
349
+		self::$admin_notices [ ] = $notice;
350 350
 	}
351 351
 
352 352
 	/**
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 		}
361 361
 
362 362
 		foreach ( self::$admin_notices as $key => $notice ) {
363
-			echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">';
364
-			echo wpautop( $notice['message'] );
363
+			echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">';
364
+			echo wpautop( $notice[ 'message' ] );
365 365
 			echo '<div class="clear"></div>';
366 366
 			echo '</div>';
367 367
 		}
Please login to merge, or discard this patch.
future/includes/class-gv-field-gravityforms.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 	 * @param \GV\GF_Form $form The Gravity Form form.
55 55
 	 * @param int $field_id The Gravity Form field ID for the $form.
56 56
 	 *
57
-	 * @return \GV\Field|null The requested field or null if not found.
57
+	 * @return null|GF_Field The requested field or null if not found.
58 58
 	 */
59 59
 	public static function by_id( $form, $field_id ) {
60 60
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
 	 * @return \GV\GF_Field|null The field implementation or null on error.
28 28
 	 */
29 29
 	public static function from_configuration( $configuration ) {
30
-		if ( empty( $configuration['id'] ) || ! is_numeric( $configuration['id'] ) ) {
30
+		if ( empty( $configuration[ 'id' ] ) || ! is_numeric( $configuration[ 'id' ] ) ) {
31 31
 			gravityview()->log->error( 'Invalid configuration[id] supplied.' );
32 32
 			return null;
33 33
 		}
34 34
 
35
-		if ( empty( $configuration['form_id'] ) || ! $form = \GV\GF_Form::by_id( $configuration['form_id'] )  ) {
35
+		if ( empty( $configuration[ 'form_id' ] ) || ! $form = \GV\GF_Form::by_id( $configuration[ 'form_id' ] ) ) {
36 36
 			gravityview()->log->error( 'Invalid configuration[form_id] supplied.' );
37 37
 			return null;
38 38
 		}
39 39
 
40
-		$field = self::by_id( $form, $configuration['id'] );
40
+		$field = self::by_id( $form, $configuration[ 'id' ] );
41 41
 
42 42
 		if ( ! $field ) {
43 43
 			gravityview()->log->error( 'Invalid configuration[id] supplied.' );
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 		/** This is a complex Gravity Forms input. */
113 113
 		if ( $input = \GFFormsModel::get_input( $this->field, $this->ID ) ) {
114
-			$label = ! empty( $input['customLabel'] ) ? $input['customLabel'] : $input['label'];
114
+			$label = ! empty( $input[ 'customLabel' ] ) ? $input[ 'customLabel' ] : $input[ 'label' ];
115 115
 		} else {
116 116
 			/** This is a field with one label. */
117 117
 			$label = $this->field->get_field_label( true, $this->label );
Please login to merge, or discard this patch.
future/includes/class-gv-form-gravityforms.php 2 patches
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -132,10 +132,8 @@
 block discarded – undo
132 132
 	/**
133 133
 	 * Get a \GV\Field by Form and Field ID for this data source.
134 134
 	 *
135
-	 * @param \GV\GF_Form $form The Gravity Form form ID.
136
-	 * @param int $field_id The Gravity Form field ID for the $form_id.
137 135
 	 *
138
-	 * @return \GV\Field|null The requested field or null if not found.
136
+	 * @return null|GF_Field The requested field or null if not found.
139 137
 	 */
140 138
 	public static function get_field( /** varargs */ ) {
141 139
 		$args = func_get_args();
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$self = new self();
56 56
 		$self->form = $form;
57 57
 
58
-		$self->ID = intval( $self->form['id'] );
58
+		$self->ID = intval( $self->form[ 'id' ] );
59 59
 
60 60
 		return $self;
61 61
 	}
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	 * @return \GV\GF_Form|null An instance of this form or null if not found.
71 71
 	 */
72 72
 	public static function from_form( $form ) {
73
-		if ( empty( $form['id'] ) ) {
73
+		if ( empty( $form[ 'id' ] ) ) {
74 74
 			return null;
75 75
 		}
76 76
 
77 77
 		$self = new self();
78 78
 		$self->form = $form;
79
-		$self->ID = $self->form['id'];
79
+		$self->ID = $self->form[ 'id' ];
80 80
 
81 81
 		return $self;
82 82
 	}
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 
120 120
 			/** The offset and limit */
121 121
 			if ( ! empty( $offset->limit ) ) {
122
-				$paging['page_size'] = $offset->limit;
122
+				$paging[ 'page_size' ] = $offset->limit;
123 123
 			}
124 124
 
125 125
 			if ( ! empty( $offset->offset ) ) {
126
-				$paging['offset'] = $offset->offset;
126
+				$paging[ 'offset' ] = $offset->offset;
127 127
 			}
128 128
 
129 129
 			foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) {
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public function get_fields() {
182 182
 		$fields = array();
183
-		foreach ( $this['fields'] as $field ) {
184
-			foreach ( empty( $field['inputs'] ) ? array( $field['id'] ) : wp_list_pluck( $field['inputs'], 'id' ) as $id ) {
183
+		foreach ( $this[ 'fields' ] as $field ) {
184
+			foreach ( empty( $field[ 'inputs' ] ) ? array( $field[ 'id' ] ) : wp_list_pluck( $field[ 'inputs' ], 'id' ) as $id ) {
185 185
 				if ( is_numeric( $id ) ) {
186 186
 					$fields[ $id ] = self::get_field( $this, $id );
187 187
 				} else {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @return bool Whether the offset exists or not.
219 219
 	 */
220 220
 	public function offsetExists( $offset ) {
221
-		return isset( $this->form[$offset] );
221
+		return isset( $this->form[ $offset ] );
222 222
 	}
223 223
 
224 224
 	/**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 * @return mixed The value of the requested form data.
234 234
 	 */
235 235
 	public function offsetGet( $offset ) {
236
-		return $this->form[$offset];
236
+		return $this->form[ $offset ];
237 237
 	}
238 238
 
239 239
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-settings.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	 * Set an setting.
65 65
 	 *
66 66
 	 * @param mixed $key The key in this setting to retrieve.
67
-	 * @param mixed $default A default in case the key is not set. 
67
+	 * @param false|null $default A default in case the key is not set. 
68 68
 	 *
69 69
 	 * @api
70 70
 	 * @since 2.0
Please login to merge, or discard this patch.
future/includes/class-gv-template-entry-table.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 	 *
23 23
 	 * @param \GV\Field $field The field to be ouput.
24 24
 	 *
25
-	 * @return string|false The field output or false if "hide_empty" is set.
25
+	 * @return null|string The field output or false if "hide_empty" is set.
26 26
 	 */
27 27
 	public function the_field( \GV\Field $field ) {
28 28
 		$renderer = new Field_Renderer();
Please login to merge, or discard this patch.
future/includes/class-gv-template-entry.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,6 @@
 block discarded – undo
63 63
 	 * Initializer.
64 64
 	 *
65 65
 	 * @param \GV\View $view The View connected to this template.
66
-	 * @param \GV\Entry_Collection $entries A collection of entries for this view.
67 66
 	 * @param \GV\Request $request The request context.
68 67
 	 */
69 68
 	public function __construct( Entry $entry, View $view, Request $request ) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -113,18 +113,18 @@
 block discarded – undo
113 113
 		global $post;
114 114
 
115 115
 		if ( ! $this->request->is_view() && $post ) {
116
-			$specifics []= sprintf( '%spost-%d-view-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->entry->ID, $slug_name );
117
-			$specifics []= sprintf( '%spost-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->entry->ID, $slug_name );
118
-			$specifics []= sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
119
-			$specifics []= sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
116
+			$specifics [ ] = sprintf( '%spost-%d-view-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->entry->ID, $slug_name );
117
+			$specifics [ ] = sprintf( '%spost-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->entry->ID, $slug_name );
118
+			$specifics [ ] = sprintf( '%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
119
+			$specifics [ ] = sprintf( '%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
120 120
 		}
121 121
 
122
-		$specifics []= sprintf( '%sview-%d-entry-%d-%s.php', $slug_dir, $this->view->ID, $this->entry->ID, $slug_name );
123
-		$specifics []= sprintf( '%sform-%d-entry-%d-%s.php', $slug_dir, $this->view->form->ID, $this->entry->ID, $slug_name );
124
-		$specifics []= sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
125
-		$specifics []= sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
122
+		$specifics [ ] = sprintf( '%sview-%d-entry-%d-%s.php', $slug_dir, $this->view->ID, $this->entry->ID, $slug_name );
123
+		$specifics [ ] = sprintf( '%sform-%d-entry-%d-%s.php', $slug_dir, $this->view->form->ID, $this->entry->ID, $slug_name );
124
+		$specifics [ ] = sprintf( '%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
125
+		$specifics [ ] = sprintf( '%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
126 126
 
127
-		$specifics []= sprintf( '%sentry-%d-%s.php', $slug_dir, $this->entry->ID, $slug_name );
127
+		$specifics [ ] = sprintf( '%sentry-%d-%s.php', $slug_dir, $this->entry->ID, $slug_name );
128 128
 
129 129
 		return array_merge( $specifics, $templates );
130 130
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-template-legacy-override.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 	 * @param \GV\Field $field The Field.
52 52
 	 * @param \GV\Request $request The request.
53 53
 	 *
54
-	 * @return void
54
+	 * @return string|null
55 55
 	 */
56 56
 	public function __construct( \GV\View $view, \GV\Entry $entry = null, \GV\Field $field = null, \GV\Request $request = null ) {
57 57
 		add_filter( $this->filter_prefix . '_get_template_part', array( $this, 'add_id_specific_templates' ), 10, 3 );
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 		$additional = array();
99 99
 
100 100
 		// form-19-table-body.php
101
-		$additional[] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name );
101
+		$additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name );
102 102
 
103 103
 		// view-3-table-body.php
104
-		$additional[] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name );
104
+		$additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name );
105 105
 
106 106
 		global $post;
107 107
 		if ( $post ) {
108 108
 			// page-19-table-body.php
109
-			$additional[] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name );
109
+			$additional[ ] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name );
110 110
 		}
111 111
 
112 112
 		// Combine with existing table-body.php and table.php
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		ob_start();
131 131
 
132 132
 		$request = new Mock_Request();
133
-		$request->returns['is_view'] = $this->view;
133
+		$request->returns[ 'is_view' ] = $this->view;
134 134
 
135 135
 		/**
136 136
 		 * You got one shot. One opportunity. To render all the widgets you have ever wanted.
@@ -144,17 +144,17 @@  discard block
 block discarded – undo
144 144
 		foreach ( array( 'gravityview_before', 'gravityview_after' ) as $hook ) {
145 145
 			/** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */
146 146
 			if ( is_array( $wp_filter[ $hook ] ) ) {
147
-				if ( ! empty( $wp_filter[ $hook ][10] ) ) {
148
-					foreach ( $wp_filter[ $hook ][10] as $function_key => $callback ) {
147
+				if ( ! empty( $wp_filter[ $hook ][ 10 ] ) ) {
148
+					foreach ( $wp_filter[ $hook ][ 10 ] as $function_key => $callback ) {
149 149
 						if ( strpos( $function_key, 'render_widget_hooks' ) ) {
150
-							unset( $wp_filter[ $hook ][10][ $function_key ] );
150
+							unset( $wp_filter[ $hook ][ 10 ][ $function_key ] );
151 151
 						}
152 152
 					}
153 153
 				}
154 154
 			} else {
155
-				foreach ( $wp_filter[ $hook ]->callbacks[10] as $function_key => $callback ) {
155
+				foreach ( $wp_filter[ $hook ]->callbacks[ 10 ] as $function_key => $callback ) {
156 156
 					if ( strpos( $function_key, 'render_widget_hooks' ) ) {
157
-						unset( $wp_filter[ $hook ]->callbacks[10][ $function_key ] );
157
+						unset( $wp_filter[ $hook ]->callbacks[ 10 ][ $function_key ] );
158 158
 					}
159 159
 				}
160 160
 			}
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		 */
166 166
 		if ( $this->entry ) {
167 167
 
168
-			$request->returns['is_entry'] = $this->entry;
168
+			$request->returns[ 'is_entry' ] = $this->entry;
169 169
 
170 170
 			global $post;
171 171
 
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
 					'fields' => $this->view->fields->by_visible(),
210 210
 					'in_the_loop' => true,
211 211
 				), empty( $parameters ) ? array() : array(
212
-					'paging' => $parameters['paging'],
213
-					'sorting' => $parameters['sorting'],
212
+					'paging' => $parameters[ 'paging' ],
213
+					'sorting' => $parameters[ 'sorting' ],
214 214
 				), $post ? array(
215 215
 					'post' => $post,
216 216
 				) : array() ) );
Please login to merge, or discard this patch.