Completed
Pull Request — master (#836)
by Zack
39:18 queued 19:20
created
future/includes/class-gv-view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 		$supports = array( 'title', 'revisions' );
36 36
 
37 37
 		if ( $is_hierarchical ) {
38
-			$supports[] = 'page-attributes';
38
+			$supports[ ] = 'page-attributes';
39 39
 		}
40 40
 
41 41
 		/**
Please login to merge, or discard this patch.
includes/class-frontend-views.php 2 patches
Doc Comments   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
 	/**
155 155
 	 * Sets the single entry ID and also the entry
156
-	 * @param bool|int|string $single_entry
156
+	 * @param boolean|string $single_entry
157 157
 	 */
158 158
 	public function setSingleEntry( $single_entry ) {
159 159
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 	/**
172 172
 	 * Set the current entry
173
-	 * @param array|int $entry Entry array or entry slug or ID
173
+	 * @param boolean|string $entry Entry array or entry slug or ID
174 174
 	 */
175 175
 	public function setEntry( $entry ) {
176 176
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 *
229 229
 	 *
230 230
 	 *
231
-	 * @param null $view_id
231
+	 * @param string $view_id
232 232
 	 */
233 233
 	public function set_context_view_id( $view_id = null ) {
234 234
 
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 	 *
1106 1106
 	 * @uses  gravityview_get_entries()
1107 1107
 	 * @access public
1108
-	 * @param array $args\n
1108
+	 * @param array $args
1109 1109
 	 *   - $id - View id
1110 1110
 	 *   - $page_size - Page
1111 1111
 	 *   - $sort_field - form field id to sort
@@ -1193,7 +1193,6 @@  discard block
 block discarded – undo
1193 1193
 	 * @since 1.19.5
1194 1194
 	 *
1195 1195
 	 * @param $args
1196
-	 * @param int $form_id
1197 1196
 	 */
1198 1197
 	public static function get_search_criteria_paging( $args ) {
1199 1198
 
@@ -1588,7 +1587,7 @@  discard block
 block discarded – undo
1588 1587
 	/**
1589 1588
 	 * Checks if field (column) is sortable
1590 1589
 	 *
1591
-	 * @param string $field Field settings
1590
+	 * @param string $field_id Field settings
1592 1591
 	 * @param array $form Gravity Forms form array
1593 1592
 	 *
1594 1593
 	 * @since 1.7
Please login to merge, or discard this patch.
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	private function __construct() {}
86 86
 
87 87
 	private function initialize() {
88
-		add_action( 'wp', array( $this, 'parse_content'), 11 );
88
+		add_action( 'wp', array( $this, 'parse_content' ), 11 );
89 89
 		add_filter( 'parse_query', array( $this, 'parse_query_fix_frontpage' ), 10 );
90
-		add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 );
90
+		add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 );
91 91
 
92 92
 		// Enqueue scripts and styles after GravityView_Template::register_styles()
93 93
 		add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 );
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
 
237 237
 			$this->context_view_id = $view_id;
238 238
 
239
-		} elseif ( isset( $_GET['gvid'] ) && $this->getGvOutputData()->has_multiple_views() ) {
239
+		} elseif ( isset( $_GET[ 'gvid' ] ) && $this->getGvOutputData()->has_multiple_views() ) {
240 240
 			/**
241 241
 			 * used on a has_multiple_views context
242 242
 			 * @see GravityView_API::entry_link
243 243
 			 * @see GravityView_View_Data::getInstance()->has_multiple_views()
244 244
 			 */
245
-			$this->context_view_id = $_GET['gvid'];
245
+			$this->context_view_id = $_GET[ 'gvid' ];
246 246
 
247
-		} elseif ( ! $this->getGvOutputData()->has_multiple_views() )  {
247
+		} elseif ( ! $this->getGvOutputData()->has_multiple_views() ) {
248 248
 			$array_keys = array_keys( $this->getGvOutputData()->get_views() );
249 249
 			$this->context_view_id = array_pop( $array_keys );
250 250
 			unset( $array_keys );
@@ -279,24 +279,24 @@  discard block
 block discarded – undo
279 279
 		global $wp_rewrite;
280 280
 
281 281
 		$is_front_page = ( $query->is_home || $query->is_page );
282
-		$show_on_front = ( 'page' === get_option('show_on_front') );
283
-		$front_page_id = get_option('page_on_front');
282
+		$show_on_front = ( 'page' === get_option( 'show_on_front' ) );
283
+		$front_page_id = get_option( 'page_on_front' );
284 284
 
285
-		if (  $is_front_page && $show_on_front && $front_page_id ) {
285
+		if ( $is_front_page && $show_on_front && $front_page_id ) {
286 286
 
287 287
 			// Force to be an array, potentially a query string ( entry=16 )
288 288
 			$_query = wp_parse_args( $query->query );
289 289
 
290 290
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
291
-			if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {
292
-				unset( $_query['pagename'] );
291
+			if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) {
292
+				unset( $_query[ 'pagename' ] );
293 293
 			}
294 294
 
295 295
 			// this is where will break from core wordpress
296 296
 			$ignore = array( 'preview', 'page', 'paged', 'cpage' );
297 297
 			$endpoints = rgobj( $wp_rewrite, 'endpoints' );
298
-			foreach ( (array) $endpoints as $endpoint ) {
299
-				$ignore[] = $endpoint[1];
298
+			foreach ( (array)$endpoints as $endpoint ) {
299
+				$ignore[ ] = $endpoint[ 1 ];
300 300
 			}
301 301
 			unset( $endpoints );
302 302
 
@@ -306,21 +306,21 @@  discard block
 block discarded – undo
306 306
 			// - The query includes keys that are associated with registered endpoints. `entry`, for example.
307 307
 			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) {
308 308
 
309
-				$qv =& $query->query_vars;
309
+				$qv = & $query->query_vars;
310 310
 
311 311
 				// Prevent redirect when on the single entry endpoint
312
-				if( self::is_single_entry() ) {
312
+				if ( self::is_single_entry() ) {
313 313
 					add_filter( 'redirect_canonical', '__return_false' );
314 314
 				}
315 315
 
316 316
 				$query->is_page = true;
317 317
 				$query->is_home = false;
318
-				$qv['page_id']  = $front_page_id;
318
+				$qv[ 'page_id' ]  = $front_page_id;
319 319
 
320 320
 				// Correct <!--nextpage--> for page_on_front
321
-				if ( ! empty( $qv['paged'] ) ) {
322
-					$qv['page'] = $qv['paged'];
323
-					unset( $qv['paged'] );
321
+				if ( ! empty( $qv[ 'paged' ] ) ) {
322
+					$qv[ 'page' ] = $qv[ 'paged' ];
323
+					unset( $qv[ 'paged' ] );
324 324
 				}
325 325
 			}
326 326
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
 		$this->setIsGravityviewPostType( get_post_type( $post ) === 'gravityview' );
355 355
 
356
-		$post_id = $this->getPostId() ? $this->getPostId() : (isset( $post ) ? $post->ID : null );
356
+		$post_id = $this->getPostId() ? $this->getPostId() : ( isset( $post ) ? $post->ID : null );
357 357
 		$this->setPostId( $post_id );
358 358
 		$post_has_shortcode = ! empty( $post->post_content ) ? gravityview_has_shortcode_r( $post->post_content, 'gravityview' ) : false;
359 359
 		$this->setPostHasShortcode( $this->isGravityviewPostType() ? null : ! empty( $post_has_shortcode ) );
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
 		$search_method = GravityView_Widget_Search::getInstance()->get_search_method();
391 391
 
392
-		if( 'post' === $search_method ) {
392
+		if ( 'post' === $search_method ) {
393 393
 			$get = $_POST;
394 394
 		} else {
395 395
 			$get = $_GET;
@@ -445,20 +445,20 @@  discard block
 block discarded – undo
445 445
 		 * @param boolean $in_the_loop Whether to apply the filter to the menu title and the meta tag <title> - outside the loop
446 446
 		 * @param array $entry Current entry
447 447
 		 */
448
-		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop' , in_the_loop(), $entry );
448
+		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop', in_the_loop(), $entry );
449 449
 
450 450
 		if ( ! $apply_outside_loop ) {
451 451
 			return $title;
452 452
 		}
453 453
 
454 454
 		// User reported WooCommerce doesn't pass two args.
455
-		if ( empty( $passed_post_id ) )  {
455
+		if ( empty( $passed_post_id ) ) {
456 456
 			return $title;
457 457
 		}
458 458
 
459 459
 		// Don't modify the title for anything other than the current view/post.
460 460
 		// This is true for embedded shortcodes and Views.
461
-		if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) {
461
+		if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) {
462 462
 			return $title;
463 463
 		}
464 464
 
@@ -468,19 +468,19 @@  discard block
 block discarded – undo
468 468
 			$view_meta = $this->getGvOutputData()->get_view( $context_view_id );
469 469
 		} else {
470 470
 			foreach ( $this->getGvOutputData()->get_views() as $view_id => $view_data ) {
471
-				if ( intval( $view_data['form_id'] ) === intval( $entry['form_id'] ) ) {
471
+				if ( intval( $view_data[ 'form_id' ] ) === intval( $entry[ 'form_id' ] ) ) {
472 472
 					$view_meta = $view_data;
473 473
 					break;
474 474
 				}
475 475
 			}
476 476
 		}
477 477
 
478
-		if ( ! empty( $view_meta['atts']['single_title'] ) ) {
478
+		if ( ! empty( $view_meta[ 'atts' ][ 'single_title' ] ) ) {
479 479
 
480
-			$title = $view_meta['atts']['single_title'];
480
+			$title = $view_meta[ 'atts' ][ 'single_title' ];
481 481
 
482 482
 			// We are allowing HTML in the fields, so no escaping the output
483
-			$title = GravityView_API::replace_variables( $title, $view_meta['form'], $entry );
483
+			$title = GravityView_API::replace_variables( $title, $view_meta[ 'form' ], $entry );
484 484
 
485 485
 			$title = do_shortcode( $title );
486 486
 		}
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		}
517 517
 
518 518
 		// Only render in the loop. Fixes issues with the_content filter being applied in places like the sidebar
519
-		if( ! in_the_loop() ) {
519
+		if ( ! in_the_loop() ) {
520 520
 			return $content;
521 521
 		}
522 522
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 
585 585
 		$context = GravityView_View::getInstance()->getContext();
586 586
 
587
-		switch( $context ) {
587
+		switch ( $context ) {
588 588
 			case 'directory':
589 589
 				$tab = __( 'Multiple Entries', 'gravityview' );
590 590
 				break;
@@ -598,9 +598,9 @@  discard block
 block discarded – undo
598 598
 		}
599 599
 
600 600
 
601
-		$title = sprintf( esc_html_x('The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
601
+		$title = sprintf( esc_html_x( 'The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab );
602 602
 		$edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit#%s-view', $view_id, $context ) );
603
-		$action_text = sprintf( esc_html__('Add fields to %s', 'gravityview' ), $tab );
603
+		$action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab );
604 604
 		$message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' );
605 605
 
606 606
 		$output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message );
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 	public function render_view( $passed_args ) {
634 634
 
635 635
 		// validate attributes
636
-		if ( empty( $passed_args['id'] ) ) {
636
+		if ( empty( $passed_args[ 'id' ] ) ) {
637 637
 			do_action( 'gravityview_log_error', '[render_view] Returning; no ID defined.', $passed_args );
638 638
 			return null;
639 639
 		}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 			return null;
656 656
 		}
657 657
 
658
-		$view_id = $passed_args['id'];
658
+		$view_id = $passed_args[ 'id' ];
659 659
 
660 660
 		$view_data = $this->getGvOutputData()->get_view( $view_id, $passed_args );
661 661
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 		$passed_args = array_filter( $passed_args, 'strlen' );
669 669
 
670 670
 		//Override shortcode args over View template settings
671
-		$atts = wp_parse_args( $passed_args, $view_data['atts'] );
671
+		$atts = wp_parse_args( $passed_args, $view_data[ 'atts' ] );
672 672
 
673 673
 		do_action( 'gravityview_log_debug', '[render_view] Arguments after merging with View settings: ', $atts );
674 674
 
@@ -691,14 +691,14 @@  discard block
 block discarded – undo
691 691
 		 * @since 1.15
692 692
 		 * @since 1.17.2 Added check for if a user has no caps but is logged in (member of multisite, but not any site). Treat as if logged-out.
693 693
 		 */
694
-		if( is_user_logged_in() && ! ( empty( wp_get_current_user()->caps ) && empty( wp_get_current_user()->roles ) ) && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
694
+		if ( is_user_logged_in() && ! ( empty( wp_get_current_user()->caps ) && empty( wp_get_current_user()->roles ) ) && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
695 695
 
696 696
 			do_action( 'gravityview_log_debug', sprintf( '%s Returning: View %d is not visible by current user.', __METHOD__, $view_id ) );
697 697
 
698 698
 			return null;
699 699
 		}
700 700
 
701
-		if( $this->isGravityviewPostType() ) {
701
+		if ( $this->isGravityviewPostType() ) {
702 702
 
703 703
 			/**
704 704
 			 * @filter `gravityview_direct_access` Should Views be directly accessible, or only visible using the shortcode?
@@ -710,9 +710,9 @@  discard block
 block discarded – undo
710 710
 			 */
711 711
 			$direct_access = apply_filters( 'gravityview_direct_access', true, $view_id );
712 712
 
713
-			$embed_only = ! empty( $atts['embed_only'] );
713
+			$embed_only = ! empty( $atts[ 'embed_only' ] );
714 714
 
715
-			if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
715
+			if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
716 716
 				return __( 'You are not allowed to view this content.', 'gravityview' );
717 717
 			}
718 718
 		}
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 
728 728
 		$gravityview_view = new GravityView_View( $view_data );
729 729
 
730
-		$post_id = ! empty( $atts['post_id'] ) ? intval( $atts['post_id'] ) : get_the_ID();
730
+		$post_id = ! empty( $atts[ 'post_id' ] ) ? intval( $atts[ 'post_id' ] ) : get_the_ID();
731 731
 
732 732
 		$gravityview_view->setPostId( $post_id );
733 733
 
@@ -737,20 +737,20 @@  discard block
 block discarded – undo
737 737
 			do_action( 'gravityview_log_debug', '[render_view] Executing Directory View' );
738 738
 
739 739
 			//fetch template and slug
740
-			$view_slug = apply_filters( 'gravityview_template_slug_'. $view_data['template_id'], 'table', 'directory' );
740
+			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'directory' );
741 741
 
742 742
 			do_action( 'gravityview_log_debug', '[render_view] View template slug: ', $view_slug );
743 743
 
744 744
 			/**
745 745
 			 * Disable fetching initial entries for views that don't need it (DataTables)
746 746
 			 */
747
-			$get_entries = apply_filters( 'gravityview_get_view_entries_'.$view_slug, true );
747
+			$get_entries = apply_filters( 'gravityview_get_view_entries_' . $view_slug, true );
748 748
 
749 749
 			/**
750 750
 			 * Hide View data until search is performed
751 751
 			 * @since 1.5.4
752 752
 			 */
753
-			if ( ! empty( $atts['hide_until_searched'] ) && ! $this->isSearch() ) {
753
+			if ( ! empty( $atts[ 'hide_until_searched' ] ) && ! $this->isSearch() ) {
754 754
 				$gravityview_view->setHideUntilSearched( true );
755 755
 				$get_entries = false;
756 756
 			}
@@ -758,23 +758,23 @@  discard block
 block discarded – undo
758 758
 
759 759
 			if ( $get_entries ) {
760 760
 
761
-				if ( ! empty( $atts['sort_columns'] ) ) {
761
+				if ( ! empty( $atts[ 'sort_columns' ] ) ) {
762 762
 					// add filter to enable column sorting
763
-					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ) , 100, 3 );
763
+					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ), 100, 3 );
764 764
 				}
765 765
 
766
-				$view_entries = self::get_view_entries( $atts, $view_data['form_id'] );
766
+				$view_entries = self::get_view_entries( $atts, $view_data[ 'form_id' ] );
767 767
 
768
-				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries['count'], sizeof( $view_entries['entries'] ) ) );
768
+				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries[ 'count' ], sizeof( $view_entries[ 'entries' ] ) ) );
769 769
 
770 770
 			} else {
771 771
 
772 772
 				$view_entries = array( 'count' => null, 'entries' => null, 'paging' => null );
773 773
 
774
-				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_'.$view_slug.'` is false' );
774
+				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_' . $view_slug . '` is false' );
775 775
 			}
776 776
 
777
-			$gravityview_view->setPaging( $view_entries['paging'] );
777
+			$gravityview_view->setPaging( $view_entries[ 'paging' ] );
778 778
 			$gravityview_view->setContext( 'directory' );
779 779
 			$sections = array( 'header', 'body', 'footer' );
780 780
 
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 			 * @action `gravityview_render_entry_{View ID}` Before rendering a single entry for a specific View ID
789 789
 			 * @since 1.17
790 790
 			 */
791
-			do_action( 'gravityview_render_entry_'.$view_data['id'] );
791
+			do_action( 'gravityview_render_entry_' . $view_data[ 'id' ] );
792 792
 
793 793
 			$entry = $this->getEntry();
794 794
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 				do_action( 'gravityview_log_debug', '[render_view] Entry does not exist. This may be because of View filters limiting access.' );
799 799
 
800 800
 				// Only display warning once when multiple Views are embedded
801
-				if( $view_id !== (int) GravityView_frontend::get_context_view_id() ) {
801
+				if ( $view_id !== (int)GravityView_frontend::get_context_view_id() ) {
802 802
 					ob_end_clean();
803 803
 					return null;
804 804
 				}
@@ -822,21 +822,21 @@  discard block
 block discarded – undo
822 822
 			// We're in single view, but the view being processed is not the same view the single entry belongs to.
823 823
 			// important: do not remove this as it prevents fake attempts of displaying entries from other views/forms
824 824
 			if ( $this->getGvOutputData()->has_multiple_views() && $view_id != $this->get_context_view_id() ) {
825
-				do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: '. $view_id );
825
+				do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: ' . $view_id );
826 826
 				ob_end_clean();
827 827
 				return null;
828 828
 			}
829 829
 
830 830
 			//fetch template and slug
831
-			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data['template_id'], 'table', 'single' );
831
+			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'single' );
832 832
 			do_action( 'gravityview_log_debug', '[render_view] View single template slug: ', $view_slug );
833 833
 
834 834
 			//fetch entry detail
835
-			$view_entries['count'] = 1;
836
-			$view_entries['entries'][] = $entry;
837
-			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries['entries'] );
835
+			$view_entries[ 'count' ] = 1;
836
+			$view_entries[ 'entries' ][ ] = $entry;
837
+			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries[ 'entries' ] );
838 838
 
839
-			$back_link_label = isset( $atts['back_link_label'] ) ? $atts['back_link_label'] : null;
839
+			$back_link_label = isset( $atts[ 'back_link_label' ] ) ? $atts[ 'back_link_label' ] : null;
840 840
 
841 841
 			// set back link label
842 842
 			$gravityview_view->setBackLinkLabel( $back_link_label );
@@ -846,11 +846,11 @@  discard block
 block discarded – undo
846 846
 		}
847 847
 
848 848
 		// add template style
849
-		self::add_style( $view_data['template_id'] );
849
+		self::add_style( $view_data[ 'template_id' ] );
850 850
 
851 851
 		// Prepare to render view and set vars
852
-		$gravityview_view->setEntries( $view_entries['entries'] );
853
-		$gravityview_view->setTotalEntries( $view_entries['count'] );
852
+		$gravityview_view->setEntries( $view_entries[ 'entries' ] );
853
+		$gravityview_view->setTotalEntries( $view_entries[ 'count' ] );
854 854
 
855 855
 		// If Edit
856 856
 		if ( 'edit' === gravityview_get_context() ) {
@@ -863,11 +863,11 @@  discard block
 block discarded – undo
863 863
 
864 864
 		} else {
865 865
 			// finaly we'll render some html
866
-			$sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data['template_id'] );
866
+			$sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data[ 'template_id' ] );
867 867
 
868 868
 			do_action( 'gravityview_log_debug', '[render_view] Sections to render: ', $sections );
869 869
 			foreach ( $sections as $section ) {
870
-				do_action( 'gravityview_log_debug', '[render_view] Rendering '. $section . ' section.' );
870
+				do_action( 'gravityview_log_debug', '[render_view] Rendering ' . $section . ' section.' );
871 871
 				$gravityview_view->render( $view_slug, $section, false );
872 872
 			}
873 873
 		}
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 				$datetime_format = 'Y-m-d H:i:s';
922 922
 				$search_is_outside_view_bounds = false;
923 923
 
924
-				if( ! empty( $search_criteria[ $key ] ) ) {
924
+				if ( ! empty( $search_criteria[ $key ] ) ) {
925 925
 
926 926
 					$search_date = strtotime( $search_criteria[ $key ] );
927 927
 
@@ -949,14 +949,14 @@  discard block
 block discarded – undo
949 949
 				if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) {
950 950
 
951 951
 					// Then we override the search and re-set the start date
952
-					$return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true );
952
+					$return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true );
953 953
 				}
954 954
 			}
955 955
 		}
956 956
 
957
-		if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) {
957
+		if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) {
958 958
 			// The start date is AFTER the end date. This will result in no results, but let's not force the issue.
959
-			if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) {
959
+			if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) {
960 960
 				do_action( 'gravityview_log_error', __METHOD__ . ' Invalid search: the start date is after the end date.', $return_search_criteria );
961 961
 			}
962 962
 		}
@@ -975,19 +975,19 @@  discard block
 block discarded – undo
975 975
 	public static function process_search_only_approved( $args, $search_criteria ) {
976 976
 
977 977
 		/** @since 1.19 */
978
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
978
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
979 979
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries; showing all approval statuses' );
980 980
 			return $search_criteria;
981 981
 		}
982 982
 
983
-		if ( ! empty( $args['show_only_approved'] ) ) {
983
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
984 984
 
985
-			$search_criteria['field_filters'][] = array(
985
+			$search_criteria[ 'field_filters' ][ ] = array(
986 986
 				'key' => GravityView_Entry_Approval::meta_key,
987 987
 				'value' => GravityView_Entry_Approval_Status::APPROVED
988 988
 			);
989 989
 
990
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
990
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
991 991
 
992 992
 			do_action( 'gravityview_log_debug', '[process_search_only_approved] Search Criteria if show only approved: ', $search_criteria );
993 993
 		}
@@ -1014,18 +1014,18 @@  discard block
 block discarded – undo
1014 1014
 	 */
1015 1015
 	public static function is_entry_approved( $entry, $args = array() ) {
1016 1016
 
1017
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
1017
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
1018 1018
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
1019 1019
 			return true;
1020 1020
 		}
1021 1021
 
1022 1022
 		/** @since 1.19 */
1023
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
1023
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
1024 1024
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries, so entry is approved for viewing' );
1025 1025
 			return true;
1026 1026
 		}
1027 1027
 
1028
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
1028
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
1029 1029
 
1030 1030
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
1031 1031
 	}
@@ -1059,26 +1059,26 @@  discard block
 block discarded – undo
1059 1059
 		do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', $search_criteria );
1060 1060
 
1061 1061
 		// implicity search
1062
-		if ( ! empty( $args['search_value'] ) ) {
1062
+		if ( ! empty( $args[ 'search_value' ] ) ) {
1063 1063
 
1064 1064
 			// Search operator options. Options: `is` or `contains`
1065
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
1065
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
1066 1066
 
1067
-			$search_criteria['field_filters'][] = array(
1067
+			$search_criteria[ 'field_filters' ][ ] = array(
1068 1068
 				'key' => rgget( 'search_field', $args ), // The field ID to search
1069
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
1069
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
1070 1070
 				'operator' => $operator,
1071 1071
 			);
1072 1072
 		}
1073 1073
 
1074
-		if( $search_criteria !== $original_search_criteria ) {
1074
+		if ( $search_criteria !== $original_search_criteria ) {
1075 1075
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after implicity search: ', $search_criteria );
1076 1076
 		}
1077 1077
 
1078 1078
 		// Handle setting date range
1079 1079
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
1080 1080
 
1081
-		if( $search_criteria !== $original_search_criteria ) {
1081
+		if ( $search_criteria !== $original_search_criteria ) {
1082 1082
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after date params: ', $search_criteria );
1083 1083
 		}
1084 1084
 
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
1090 1090
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
1091 1091
 		 */
1092
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
1092
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
1093 1093
 
1094 1094
 		return $search_criteria;
1095 1095
 	}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 			'search_criteria' => $search_criteria,
1202 1202
 			'sorting' => self::updateViewSorting( $args, $form_id ),
1203 1203
 			'paging' => $paging,
1204
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1204
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1205 1205
 		);
1206 1206
 
1207 1207
 		/**
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1227 1227
 		 * @param array $args View configuration args.
1228 1228
 		 */
1229
-		$parameters = apply_filters( 'gravityview_get_entries_'.$args['id'], $parameters, $args, $form_id );
1229
+		$parameters = apply_filters( 'gravityview_get_entries_' . $args[ 'id' ], $parameters, $args, $form_id );
1230 1230
 
1231 1231
 		do_action( 'gravityview_log_debug', __METHOD__ . ': $parameters passed to gravityview_get_entries(): ', $parameters );
1232 1232
 
@@ -1251,16 +1251,16 @@  discard block
 block discarded – undo
1251 1251
 		$default_page_size = apply_filters( 'gravityview_default_page_size', 25 );
1252 1252
 
1253 1253
 		// Paging & offset
1254
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : $default_page_size;
1254
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : $default_page_size;
1255 1255
 
1256 1256
 		if ( -1 === $page_size ) {
1257 1257
 			$page_size = PHP_INT_MAX;
1258 1258
 		}
1259 1259
 
1260
-		if ( isset( $args['offset'] ) ) {
1261
-			$offset = intval( $args['offset'] );
1260
+		if ( isset( $args[ 'offset' ] ) ) {
1261
+			$offset = intval( $args[ 'offset' ] );
1262 1262
 		} else {
1263
-			$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1263
+			$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1264 1264
 			$offset = ( $curr_page - 1 ) * $page_size;
1265 1265
 		}
1266 1266
 
@@ -1285,8 +1285,8 @@  discard block
 block discarded – undo
1285 1285
 	 */
1286 1286
 	public static function updateViewSorting( $args, $form_id ) {
1287 1287
 		$sorting = array();
1288
-		$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : rgar( $args, 'sort_field' );
1289
-		$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : rgar( $args, 'sort_direction' );
1288
+		$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : rgar( $args, 'sort_field' );
1289
+		$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : rgar( $args, 'sort_direction' );
1290 1290
 
1291 1291
 		$sort_field_id = self::_override_sorting_id_by_field_type( $sort_field_id, $form_id );
1292 1292
 
@@ -1326,11 +1326,11 @@  discard block
 block discarded – undo
1326 1326
 
1327 1327
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1328 1328
 
1329
-		if( ! $sort_field ) {
1329
+		if ( ! $sort_field ) {
1330 1330
 			return $sort_field_id;
1331 1331
 		}
1332 1332
 
1333
-		switch ( $sort_field['type'] ) {
1333
+		switch ( $sort_field[ 'type' ] ) {
1334 1334
 
1335 1335
 			case 'address':
1336 1336
 				// Sorting by full address
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
 					 */
1348 1348
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1349 1349
 
1350
-					switch( strtolower( $address_part ) ){
1350
+					switch ( strtolower( $address_part ) ) {
1351 1351
 						case 'street':
1352 1352
 							$sort_field_id .= '.1';
1353 1353
 							break;
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 		 */
1433 1433
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1434 1434
 
1435
-		if ( empty( $single_entry ) ){
1435
+		if ( empty( $single_entry ) ) {
1436 1436
 			return false;
1437 1437
 		} else {
1438 1438
 			return $single_entry;
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1460 1460
 				 * @since 1.15
1461 1461
 				 */
1462
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1462
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1463 1463
 					continue;
1464 1464
 				}
1465 1465
 
@@ -1468,19 +1468,19 @@  discard block
 block discarded – undo
1468 1468
 				$css_dependencies = array();
1469 1469
 
1470 1470
 				// If the thickbox is enqueued, add dependencies
1471
-				if ( ! empty( $data['atts']['lightbox'] ) ) {
1471
+				if ( ! empty( $data[ 'atts' ][ 'lightbox' ] ) ) {
1472 1472
 
1473 1473
 					/**
1474 1474
 					 * @filter `gravity_view_lightbox_script` Override the lightbox script to enqueue. Default: `thickbox`
1475 1475
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of it here.
1476 1476
 					 */
1477
-					$js_dependencies[] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1477
+					$js_dependencies[ ] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1478 1478
 
1479 1479
 					/**
1480 1480
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
1481 1481
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of its CSS file here.
1482 1482
 					 */
1483
-					$css_dependencies[] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1483
+					$css_dependencies[ ] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1484 1484
 				}
1485 1485
 
1486 1486
 				/**
@@ -1488,25 +1488,25 @@  discard block
 block discarded – undo
1488 1488
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1489 1489
 				 * @since 1.15
1490 1490
 				 */
1491
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1492
-					$css_dependencies[] = 'dashicons';
1491
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1492
+					$css_dependencies[ ] = 'dashicons';
1493 1493
 				}
1494 1494
 
1495 1495
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1496 1496
 
1497 1497
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1498 1498
 
1499
-				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ) , GravityView_Plugin::version, true );
1499
+				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ), GravityView_Plugin::version, true );
1500 1500
 
1501 1501
 				wp_enqueue_script( 'gravityview-fe-view' );
1502 1502
 
1503
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1503
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1504 1504
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1505 1505
 				}
1506 1506
 
1507 1507
 				$this->enqueue_default_style( $css_dependencies );
1508 1508
 
1509
-				self::add_style( $data['template_id'] );
1509
+				self::add_style( $data[ 'template_id' ] );
1510 1510
 			}
1511 1511
 
1512 1512
 			if ( 'wp_print_footer_scripts' === current_filter() ) {
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 		} elseif ( empty( $template_id ) ) {
1569 1569
 			do_action( 'gravityview_log_error', '[add_style] Cannot add template style; template_id is empty' );
1570 1570
 		} else {
1571
-			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_'.$template_id ) );
1571
+			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_' . $template_id ) );
1572 1572
 		}
1573 1573
 
1574 1574
 	}
@@ -1593,11 +1593,11 @@  discard block
 block discarded – undo
1593 1593
 		 * Not a table-based template; don't add sort icons
1594 1594
 		 * @since 1.12
1595 1595
 		 */
1596
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1596
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1597 1597
 			return $label;
1598 1598
 		}
1599 1599
 
1600
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1600
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1601 1601
 			return $label;
1602 1602
 		}
1603 1603
 
@@ -1605,29 +1605,29 @@  discard block
 block discarded – undo
1605 1605
 
1606 1606
 		$class = 'gv-sort';
1607 1607
 
1608
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1608
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1609 1609
 
1610 1610
 		$sort_args = array(
1611
-			'sort' => $field['id'],
1611
+			'sort' => $field[ 'id' ],
1612 1612
 			'dir' => 'asc',
1613 1613
 		);
1614 1614
 
1615
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1615
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1616 1616
 			//toggle sorting direction.
1617
-			if ( 'asc' === $sorting['direction'] ) {
1618
-				$sort_args['dir'] = 'desc';
1617
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1618
+				$sort_args[ 'dir' ] = 'desc';
1619 1619
 				$class .= ' gv-icon-sort-desc';
1620 1620
 			} else {
1621
-				$sort_args['dir'] = 'asc';
1621
+				$sort_args[ 'dir' ] = 'asc';
1622 1622
 				$class .= ' gv-icon-sort-asc';
1623 1623
 			}
1624 1624
 		} else {
1625 1625
 			$class .= ' gv-icon-caret-up-down';
1626 1626
 		}
1627 1627
 
1628
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1628
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1629 1629
 
1630
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1630
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1631 1631
 
1632 1632
 	}
1633 1633
 
@@ -1645,7 +1645,7 @@  discard block
 block discarded – undo
1645 1645
 
1646 1646
 		$field_type = $field_id;
1647 1647
 
1648
-		if( is_numeric( $field_id ) ) {
1648
+		if ( is_numeric( $field_id ) ) {
1649 1649
 			$field = GFFormsModel::get_field( $form, $field_id );
1650 1650
 			$field_type = $field->type;
1651 1651
 		}
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
 			return false;
1669 1669
 		}
1670 1670
 
1671
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1671
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1672 1672
 
1673 1673
 	}
1674 1674
 
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/widgets/class-gravityview-widget.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 	// hold widget View options
52 52
 	private $widget_options;
53 53
 
54
-	function __construct( $widget_label , $widget_id , $defaults = array(), $settings = array() ) {
54
+	function __construct( $widget_label, $widget_id, $defaults = array(), $settings = array() ) {
55 55
 
56 56
 
57 57
 		/**
58 58
 		 * The shortcode name is set to the lowercase name of the widget class, unless overridden by the class specifying a different value for $shortcode_name
59 59
 		 * @var string
60 60
 		 */
61
-		$this->shortcode_name = !isset( $this->shortcode_name ) ? strtolower( get_class($this) ) : $this->shortcode_name;
61
+		$this->shortcode_name = ! isset( $this->shortcode_name ) ? strtolower( get_class( $this ) ) : $this->shortcode_name;
62 62
 
63 63
 		$this->widget_label = $widget_label;
64 64
 		$this->widget_id = $widget_id;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		$this->settings = wp_parse_args( $settings, $this->settings );
70 70
 
71 71
 		// register widgets to be listed in the View Configuration
72
-		add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget') );
72
+		add_filter( 'gravityview_register_directory_widgets', array( $this, 'register_widget' ) );
73 73
 
74 74
 		// widget options
75 75
 		add_filter( 'gravityview_template_widget_options', array( $this, 'assign_widget_options' ), 10, 3 );
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 		add_action( "gravityview_render_widget_{$widget_id}", array( $this, 'render_frontend' ), 10, 1 );
79 79
 
80 80
 		// register shortcodes
81
-		add_action( 'wp', array( $this, 'add_shortcode') );
81
+		add_action( 'wp', array( $this, 'add_shortcode' ) );
82 82
 
83 83
 		// Use shortcodes in text widgets.
84
-		add_filter('widget_text', array( $this, 'maybe_do_shortcode' ) );
84
+		add_filter( 'widget_text', array( $this, 'maybe_do_shortcode' ) );
85 85
 	}
86 86
 
87 87
 
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 		 * @param boolean $enable_custom_class False by default. Return true if you want to enable.
100 100
 		 * @param GravityView_Widget $this Current instance of GravityView_Widget
101 101
 		 */
102
-		$enable_custom_class = apply_filters('gravityview/widget/enable_custom_class', false, $this );
102
+		$enable_custom_class = apply_filters( 'gravityview/widget/enable_custom_class', false, $this );
103 103
 
104
-		if( $enable_custom_class ) {
104
+		if ( $enable_custom_class ) {
105 105
 
106
-			$settings['custom_class'] = array(
106
+			$settings[ 'custom_class' ] = array(
107 107
 				'type' => 'text',
108 108
 				'label' => __( 'Custom CSS Class:', 'gravityview' ),
109
-				'desc' => __( 'This class will be added to the widget container', 'gravityview'),
109
+				'desc' => __( 'This class will be added to the widget container', 'gravityview' ),
110 110
 				'value' => '',
111 111
 				'merge_tags' => true,
112 112
 			);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	 * @return array|null   Settings array; NULL if not set
129 129
 	 */
130 130
 	public function get_settings() {
131
-		return !empty( $this->settings ) ? $this->settings : NULL;
131
+		return ! empty( $this->settings ) ? $this->settings : NULL;
132 132
 	}
133 133
 
134 134
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	public function get_setting( $key ) {
140 140
 		$setting = NULL;
141 141
 
142
-		if( isset( $this->settings ) && is_array( $this->settings ) ) {
142
+		if ( isset( $this->settings ) && is_array( $this->settings ) ) {
143 143
 			$setting = isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : NULL;
144 144
 		}
145 145
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	function maybe_do_shortcode( $text, $widget = NULL ) {
156 156
 
157
-		if( !empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) {
157
+		if ( ! empty( $this->shortcode_name ) && has_shortcode( $text, $this->shortcode_name ) ) {
158 158
 			return do_shortcode( $text );
159 159
 		}
160 160
 
@@ -183,26 +183,26 @@  discard block
 block discarded – undo
183 183
 			return;
184 184
 		}
185 185
 
186
-		if( empty( $this->shortcode_name ) ) { return; }
186
+		if ( empty( $this->shortcode_name ) ) { return; }
187 187
 
188 188
 		// If the widget shouldn't output on single entries, don't show it
189
-		if( empty( $this->show_on_single ) && class_exists('GravityView_frontend') && GravityView_frontend::is_single_entry() ) {
190
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class($this)) );
189
+		if ( empty( $this->show_on_single ) && class_exists( 'GravityView_frontend' ) && GravityView_frontend::is_single_entry() ) {
190
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: Skipping; set to not run on single entry.', get_class( $this ) ) );
191 191
 
192 192
 			add_shortcode( $this->shortcode_name, '__return_null' );
193 193
 			return;
194 194
 		}
195 195
 
196 196
 
197
-		if( !has_gravityview_shortcode( $post ) ) {
197
+		if ( ! has_gravityview_shortcode( $post ) ) {
198 198
 
199
-			do_action('gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class($this)) );
199
+			do_action( 'gravityview_log_debug', sprintf( '%s[add_shortcode]: No shortcode present; not adding render_frontend shortcode.', get_class( $this ) ) );
200 200
 
201 201
 			add_shortcode( $this->shortcode_name, '__return_null' );
202 202
 			return;
203 203
 		}
204 204
 
205
-		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode') );
205
+		add_shortcode( $this->shortcode_name, array( $this, 'render_shortcode' ) );
206 206
 	}
207 207
 
208 208
 	/**
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	function register_widget( $widgets ) {
214 214
 		$widgets[ $this->widget_id ] = array(
215
-			'label' => $this->widget_label ,
215
+			'label' => $this->widget_label,
216 216
 			'description' => $this->widget_description,
217 217
 			'subtitle' => $this->widget_subtitle,
218 218
 		);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	public function assign_widget_options( $options = array(), $template = '', $widget = '' ) {
231 231
 
232
-		if( $this->widget_id === $widget ) {
232
+		if ( $this->widget_id === $widget ) {
233 233
 			$options = array_merge( $options, $this->settings );
234 234
 		}
235 235
 
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 	 *
243 243
 	 * @return void
244 244
 	 */
245
-	public function render_frontend( $widget_args, $content = '', $context = '') {
245
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
246 246
 		// to be defined by child class
247
-		if( !$this->pre_render_frontend() ) {
247
+		if ( ! $this->pre_render_frontend() ) {
248 248
 			return;
249 249
 		}
250 250
 	}
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 	public function pre_render_frontend() {
257 257
 		$gravityview_view = GravityView_View::getInstance();
258 258
 
259
-		if( empty( $gravityview_view ) ) {
260
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class($this)) );
259
+		if ( empty( $gravityview_view ) ) {
260
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: $gravityview_view not instantiated yet.', get_class( $this ) ) );
261 261
 			return false;
262 262
 		}
263 263
 
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 		 */
269 269
 		$hide_until_search = apply_filters( 'gravityview/widget/hide_until_searched', $gravityview_view->hide_until_searched, $this );
270 270
 
271
-		if( $hide_until_search ) {
272
-			do_action('gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class($this)) );
271
+		if ( $hide_until_search ) {
272
+			do_action( 'gravityview_log_debug', sprintf( '%s[render_frontend]: Hide View data until search is performed', get_class( $this ) ) );
273 273
 			return false;
274 274
 		}
275 275
 
Please login to merge, or discard this patch.
includes/class-gvlogic-shortcode.php 1 patch
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.
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-fields.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 	/**
78 78
 	 * Alias for get_instance()
79 79
 	 *
80
-	 * @param $field_name
80
+	 * @param string $field_name
81 81
 	 *
82 82
 	 * @return GravityView_Field|false
83 83
 	 */
Please login to merge, or discard this patch.