Completed
Push — develop ( 3ab570...56fa65 )
by Zack
06:58
created
includes/class-frontend-views.php 3 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
 		$multiple_views = defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? gravityview()->views->count() > 1 : ( $this->getGvOutputData() && $this->getGvOutputData()->has_multiple_views() );
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
 	 *
1214 1214
 	 * @uses  gravityview_get_entries()
1215 1215
 	 * @access public
1216
-	 * @param array $args\n
1216
+	 * @param array $args
1217 1217
 	 *   - $id - View id
1218 1218
 	 *   - $page_size - Page
1219 1219
 	 *   - $sort_field - form field id to sort
@@ -1370,7 +1370,6 @@  discard block
 block discarded – undo
1370 1370
 	 * @since 1.19.5
1371 1371
 	 *
1372 1372
 	 * @param $args
1373
-	 * @param int $form_id
1374 1373
 	 */
1375 1374
 	public static function get_search_criteria_paging( $args ) {
1376 1375
 
@@ -1785,7 +1784,7 @@  discard block
 block discarded – undo
1785 1784
 	/**
1786 1785
 	 * Checks if field (column) is sortable
1787 1786
 	 *
1788
-	 * @param string $field Field settings
1787
+	 * @param string $field_id Field settings
1789 1788
 	 * @param array $form Gravity Forms form array
1790 1789
 	 *
1791 1790
 	 * @since 1.7
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		}
459 459
 
460 460
 		// User reported WooCommerce doesn't pass two args.
461
-		if ( empty( $passed_post_id ) )  {
461
+		if ( empty( $passed_post_id ) ) {
462 462
 			return $title;
463 463
 		}
464 464
 
@@ -494,8 +494,9 @@  discard block
 block discarded – undo
494 494
 				}
495 495
 
496 496
 				/** No matching form sources were found, happens when requesting an entry from a different form . */
497
-				if ( ! isset( $view ) )
498
-					return $title;
497
+				if ( ! isset( $view ) ) {
498
+									return $title;
499
+				}
499 500
 			} else {
500 501
 				/** Deprecated. Use gravityview()->views->all() or gravityview()->request->all() */
501 502
 				foreach ( $this->getGvOutputData()->get_views() as $view_id => $view_data ) {
@@ -1478,7 +1479,7 @@  discard block
 block discarded – undo
1478 1479
 					 */
1479 1480
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1480 1481
 
1481
-					switch( strtolower( $address_part ) ){
1482
+					switch( strtolower( $address_part ) ) {
1482 1483
 						case 'street':
1483 1484
 							$sort_field_id .= '.1';
1484 1485
 							break;
@@ -1563,7 +1564,7 @@  discard block
 block discarded – undo
1563 1564
 		 */
1564 1565
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1565 1566
 
1566
-		if ( empty( $single_entry ) ){
1567
+		if ( empty( $single_entry ) ) {
1567 1568
 			return false;
1568 1569
 		} else {
1569 1570
 			return $single_entry;
Please login to merge, or discard this patch.
Spacing   +114 added lines, -114 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 );
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
 
238 238
 			$this->context_view_id = $view_id;
239 239
 
240
-		} elseif ( isset( $_GET['gvid'] ) && $multiple_views ) {
240
+		} elseif ( isset( $_GET[ 'gvid' ] ) && $multiple_views ) {
241 241
 			/**
242 242
 			 * used on a has_multiple_views context
243 243
 			 * @see GravityView_API::entry_link
244 244
 			 */
245
-			$this->context_view_id = $_GET['gvid'];
245
+			$this->context_view_id = $_GET[ 'gvid' ];
246 246
 
247 247
 		} elseif ( ! $multiple_views ) {
248 248
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
@@ -285,25 +285,25 @@  discard block
 block discarded – undo
285 285
 		global $wp_rewrite;
286 286
 
287 287
 		$is_front_page = ( $query->is_home || $query->is_page );
288
-		$show_on_front = ( 'page' === get_option('show_on_front') );
289
-		$front_page_id = get_option('page_on_front');
288
+		$show_on_front = ( 'page' === get_option( 'show_on_front' ) );
289
+		$front_page_id = get_option( 'page_on_front' );
290 290
 
291
-		if (  $is_front_page && $show_on_front && $front_page_id ) {
291
+		if ( $is_front_page && $show_on_front && $front_page_id ) {
292 292
 
293 293
 			// Force to be an array, potentially a query string ( entry=16 )
294 294
 			$_query = wp_parse_args( $query->query );
295 295
 
296 296
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
297
-			if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {
298
-				unset( $_query['pagename'] );
297
+			if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) {
298
+				unset( $_query[ 'pagename' ] );
299 299
 			}
300 300
 
301 301
 			// this is where will break from core wordpress
302 302
 			/** @internal Don't use this filter; it will be unnecessary soon - it's just a patch for specific use case */
303 303
 			$ignore = apply_filters( 'gravityview/internal/ignored_endpoints', array( 'preview', 'page', 'paged', 'cpage' ), $query );
304 304
 			$endpoints = rgobj( $wp_rewrite, 'endpoints' );
305
-			foreach ( (array) $endpoints as $endpoint ) {
306
-				$ignore[] = $endpoint[1];
305
+			foreach ( (array)$endpoints as $endpoint ) {
306
+				$ignore[ ] = $endpoint[ 1 ];
307 307
 			}
308 308
 			unset( $endpoints );
309 309
 
@@ -313,21 +313,21 @@  discard block
 block discarded – undo
313 313
 			// - The query includes keys that are associated with registered endpoints. `entry`, for example.
314 314
 			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) {
315 315
 
316
-				$qv =& $query->query_vars;
316
+				$qv = & $query->query_vars;
317 317
 
318 318
 				// Prevent redirect when on the single entry endpoint
319
-				if( self::is_single_entry() ) {
319
+				if ( self::is_single_entry() ) {
320 320
 					add_filter( 'redirect_canonical', '__return_false' );
321 321
 				}
322 322
 
323 323
 				$query->is_page = true;
324 324
 				$query->is_home = false;
325
-				$qv['page_id']  = $front_page_id;
325
+				$qv[ 'page_id' ]  = $front_page_id;
326 326
 
327 327
 				// Correct <!--nextpage--> for page_on_front
328
-				if ( ! empty( $qv['paged'] ) ) {
329
-					$qv['page'] = $qv['paged'];
330
-					unset( $qv['paged'] );
328
+				if ( ! empty( $qv[ 'paged' ] ) ) {
329
+					$qv[ 'page' ] = $qv[ 'paged' ];
330
+					unset( $qv[ 'paged' ] );
331 331
 				}
332 332
 			}
333 333
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 		$this->setIsGravityviewPostType( get_post_type( $post ) === 'gravityview' );
362 362
 
363
-		$post_id = $this->getPostId() ? $this->getPostId() : (isset( $post ) ? $post->ID : null );
363
+		$post_id = $this->getPostId() ? $this->getPostId() : ( isset( $post ) ? $post->ID : null );
364 364
 		$this->setPostId( $post_id );
365 365
 		$post_has_shortcode = ! empty( $post->post_content ) ? gravityview_has_shortcode_r( $post->post_content, 'gravityview' ) : false;
366 366
 		$this->setPostHasShortcode( $this->isGravityviewPostType() ? null : ! empty( $post_has_shortcode ) );
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 
397 397
 		$search_method = GravityView_Widget_Search::getInstance()->get_search_method();
398 398
 
399
-		if( 'post' === $search_method ) {
399
+		if ( 'post' === $search_method ) {
400 400
 			$get = $_POST;
401 401
 		} else {
402 402
 			$get = $_GET;
@@ -452,20 +452,20 @@  discard block
 block discarded – undo
452 452
 		 * @param boolean $in_the_loop Whether to apply the filter to the menu title and the meta tag <title> - outside the loop
453 453
 		 * @param array $entry Current entry
454 454
 		 */
455
-		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop' , in_the_loop(), $entry );
455
+		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop', in_the_loop(), $entry );
456 456
 
457 457
 		if ( ! $apply_outside_loop ) {
458 458
 			return $title;
459 459
 		}
460 460
 
461 461
 		// User reported WooCommerce doesn't pass two args.
462
-		if ( empty( $passed_post_id ) )  {
462
+		if ( empty( $passed_post_id ) ) {
463 463
 			return $title;
464 464
 		}
465 465
 
466 466
 		// Don't modify the title for anything other than the current view/post.
467 467
 		// This is true for embedded shortcodes and Views.
468
-		if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) {
468
+		if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) {
469 469
 			return $title;
470 470
 		}
471 471
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		} else {
489 489
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
490 490
 				foreach ( gravityview()->views->all() as $_view ) {
491
-					if ( intval( $_view->form->ID ) === intval( $entry['form_id'] ) ) {
491
+					if ( intval( $_view->form->ID ) === intval( $entry[ 'form_id' ] ) ) {
492 492
 						$view = $_view;
493 493
 						break;
494 494
 					}
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 			} else {
501 501
 				/** Deprecated. Use gravityview()->views->all() or gravityview()->request->all() */
502 502
 				foreach ( $this->getGvOutputData()->get_views() as $view_id => $view_data ) {
503
-					if ( intval( $view_data['form_id'] ) === intval( $entry['form_id'] ) ) {
503
+					if ( intval( $view_data[ 'form_id' ] ) === intval( $entry[ 'form_id' ] ) ) {
504 504
 						$view_meta = $view_data;
505 505
 						break;
506 506
 					}
@@ -515,12 +515,12 @@  discard block
 block discarded – undo
515 515
 			}
516 516
 		} else {
517 517
 			/** Deprecated stuff in the future. See the branch above. */
518
-			if ( ! empty( $view_meta['atts']['single_title'] ) ) {
518
+			if ( ! empty( $view_meta[ 'atts' ][ 'single_title' ] ) ) {
519 519
 
520
-				$title = $view_meta['atts']['single_title'];
520
+				$title = $view_meta[ 'atts' ][ 'single_title' ];
521 521
 
522 522
 				// We are allowing HTML in the fields, so no escaping the output
523
-				$title = GravityView_API::replace_variables( $title, $view_meta['form'], $entry );
523
+				$title = GravityView_API::replace_variables( $title, $view_meta[ 'form' ], $entry );
524 524
 
525 525
 				$title = do_shortcode( $title );
526 526
 			}
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		}
559 559
 
560 560
 		// Only render in the loop. Fixes issues with the_content filter being applied in places like the sidebar
561
-		if( ! in_the_loop() ) {
561
+		if ( ! in_the_loop() ) {
562 562
 			return $content;
563 563
 		}
564 564
 
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
 		$context = GravityView_View::getInstance()->getContext();
635 635
 
636
-		switch( $context ) {
636
+		switch ( $context ) {
637 637
 			case 'directory':
638 638
 				$tab = __( 'Multiple Entries', 'gravityview' );
639 639
 				break;
@@ -647,12 +647,12 @@  discard block
 block discarded – undo
647 647
 		}
648 648
 
649 649
 
650
-		$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 );
650
+		$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 );
651 651
 		$edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit#%s-view', $view_id, $context ) );
652
-		$action_text = sprintf( esc_html__('Add fields to %s', 'gravityview' ), $tab );
652
+		$action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab );
653 653
 		$message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' );
654 654
 
655
-		$image =  sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url(plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
655
+		$image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) );
656 656
 		$output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message );
657 657
 
658 658
 		echo GVCommon::generate_notice( $output . $image, 'gv-error error', 'edit_gravityview', $view_id );
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 	public function render_view( $passed_args ) {
684 684
 
685 685
 		// validate attributes
686
-		if ( empty( $passed_args['id'] ) ) {
686
+		if ( empty( $passed_args[ 'id' ] ) ) {
687 687
 			do_action( 'gravityview_log_error', '[render_view] Returning; no ID defined.', $passed_args );
688 688
 			return null;
689 689
 		}
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 			return null;
706 706
 		}
707 707
 
708
-		$view_id = $passed_args['id'];
708
+		$view_id = $passed_args[ 'id' ];
709 709
 
710 710
 		if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
711 711
 			$view = gravityview()->views->get( $view_id );
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 			$passed_args = array_filter( $passed_args, 'strlen' );
736 736
 
737 737
 			//Override shortcode args over View template settings
738
-			$atts = wp_parse_args( $passed_args, $view_data['atts'] );
738
+			$atts = wp_parse_args( $passed_args, $view_data[ 'atts' ] );
739 739
 
740 740
 			do_action( 'gravityview_log_debug', '[render_view] Arguments after merging with View settings: ', $atts );
741 741
 		}
@@ -759,14 +759,14 @@  discard block
 block discarded – undo
759 759
 		 * @since 1.15
760 760
 		 * @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.
761 761
 		 */
762
-		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 ) ) {
762
+		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 ) ) {
763 763
 
764 764
 			do_action( 'gravityview_log_debug', sprintf( '%s Returning: View %d is not visible by current user.', __METHOD__, $view_id ) );
765 765
 
766 766
 			return null;
767 767
 		}
768 768
 
769
-		if( $this->isGravityviewPostType() ) {
769
+		if ( $this->isGravityviewPostType() ) {
770 770
 
771 771
 			/**
772 772
 			 * @filter `gravityview_direct_access` Should Views be directly accessible, or only visible using the shortcode?
@@ -782,10 +782,10 @@  discard block
 block discarded – undo
782 782
 				$embed_only = $view->settings->get( 'embed_only' );
783 783
 			} else {
784 784
 				/** Deprecated. View attributes moved to \GV\View::$settings. */
785
-				$embed_only = ! empty( $atts['embed_only'] );
785
+				$embed_only = ! empty( $atts[ 'embed_only' ] );
786 786
 			}
787 787
 
788
-			if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
788
+			if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
789 789
 				return __( 'You are not allowed to view this content.', 'gravityview' );
790 790
 			}
791 791
 		}
@@ -801,13 +801,13 @@  discard block
 block discarded – undo
801 801
 		if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
802 802
 			$view_data = $view->as_data();
803 803
 			$gravityview_view = new GravityView_View( $view_data );
804
-			$post_id = intval( $view->settings->get( 'post_id' ) ? : get_the_ID() );
804
+			$post_id = intval( $view->settings->get( 'post_id' ) ?: get_the_ID() );
805 805
 			$template_id = $view->template ? $view->template->ID : null;
806 806
 		} else {
807 807
 			/** These constructs are deprecated. Use the new gravityview() wrapper. */
808 808
 			$gravityview_view = new GravityView_View( $view_data );
809
-			$post_id = ! empty( $atts['post_id'] ) ? intval( $atts['post_id'] ) : get_the_ID();
810
-			$template_id = $view_data['template_id'];
809
+			$post_id = ! empty( $atts[ 'post_id' ] ) ? intval( $atts[ 'post_id' ] ) : get_the_ID();
810
+			$template_id = $view_data[ 'template_id' ];
811 811
 		}
812 812
 
813 813
 		$gravityview_view->setPostId( $post_id );
@@ -818,20 +818,20 @@  discard block
 block discarded – undo
818 818
 			do_action( 'gravityview_log_debug', '[render_view] Executing Directory View' );
819 819
 
820 820
 			//fetch template and slug
821
-			$view_slug = apply_filters( 'gravityview_template_slug_'. $template_id, 'table', 'directory' );
821
+			$view_slug = apply_filters( 'gravityview_template_slug_' . $template_id, 'table', 'directory' );
822 822
 
823 823
 			do_action( 'gravityview_log_debug', '[render_view] View template slug: ', $view_slug );
824 824
 
825 825
 			/**
826 826
 			 * Disable fetching initial entries for views that don't need it (DataTables)
827 827
 			 */
828
-			$get_entries = apply_filters( 'gravityview_get_view_entries_'.$view_slug, true );
828
+			$get_entries = apply_filters( 'gravityview_get_view_entries_' . $view_slug, true );
829 829
 
830 830
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
831 831
 				$hide_until_searched = $view->settings->get( 'hide_until_searched' );
832 832
 			} else {
833 833
 				/** $atts is deprecated, use \GV\View:$settings */
834
-				$hide_until_searched = ! empty( $atts['hide_until_searched'] );
834
+				$hide_until_searched = ! empty( $atts[ 'hide_until_searched' ] );
835 835
 			}
836 836
 
837 837
 			/**
@@ -849,12 +849,12 @@  discard block
 block discarded – undo
849 849
 					$sort_columns = $view->settings->get( 'sort_columns' );
850 850
 				} else {
851 851
 					/** $atts is deprecated, use \GV\View:$settings */
852
-					$sort_columns = ! empty( $atts['sort_columns'] );
852
+					$sort_columns = ! empty( $atts[ 'sort_columns' ] );
853 853
 				}
854 854
 
855 855
 				if ( $sort_columns ) {
856 856
 					// add filter to enable column sorting
857
-					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ) , 100, 3 );
857
+					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ), 100, 3 );
858 858
 				}
859 859
 
860 860
 				if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
@@ -862,19 +862,19 @@  discard block
 block discarded – undo
862 862
 				} else {
863 863
 					/** $atts is deprecated, use \GV\View:$settings */
864 864
 					/** $view_data is depreacted, use \GV\View properties */
865
-					$view_entries = self::get_view_entries( $atts, $view_data['form_id'] );
865
+					$view_entries = self::get_view_entries( $atts, $view_data[ 'form_id' ] );
866 866
 				}
867 867
 
868
-				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries['count'], sizeof( $view_entries['entries'] ) ) );
868
+				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries[ 'count' ], sizeof( $view_entries[ 'entries' ] ) ) );
869 869
 
870 870
 			} else {
871 871
 
872 872
 				$view_entries = array( 'count' => null, 'entries' => null, 'paging' => null );
873 873
 
874
-				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_'.$view_slug.'` is false' );
874
+				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_' . $view_slug . '` is false' );
875 875
 			}
876 876
 
877
-			$gravityview_view->setPaging( $view_entries['paging'] );
877
+			$gravityview_view->setPaging( $view_entries[ 'paging' ] );
878 878
 			$gravityview_view->setContext( 'directory' );
879 879
 			$sections = array( 'header', 'body', 'footer' );
880 880
 
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 				do_action( 'gravityview_render_entry_' . $view->ID );
892 892
 			} else {
893 893
 				/** $view_data is depreacted, use \GV\View properties */
894
-				do_action( 'gravityview_render_entry_'.$view_data['id'] );
894
+				do_action( 'gravityview_render_entry_' . $view_data[ 'id' ] );
895 895
 			}
896 896
 
897 897
 			$entry = $this->getEntry();
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 				do_action( 'gravityview_log_debug', '[render_view] Entry does not exist. This may be because of View filters limiting access.' );
903 903
 
904 904
 				// Only display warning once when multiple Views are embedded
905
-				if( $view_id !== (int) GravityView_frontend::get_context_view_id() ) {
905
+				if ( $view_id !== (int)GravityView_frontend::get_context_view_id() ) {
906 906
 					ob_end_clean();
907 907
 					return null;
908 908
 				}
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 			// important: do not remove this as it prevents fake attempts of displaying entries from other views/forms
928 928
 			$multiple_views = defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? gravityview()->views->count() > 1 : $this->getGvOutputData()->has_multiple_views();
929 929
 			if ( $multiple_views && $view_id != $this->get_context_view_id() ) {
930
-				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 );
930
+				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 );
931 931
 				ob_end_clean();
932 932
 				return null;
933 933
 			}
@@ -937,14 +937,14 @@  discard block
 block discarded – undo
937 937
 			do_action( 'gravityview_log_debug', '[render_view] View single template slug: ', $view_slug );
938 938
 
939 939
 			//fetch entry detail
940
-			$view_entries['count'] = 1;
941
-			$view_entries['entries'][] = $entry;
942
-			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries['entries'] );
940
+			$view_entries[ 'count' ] = 1;
941
+			$view_entries[ 'entries' ][ ] = $entry;
942
+			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries[ 'entries' ] );
943 943
 
944 944
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
945 945
 				$back_link_label = $view->settings->get( 'back_link_label', null );
946 946
 			} else {
947
-				$back_link_label = isset( $atts['back_link_label'] ) ? $atts['back_link_label'] : null;
947
+				$back_link_label = isset( $atts[ 'back_link_label' ] ) ? $atts[ 'back_link_label' ] : null;
948 948
 			}
949 949
 
950 950
 			// set back link label
@@ -958,8 +958,8 @@  discard block
 block discarded – undo
958 958
 		self::add_style( $template_id );
959 959
 
960 960
 		// Prepare to render view and set vars
961
-		$gravityview_view->setEntries( $view_entries['entries'] );
962
-		$gravityview_view->setTotalEntries( $view_entries['count'] );
961
+		$gravityview_view->setEntries( $view_entries[ 'entries' ] );
962
+		$gravityview_view->setTotalEntries( $view_entries[ 'count' ] );
963 963
 
964 964
 		// If Edit
965 965
 		if ( 'edit' === gravityview_get_context() ) {
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 			do_action( 'gravityview_log_debug', '[render_view] Sections to render: ', $sections );
978 978
 			foreach ( $sections as $section ) {
979
-				do_action( 'gravityview_log_debug', '[render_view] Rendering '. $section . ' section.' );
979
+				do_action( 'gravityview_log_debug', '[render_view] Rendering ' . $section . ' section.' );
980 980
 				$gravityview_view->render( $view_slug, $section, false );
981 981
 			}
982 982
 		}
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 				$datetime_format = 'Y-m-d H:i:s';
1031 1031
 				$search_is_outside_view_bounds = false;
1032 1032
 
1033
-				if( ! empty( $search_criteria[ $key ] ) ) {
1033
+				if ( ! empty( $search_criteria[ $key ] ) ) {
1034 1034
 
1035 1035
 					$search_date = strtotime( $search_criteria[ $key ] );
1036 1036
 
@@ -1058,14 +1058,14 @@  discard block
 block discarded – undo
1058 1058
 				if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) {
1059 1059
 
1060 1060
 					// Then we override the search and re-set the start date
1061
-					$return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true );
1061
+					$return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true );
1062 1062
 				}
1063 1063
 			}
1064 1064
 		}
1065 1065
 
1066
-		if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) {
1066
+		if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) {
1067 1067
 			// The start date is AFTER the end date. This will result in no results, but let's not force the issue.
1068
-			if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) {
1068
+			if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) {
1069 1069
 				do_action( 'gravityview_log_error', __METHOD__ . ' Invalid search: the start date is after the end date.', $return_search_criteria );
1070 1070
 			}
1071 1071
 		}
@@ -1084,19 +1084,19 @@  discard block
 block discarded – undo
1084 1084
 	public static function process_search_only_approved( $args, $search_criteria ) {
1085 1085
 
1086 1086
 		/** @since 1.19 */
1087
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
1087
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
1088 1088
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries; showing all approval statuses' );
1089 1089
 			return $search_criteria;
1090 1090
 		}
1091 1091
 
1092
-		if ( ! empty( $args['show_only_approved'] ) ) {
1092
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
1093 1093
 
1094
-			$search_criteria['field_filters'][] = array(
1094
+			$search_criteria[ 'field_filters' ][ ] = array(
1095 1095
 				'key' => GravityView_Entry_Approval::meta_key,
1096 1096
 				'value' => GravityView_Entry_Approval_Status::APPROVED
1097 1097
 			);
1098 1098
 
1099
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
1099
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
1100 1100
 
1101 1101
 			do_action( 'gravityview_log_debug', '[process_search_only_approved] Search Criteria if show only approved: ', $search_criteria );
1102 1102
 		}
@@ -1123,18 +1123,18 @@  discard block
 block discarded – undo
1123 1123
 	 */
1124 1124
 	public static function is_entry_approved( $entry, $args = array() ) {
1125 1125
 
1126
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
1126
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
1127 1127
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
1128 1128
 			return true;
1129 1129
 		}
1130 1130
 
1131 1131
 		/** @since 1.19 */
1132
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
1132
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
1133 1133
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries, so entry is approved for viewing' );
1134 1134
 			return true;
1135 1135
 		}
1136 1136
 
1137
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
1137
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
1138 1138
 
1139 1139
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
1140 1140
 	}
@@ -1168,29 +1168,29 @@  discard block
 block discarded – undo
1168 1168
 		do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', $search_criteria );
1169 1169
 
1170 1170
 		// implicity search
1171
-		if ( ! empty( $args['search_value'] ) ) {
1171
+		if ( ! empty( $args[ 'search_value' ] ) ) {
1172 1172
 
1173 1173
 			// Search operator options. Options: `is` or `contains`
1174
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
1174
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
1175 1175
 
1176
-			$search_criteria['field_filters'][] = array(
1176
+			$search_criteria[ 'field_filters' ][ ] = array(
1177 1177
 				'key' => rgget( 'search_field', $args ), // The field ID to search
1178
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
1178
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
1179 1179
 				'operator' => $operator,
1180 1180
 			);
1181 1181
 
1182 1182
 			// Lock search mode to "all" with implicit presearch filter.
1183
-			$search_criteria['field_filters']['mode'] = 'all';
1183
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all';
1184 1184
 		}
1185 1185
 
1186
-		if( $search_criteria !== $original_search_criteria ) {
1186
+		if ( $search_criteria !== $original_search_criteria ) {
1187 1187
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after implicity search: ', $search_criteria );
1188 1188
 		}
1189 1189
 
1190 1190
 		// Handle setting date range
1191 1191
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
1192 1192
 
1193
-		if( $search_criteria !== $original_search_criteria ) {
1193
+		if ( $search_criteria !== $original_search_criteria ) {
1194 1194
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after date params: ', $search_criteria );
1195 1195
 		}
1196 1196
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
1202 1202
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
1203 1203
 		 */
1204
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
1204
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
1205 1205
 
1206 1206
 		return $search_criteria;
1207 1207
 	}
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
 			'search_criteria' => $search_criteria,
1326 1326
 			'sorting' => self::updateViewSorting( $args, $form_id ),
1327 1327
 			'paging' => $paging,
1328
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1328
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1329 1329
 		);
1330 1330
 
1331 1331
 		/**
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1351 1351
 		 * @param array $args View configuration args.
1352 1352
 		 */
1353
-		$parameters = apply_filters( 'gravityview_get_entries_'.$args['id'], $parameters, $args, $form_id );
1353
+		$parameters = apply_filters( 'gravityview_get_entries_' . $args[ 'id' ], $parameters, $args, $form_id );
1354 1354
 
1355 1355
 		do_action( 'gravityview_log_debug', __METHOD__ . ': $parameters passed to gravityview_get_entries(): ', $parameters );
1356 1356
 
@@ -1375,17 +1375,17 @@  discard block
 block discarded – undo
1375 1375
 		$default_page_size = apply_filters( 'gravityview_default_page_size', 25 );
1376 1376
 
1377 1377
 		// Paging & offset
1378
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : $default_page_size;
1378
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : $default_page_size;
1379 1379
 
1380 1380
 		if ( -1 === $page_size ) {
1381 1381
 			$page_size = PHP_INT_MAX;
1382 1382
 		}
1383 1383
 
1384
-		$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1384
+		$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1385 1385
 		$offset = ( $curr_page - 1 ) * $page_size;
1386 1386
 
1387
-		if ( ! empty( $args['offset'] ) ) {
1388
-			$offset += intval( $args['offset'] );
1387
+		if ( ! empty( $args[ 'offset' ] ) ) {
1388
+			$offset += intval( $args[ 'offset' ] );
1389 1389
 		}
1390 1390
 
1391 1391
 		$paging = array(
@@ -1409,8 +1409,8 @@  discard block
 block discarded – undo
1409 1409
 	 */
1410 1410
 	public static function updateViewSorting( $args, $form_id ) {
1411 1411
 		$sorting = array();
1412
-		$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : rgar( $args, 'sort_field' );
1413
-		$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : rgar( $args, 'sort_direction' );
1412
+		$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : rgar( $args, 'sort_field' );
1413
+		$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : rgar( $args, 'sort_direction' );
1414 1414
 
1415 1415
 		$sort_field_id = self::_override_sorting_id_by_field_type( $sort_field_id, $form_id );
1416 1416
 
@@ -1450,11 +1450,11 @@  discard block
 block discarded – undo
1450 1450
 
1451 1451
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1452 1452
 
1453
-		if( ! $sort_field ) {
1453
+		if ( ! $sort_field ) {
1454 1454
 			return $sort_field_id;
1455 1455
 		}
1456 1456
 
1457
-		switch ( $sort_field['type'] ) {
1457
+		switch ( $sort_field[ 'type' ] ) {
1458 1458
 
1459 1459
 			case 'address':
1460 1460
 				// Sorting by full address
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 					 */
1472 1472
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1473 1473
 
1474
-					switch( strtolower( $address_part ) ){
1474
+					switch ( strtolower( $address_part ) ) {
1475 1475
 						case 'street':
1476 1476
 							$sort_field_id .= '.1';
1477 1477
 							break;
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
 		 */
1557 1557
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1558 1558
 
1559
-		if ( empty( $single_entry ) ){
1559
+		if ( empty( $single_entry ) ) {
1560 1560
 			return false;
1561 1561
 		} else {
1562 1562
 			return $single_entry;
@@ -1589,14 +1589,14 @@  discard block
 block discarded – undo
1589 1589
 					$template_id = $view->template ? $view->template->ID : null;
1590 1590
 					$data = $view->as_data();
1591 1591
 				} else {
1592
-					$template_id = $data['template_id'];
1592
+					$template_id = $data[ 'template_id' ];
1593 1593
 				}
1594 1594
 
1595 1595
 				/**
1596 1596
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1597 1597
 				 * @since 1.15
1598 1598
 				 */
1599
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1599
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1600 1600
 					continue;
1601 1601
 				}
1602 1602
 
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 					$lightbox = $view->settings->get( 'lightbox' );
1609 1609
 				} else {
1610 1610
 					/** View data attributes are now stored in \GV\View::$settings */
1611
-					$lightbox = ! empty( $data['atts']['lightbox'] );
1611
+					$lightbox = ! empty( $data[ 'atts' ][ 'lightbox' ] );
1612 1612
 				}
1613 1613
 
1614 1614
 				// If the thickbox is enqueued, add dependencies
@@ -1618,13 +1618,13 @@  discard block
 block discarded – undo
1618 1618
 					 * @filter `gravity_view_lightbox_script` Override the lightbox script to enqueue. Default: `thickbox`
1619 1619
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of it here.
1620 1620
 					 */
1621
-					$js_dependencies[] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1621
+					$js_dependencies[ ] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1622 1622
 
1623 1623
 					/**
1624 1624
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
1625 1625
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of its CSS file here.
1626 1626
 					 */
1627
-					$css_dependencies[] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1627
+					$css_dependencies[ ] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1628 1628
 				}
1629 1629
 
1630 1630
 				/**
@@ -1632,19 +1632,19 @@  discard block
 block discarded – undo
1632 1632
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1633 1633
 				 * @since 1.15
1634 1634
 				 */
1635
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1636
-					$css_dependencies[] = 'dashicons';
1635
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1636
+					$css_dependencies[ ] = 'dashicons';
1637 1637
 				}
1638 1638
 
1639 1639
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1640 1640
 
1641 1641
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1642 1642
 
1643
-				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 );
1643
+				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 );
1644 1644
 
1645 1645
 				wp_enqueue_script( 'gravityview-fe-view' );
1646 1646
 
1647
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1647
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1648 1648
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1649 1649
 				}
1650 1650
 
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
 		} elseif ( empty( $template_id ) ) {
1713 1713
 			do_action( 'gravityview_log_error', '[add_style] Cannot add template style; template_id is empty' );
1714 1714
 		} else {
1715
-			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_'.$template_id ) );
1715
+			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_' . $template_id ) );
1716 1716
 		}
1717 1717
 
1718 1718
 	}
@@ -1737,11 +1737,11 @@  discard block
 block discarded – undo
1737 1737
 		 * Not a table-based template; don't add sort icons
1738 1738
 		 * @since 1.12
1739 1739
 		 */
1740
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1740
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1741 1741
 			return $label;
1742 1742
 		}
1743 1743
 
1744
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1744
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1745 1745
 			return $label;
1746 1746
 		}
1747 1747
 
@@ -1749,29 +1749,29 @@  discard block
 block discarded – undo
1749 1749
 
1750 1750
 		$class = 'gv-sort';
1751 1751
 
1752
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1752
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1753 1753
 
1754 1754
 		$sort_args = array(
1755
-			'sort' => $field['id'],
1755
+			'sort' => $field[ 'id' ],
1756 1756
 			'dir' => 'asc',
1757 1757
 		);
1758 1758
 
1759
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1759
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1760 1760
 			//toggle sorting direction.
1761
-			if ( 'asc' === $sorting['direction'] ) {
1762
-				$sort_args['dir'] = 'desc';
1761
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1762
+				$sort_args[ 'dir' ] = 'desc';
1763 1763
 				$class .= ' gv-icon-sort-desc';
1764 1764
 			} else {
1765
-				$sort_args['dir'] = 'asc';
1765
+				$sort_args[ 'dir' ] = 'asc';
1766 1766
 				$class .= ' gv-icon-sort-asc';
1767 1767
 			}
1768 1768
 		} else {
1769 1769
 			$class .= ' gv-icon-caret-up-down';
1770 1770
 		}
1771 1771
 
1772
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1772
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1773 1773
 
1774
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1774
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1775 1775
 
1776 1776
 	}
1777 1777
 
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
 
1790 1790
 		$field_type = $field_id;
1791 1791
 
1792
-		if( is_numeric( $field_id ) ) {
1792
+		if ( is_numeric( $field_id ) ) {
1793 1793
 			$field = GFFormsModel::get_field( $form, $field_id );
1794 1794
 			$field_type = $field->type;
1795 1795
 		}
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 			return false;
1813 1813
 		}
1814 1814
 
1815
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1815
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1816 1816
 
1817 1817
 	}
1818 1818
 
Please login to merge, or discard this patch.
includes/class-data.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 						/** Deprecated, see \GV\View_Collection::from_post */
102 102
 						if( ( get_post_type( $post ) === 'gravityview' ) ) {
103 103
 							$ids[] = $post->ID;
104
-						} else{
104
+						} else {
105 105
 							// Parse the Post Content
106 106
 							$id = $this->parse_post_content( $post->post_content );
107 107
 							if( $id ) {
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		}
647 647
 
648 648
 		if( ! $message ) {
649
-			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) )  {
649
+			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) ) {
650 650
 				$views = GV\View_Collection::from_post( $post );
651 651
 				$view_ids_in_post = array_map( function( $view ) { return $view->ID; }, $views->all() );
652 652
 			} else {
Please login to merge, or discard this patch.
Spacing   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 			gravityview()->request = new \GV\Dummy_Request();
22 22
 		}
23 23
 
24
-		if( !empty( $passed_post ) ) {
24
+		if ( ! empty( $passed_post ) ) {
25 25
 
26 26
 			$id_or_id_array = $this->maybe_get_view_id( $passed_post );
27 27
 
28 28
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
29
-				foreach( is_array( $id_or_id_array ) ? $id_or_id_array : array( $id_or_id_array ) as $view_id ) {
29
+				foreach ( is_array( $id_or_id_array ) ? $id_or_id_array : array( $id_or_id_array ) as $view_id ) {
30 30
 					if ( \GV\View::exists( $view_id ) && ! gravityview()->views->contains( $view_id ) ) {
31 31
 						gravityview()->views->add( \GV\View::by_id( $view_id ) );
32 32
 					}
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
 	public function maybe_get_view_id( $passed_post ) {
74 74
 		$ids = array();
75 75
 
76
-		if( ! empty( $passed_post ) ) {
76
+		if ( ! empty( $passed_post ) ) {
77 77
 
78
-			if( is_numeric( $passed_post ) ) {
78
+			if ( is_numeric( $passed_post ) ) {
79 79
 				$passed_post = get_post( $passed_post );
80 80
 			}
81 81
 
82 82
 			// Convert WP_Posts into WP_Posts[] array
83
-			if( $passed_post instanceof WP_Post ) {
83
+			if ( $passed_post instanceof WP_Post ) {
84 84
 				$passed_post = array( $passed_post );
85 85
 			}
86 86
 
87
-			if( is_array( $passed_post ) ) {
87
+			if ( is_array( $passed_post ) ) {
88 88
 
89
-				foreach ( $passed_post as &$post) {
89
+				foreach ( $passed_post as &$post ) {
90 90
 					if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post instanceof WP_Post ) {
91 91
 						$views = \GV\View_Collection::from_post( $post );
92 92
 						foreach ( $views->all() as $view ) {
93
-							$ids []= $view->ID;
93
+							$ids [ ] = $view->ID;
94 94
 
95 95
 							/** And as a side-effect... add each view to the global scope. */
96 96
 							if ( ! gravityview()->views->contains( $view->ID ) ) {
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
 						}
100 100
 					} else {
101 101
 						/** Deprecated, see \GV\View_Collection::from_post */
102
-						if( ( get_post_type( $post ) === 'gravityview' ) ) {
103
-							$ids[] = $post->ID;
104
-						} else{
102
+						if ( ( get_post_type( $post ) === 'gravityview' ) ) {
103
+							$ids[ ] = $post->ID;
104
+						} else {
105 105
 							// Parse the Post Content
106 106
 							$id = $this->parse_post_content( $post->post_content );
107
-							if( $id ) {
108
-								$ids = array_merge( $ids, (array) $id );
107
+							if ( $id ) {
108
+								$ids = array_merge( $ids, (array)$id );
109 109
 							}
110 110
 
111 111
 							// Parse the Post Meta
112 112
 							$id = $this->parse_post_meta( $post->ID );
113
-							if( $id ) {
114
-								$ids = array_merge( $ids, (array) $id );
113
+							if ( $id ) {
114
+								$ids = array_merge( $ids, (array)$id );
115 115
 							}
116 116
 						}
117 117
 					}
@@ -125,37 +125,37 @@  discard block
 block discarded – undo
125 125
 					if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
126 126
 						$shortcodes = \GV\Shortcode::parse( $passed_post );
127 127
 						foreach ( $shortcodes as $shortcode ) {
128
-							if ( $shortcode->name == 'gravityview' && !empty( $shortcode->atts['id'] ) ) {
129
-								$ids []= $shortcode->atts['id'];
128
+							if ( $shortcode->name == 'gravityview' && ! empty( $shortcode->atts[ 'id' ] ) ) {
129
+								$ids [ ] = $shortcode->atts[ 'id' ];
130 130
 
131 131
 								/** And as a side-effect... add each view to the global scope. */
132
-								if ( ! gravityview()->views->contains( $shortcode->atts['id'] ) && \GV\View::exists( $shortcode->atts['id'] ) ) {
133
-									gravityview()->views->add( $shortcode->atts['id'] );
132
+								if ( ! gravityview()->views->contains( $shortcode->atts[ 'id' ] ) && \GV\View::exists( $shortcode->atts[ 'id' ] ) ) {
133
+									gravityview()->views->add( $shortcode->atts[ 'id' ] );
134 134
 								}
135 135
 							}
136 136
 						}
137 137
 					} else {
138 138
 						/** Deprecated, use \GV\Shortcode::parse. */
139 139
 						$id = $this->parse_post_content( $passed_post );
140
-						if( $id ) {
141
-							$ids = array_merge( $ids, (array) $id );
140
+						if ( $id ) {
141
+							$ids = array_merge( $ids, (array)$id );
142 142
 						}
143 143
 					}
144 144
 
145 145
 				} else {
146 146
 					$id = $this->get_id_from_atts( $passed_post );
147
-					$ids[] = intval( $id );
147
+					$ids[ ] = intval( $id );
148 148
 				}
149 149
 			}
150 150
 		}
151 151
 
152
-		if( empty($ids) ) {
152
+		if ( empty( $ids ) ) {
153 153
 			return NULL;
154 154
 		}
155 155
 
156 156
 		// If it's just one ID, return that.
157 157
 		// Otherwise, return array of IDs
158
-		return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
158
+		return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
159 159
 	}
160 160
 
161 161
 	/**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public static function getInstance( $passed_post = NULL ) {
165 165
 
166
-		if( empty( self::$instance ) ) {
166
+		if ( empty( self::$instance ) ) {
167 167
 			self::$instance = new GravityView_View_Data( $passed_post );
168 168
 		}
169 169
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 				return array();
181 181
 			}
182 182
 			return array_combine(
183
-				array_map( function ( $view ) { return $view->ID; }, gravityview()->views->all() ),
184
-				array_map( function ( $view ) { return $view->as_data(); }, gravityview()->views->all() )
183
+				array_map( function( $view ) { return $view->ID; }, gravityview()->views->all() ),
184
+				array_map( function( $view ) { return $view->as_data(); }, gravityview()->views->all() )
185 185
 			);
186 186
 		}
187 187
 		return $this->views;
@@ -208,19 +208,19 @@  discard block
 block discarded – undo
208 208
 			return $view->as_data();
209 209
 		}
210 210
 
211
-		if( ! is_numeric( $view_id) ) {
212
-			do_action('gravityview_log_error', sprintf('GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id) );
211
+		if ( ! is_numeric( $view_id ) ) {
212
+			do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id ) );
213 213
 			return false;
214 214
 		}
215 215
 
216 216
 		// Backup: the view hasn't been fetched yet. Doing it now.
217 217
 		if ( ! isset( $this->views[ $view_id ] ) ) {
218
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] View #%s not set yet.', $view_id) );
218
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] View #%s not set yet.', $view_id ) );
219 219
 			return $this->add_view( $view_id, $atts );
220 220
 		}
221 221
 
222 222
 		if ( empty( $this->views[ $view_id ] ) ) {
223
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id) );
223
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id ) );
224 224
 			return false;
225 225
 		}
226 226
 
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 		}
266 266
 
267 267
 		// Handle array of IDs
268
-		if( is_array( $view_id ) ) {
269
-			foreach( $view_id as $id ) {
268
+		if ( is_array( $view_id ) ) {
269
+			foreach ( $view_id as $id ) {
270 270
 
271 271
 				$this->add_view( $id, $atts );
272 272
 			}
@@ -275,21 +275,21 @@  discard block
 block discarded – undo
275 275
 		}
276 276
 
277 277
 		// The view has been set already; returning stored view.
278
-		if ( !empty( $this->views[ $view_id ] ) ) {
279
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id) );
278
+		if ( ! empty( $this->views[ $view_id ] ) ) {
279
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id ) );
280 280
 			return $this->views[ $view_id ];
281 281
 		}
282 282
 
283
-		if( ! $this->view_exists( $view_id ) ) {
284
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id) );
283
+		if ( ! $this->view_exists( $view_id ) ) {
284
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id ) );
285 285
 			return false;
286 286
 		}
287 287
 
288 288
 		$form_id = gravityview_get_form_id( $view_id );
289 289
 
290
-		if( empty( $form_id ) ) {
290
+		if ( empty( $form_id ) ) {
291 291
 
292
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id) );
292
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id ) );
293 293
 
294 294
 			return false;
295 295
 		}
@@ -297,21 +297,21 @@  discard block
 block discarded – undo
297 297
 		// Get the settings for the View ID
298 298
 		$view_settings = gravityview_get_template_settings( $view_id );
299 299
 
300
-		do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id), $view_settings );
300
+		do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id ), $view_settings );
301 301
 
302 302
 		// Merge the view settings with the defaults
303 303
 		$view_defaults = wp_parse_args( $view_settings, defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults() : self::get_default_args() );
304 304
 
305
-		do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults );
305
+		do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults );
306 306
 
307
-		if( ! empty( $atts ) && is_array( $atts ) ) {
307
+		if ( ! empty( $atts ) && is_array( $atts ) ) {
308 308
 
309
-			do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging  with the $view_defaults', $atts );
309
+			do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging  with the $view_defaults', $atts );
310 310
 
311 311
 			// Get the settings from the shortcode and merge them with defaults.
312 312
 			$atts = shortcode_atts( $view_defaults, $atts );
313 313
 
314
-			do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging  with the $view_defaults', $atts );
314
+			do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging  with the $view_defaults', $atts );
315 315
 
316 316
 		} else {
317 317
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 		}
322 322
 
323
-		unset( $atts['id'], $view_defaults, $view_settings );
323
+		unset( $atts[ 'id' ], $view_defaults, $view_settings );
324 324
 
325 325
 		$data = array(
326 326
 			'id' => $view_id,
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			'form' => gravityview_get_form( $form_id ),
334 334
 		);
335 335
 
336
-		do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] View #%s being added.', $view_id), $data );
336
+		do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] View #%s being added.', $view_id ), $data );
337 337
 
338 338
 		$this->views[ $view_id ] = $data;
339 339
 
@@ -383,15 +383,15 @@  discard block
 block discarded – undo
383 383
 			throw new Exception( __METHOD__ . ' should not be called anymore. Why was it?' );
384 384
 		}
385 385
 
386
-		if( empty( $dir_fields ) || !is_array( $dir_fields ) ) {
386
+		if ( empty( $dir_fields ) || ! is_array( $dir_fields ) ) {
387 387
 			return $dir_fields;
388 388
 		}
389 389
 
390
-		foreach( $dir_fields as $area => $fields ) {
390
+		foreach ( $dir_fields as $area => $fields ) {
391 391
 
392
-			foreach( (array)$fields as $uniqid => $properties ) {
392
+			foreach ( (array)$fields as $uniqid => $properties ) {
393 393
 
394
-				if( $this->hide_field_check_conditions( $properties ) ) {
394
+				if ( $this->hide_field_check_conditions( $properties ) ) {
395 395
 					unset( $dir_fields[ $area ][ $uniqid ] );
396 396
 				}
397 397
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 		}
419 419
 
420 420
 		// logged-in visibility
421
-		if( ! empty( $properties['only_loggedin'] ) && ! GVCommon::has_cap( $properties['only_loggedin_cap'] ) ) {
421
+		if ( ! empty( $properties[ 'only_loggedin' ] ) && ! GVCommon::has_cap( $properties[ 'only_loggedin_cap' ] ) ) {
422 422
 			return true;
423 423
 		}
424 424
 
@@ -449,14 +449,14 @@  discard block
 block discarded – undo
449 449
 		// Get the settings from the shortcode and merge them with defaults.
450 450
 		$atts = wp_parse_args( $atts, defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults() : self::get_default_args() );
451 451
 
452
-		$view_id = ! empty( $atts['view_id'] ) ? (int)$atts['view_id'] : NULL;
452
+		$view_id = ! empty( $atts[ 'view_id' ] ) ? (int)$atts[ 'view_id' ] : NULL;
453 453
 
454
-		if( empty( $view_id ) && !empty( $atts['id'] ) ) {
455
-			$view_id = (int)$atts['id'];
454
+		if ( empty( $view_id ) && ! empty( $atts[ 'id' ] ) ) {
455
+			$view_id = (int)$atts[ 'id' ];
456 456
 		}
457 457
 
458
-		if( empty( $view_id ) ) {
459
-			do_action('gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts );
458
+		if ( empty( $view_id ) ) {
459
+			do_action( 'gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts );
460 460
 			return;
461 461
 		}
462 462
 
@@ -480,68 +480,68 @@  discard block
 block discarded – undo
480 480
 		if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
481 481
 			$ids = array();
482 482
 			foreach ( \GV\Shortcode::parse( $content ) as $shortcode ) {
483
-				if ( $shortcode->name == 'gravityview' && is_numeric( $shortcode->atts['id'] ) ) {
484
-					if ( \GV\View::exists( $shortcode->atts['id'] ) && ! gravityview()->views->contains( $shortcode->atts['id'] ) ) {
485
-						gravityview()->views->add( \GV\View::by_id( $shortcode->atts['id'] ) );
483
+				if ( $shortcode->name == 'gravityview' && is_numeric( $shortcode->atts[ 'id' ] ) ) {
484
+					if ( \GV\View::exists( $shortcode->atts[ 'id' ] ) && ! gravityview()->views->contains( $shortcode->atts[ 'id' ] ) ) {
485
+						gravityview()->views->add( \GV\View::by_id( $shortcode->atts[ 'id' ] ) );
486 486
 					}
487 487
 					/**
488 488
 					 * The original function outputs the ID even though it wasn't added by ::add_view()
489 489
 					 * Wether this is a bug or not remains a mystery. But we need to emulate this behavior
490 490
 					 * until better times.
491 491
 					 */
492
-					$ids []= $shortcode->atts['id'];
492
+					$ids [ ] = $shortcode->atts[ 'id' ];
493 493
 				}
494 494
 			}
495 495
 			if ( empty ( $ids ) ) {
496 496
 				return null;
497 497
 			}
498
-			return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
498
+			return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
499 499
 		}
500 500
 
501 501
 		/**
502 502
 		 * @hack This is so that the shortcode is registered for the oEmbed preview in the Admin
503 503
 		 * @since 1.6
504 504
 		 */
505
-		if( ! shortcode_exists('gravityview') && class_exists( 'GravityView_Shortcode' ) ) {
505
+		if ( ! shortcode_exists( 'gravityview' ) && class_exists( 'GravityView_Shortcode' ) ) {
506 506
 			new GravityView_Shortcode;
507 507
 		}
508 508
 
509 509
 		$shortcodes = gravityview_has_shortcode_r( $content, 'gravityview' );
510 510
 
511
-		if( empty( $shortcodes ) ) {
511
+		if ( empty( $shortcodes ) ) {
512 512
 			return NULL;
513 513
 		}
514 514
 
515
-		do_action('gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes );
515
+		do_action( 'gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes );
516 516
 
517 517
 		$ids = array();
518 518
 
519
-		foreach ($shortcodes as $key => $shortcode) {
519
+		foreach ( $shortcodes as $key => $shortcode ) {
520 520
 
521
-			$shortcode[3] = htmlspecialchars_decode( $shortcode[3], ENT_QUOTES );
521
+			$shortcode[ 3 ] = htmlspecialchars_decode( $shortcode[ 3 ], ENT_QUOTES );
522 522
 
523
-			$args = shortcode_parse_atts( $shortcode[3] );
523
+			$args = shortcode_parse_atts( $shortcode[ 3 ] );
524 524
 
525
-			if( empty( $args['id'] ) ) {
526
-				do_action('gravityview_log_error', 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts', $shortcode );
525
+			if ( empty( $args[ 'id' ] ) ) {
526
+				do_action( 'gravityview_log_error', 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts', $shortcode );
527 527
 				continue;
528 528
 			}
529 529
 
530
-			do_action('gravityview_log_debug', sprintf('GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args['id']), $args );
530
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args[ 'id' ] ), $args );
531 531
 
532 532
 			// Store the View to the object for later fetching.
533
-			$this->add_view( $args['id'], $args );
533
+			$this->add_view( $args[ 'id' ], $args );
534 534
 
535
-			$ids[] = $args['id'];
535
+			$ids[ ] = $args[ 'id' ];
536 536
 		}
537 537
 
538
-		if( empty($ids) ) {
538
+		if ( empty( $ids ) ) {
539 539
 			return NULL;
540 540
 		}
541 541
 
542 542
 		// If it's just one ID, return that.
543 543
 		// Otherwise, return array of IDs
544
-		return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids;
544
+		return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids;
545 545
 
546 546
 	}
547 547
 
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 		 */
571 571
 		$meta_keys = (array)apply_filters( 'gravityview/data/parse/meta_keys', array(), $post_id );
572 572
 
573
-		if( empty( $meta_keys ) ) {
573
+		if ( empty( $meta_keys ) ) {
574 574
 			return NULL;
575 575
 		}
576 576
 
@@ -578,16 +578,16 @@  discard block
 block discarded – undo
578 578
 
579 579
 		$meta_content = '';
580 580
 
581
-		foreach( $meta_keys as $key ) {
582
-			$meta = get_post_meta( $post_id, $key , true );
583
-			if( ! is_string( $meta ) ) {
581
+		foreach ( $meta_keys as $key ) {
582
+			$meta = get_post_meta( $post_id, $key, true );
583
+			if ( ! is_string( $meta ) ) {
584 584
 				continue;
585 585
 			}
586 586
 			$meta_content .= $meta . ' ';
587 587
 		}
588 588
 
589
-		if( empty( $meta_content ) ) {
590
-			do_action('gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys );
589
+		if ( empty( $meta_content ) ) {
590
+			do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys );
591 591
 			return NULL;
592 592
 		}
593 593
 
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 		$message = NULL;
616 616
 
617 617
 		// Not invalid if not set!
618
-		if( empty( $post_id ) || empty( $view_id ) ) {
618
+		if ( empty( $post_id ) || empty( $view_id ) ) {
619 619
 
620
-			if( $empty_is_valid ) {
620
+			if ( $empty_is_valid ) {
621 621
 				return true;
622 622
 			}
623 623
 
624 624
 			$message = esc_html__( 'The ID is required.', 'gravityview' );
625 625
 		}
626 626
 
627
-		if( ! $message ) {
627
+		if ( ! $message ) {
628 628
 			$status = get_post_status( $post_id );
629 629
 
630 630
 			// Nothing exists with that post ID.
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 			}
637 637
 		}
638 638
 
639
-		if( ! $message ) {
639
+		if ( ! $message ) {
640 640
 
641 641
 			// Nothing exists with that post ID.
642 642
 			if ( empty( $status ) || in_array( $status, array( 'revision', 'attachment' ) ) ) {
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
 
646 646
 		}
647 647
 
648
-		if( ! $message ) {
649
-			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) )  {
648
+		if ( ! $message ) {
649
+			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && $post = get_post( $post_id ) ) {
650 650
 				$views = GV\View_Collection::from_post( $post );
651 651
 				$view_ids_in_post = array_map( function( $view ) { return $view->ID; }, $views->all() );
652 652
 			} else {
@@ -655,21 +655,21 @@  discard block
 block discarded – undo
655 655
 			}
656 656
 
657 657
 			// The post or page specified does not contain the shortcode.
658
-			if ( false === in_array( $view_id, (array) $view_ids_in_post ) ) {
658
+			if ( false === in_array( $view_id, (array)$view_ids_in_post ) ) {
659 659
 				$message = sprintf( esc_html__( 'The Post ID entered is not valid. You may have entered a post or page that does not contain the selected View. Make sure the post contains the following shortcode: %s', 'gravityview' ), '<br /><code>[gravityview id="' . intval( $view_id ) . '"]</code>' );
660 660
 			}
661 661
 		}
662 662
 
663
-		if( ! $message ) {
663
+		if ( ! $message ) {
664 664
 
665 665
 			// It's a View
666 666
 			if ( ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && \GV\View::exists( $post_id ) )
667 667
 				|| 'gravityview' === get_post_type( $post_id ) ) {
668
-				$message = esc_html__( 'The ID is already a View.', 'gravityview' );;
668
+				$message = esc_html__( 'The ID is already a View.', 'gravityview' ); ;
669 669
 			}
670 670
 		}
671 671
 
672
-		if( $message ) {
672
+		if ( $message ) {
673 673
 			return new WP_Error( 'invalid_embed_id', $message );
674 674
 		}
675 675
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 
687 687
 		$args = defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ? \GV\View_Settings::defaults( $with_details ) : self::get_default_args( $with_details );
688 688
 
689
-		if( !isset( $args[ $key ] ) ) { return NULL; }
689
+		if ( ! isset( $args[ $key ] ) ) { return NULL; }
690 690
 
691 691
 		return $args[ $key ];
692 692
 	}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 		 */
724 724
 		$default_settings = apply_filters( 'gravityview_default_args', array(
725 725
 			'id' => array(
726
-				'label' => __('View ID', 'gravityview'),
726
+				'label' => __( 'View ID', 'gravityview' ),
727 727
 				'type' => 'number',
728 728
 				'group'	=> 'default',
729 729
 				'value' => NULL,
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 				'show_in_shortcode' => false,
732 732
 			),
733 733
 			'page_size' => array(
734
-				'label' 	=> __('Number of entries per page', 'gravityview'),
734
+				'label' 	=> __( 'Number of entries per page', 'gravityview' ),
735 735
 				'type' => 'number',
736 736
 				'class'	=> 'small-text',
737 737
 				'group'	=> 'default',
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 				'show_in_shortcode' => true,
740 740
 			),
741 741
 			'offset' => array(
742
-				'label' 	=> __('Offset entries starting from', 'gravityview'),
742
+				'label' 	=> __( 'Offset entries starting from', 'gravityview' ),
743 743
 				'type' => 'number',
744 744
 				'class'	=> 'small-text',
745 745
 				'group'	=> 'default',
@@ -763,8 +763,8 @@  discard block
 block discarded – undo
763 763
 			),
764 764
 			'admin_show_all_statuses' => array(
765 765
 				'label' => __( 'Show all entries to administrators', 'gravityview' ),
766
-				'desc'	=> __('Administrators will be able to see entries with any approval status.', 'gravityview'),
767
-				'tooltip' => __('Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview'),
766
+				'desc'	=> __( 'Administrators will be able to see entries with any approval status.', 'gravityview' ),
767
+				'tooltip' => __( 'Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview' ),
768 768
 				'requires' => 'show_only_approved',
769 769
 				'type' => 'checkbox',
770 770
 				'group'	=> 'default',
@@ -789,40 +789,40 @@  discard block
 block discarded – undo
789 789
 			'user_edit' => array(
790 790
 				'label'	=> __( 'Allow User Edit', 'gravityview' ),
791 791
 				'group'	=> 'default',
792
-				'desc'	=> __('Allow logged-in users to edit entries they created.', 'gravityview'),
792
+				'desc'	=> __( 'Allow logged-in users to edit entries they created.', 'gravityview' ),
793 793
 				'value'	=> 0,
794
-				'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'),
794
+				'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ),
795 795
 				'type'	=> 'checkbox',
796 796
 				'show_in_shortcode' => true,
797 797
 			),
798 798
 			'user_delete' => array(
799 799
 				'label'	=> __( 'Allow User Delete', 'gravityview' ),
800 800
 				'group'	=> 'default',
801
-				'desc'	=> __('Allow logged-in users to delete entries they created.', 'gravityview'),
801
+				'desc'	=> __( 'Allow logged-in users to delete entries they created.', 'gravityview' ),
802 802
 				'value'	=> 0,
803
-				'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'),
803
+				'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ),
804 804
 				'type'	=> 'checkbox',
805 805
 				'show_in_shortcode' => true,
806 806
 			),
807 807
 			'sort_field' => array(
808
-				'label'	=> __('Sort by field', 'gravityview'),
808
+				'label'	=> __( 'Sort by field', 'gravityview' ),
809 809
 				'type' => 'select',
810 810
 				'value' => '',
811 811
 				'group'	=> 'sort',
812 812
 				'options' => array(
813
-					'' => __( 'Default', 'gravityview'),
814
-					'date_created' => __( 'Date Created', 'gravityview'),
813
+					'' => __( 'Default', 'gravityview' ),
814
+					'date_created' => __( 'Date Created', 'gravityview' ),
815 815
 				),
816 816
 				'show_in_shortcode' => true,
817 817
 			),
818 818
 			'sort_direction' => array(
819
-				'label' 	=> __('Sort direction', 'gravityview'),
819
+				'label' 	=> __( 'Sort direction', 'gravityview' ),
820 820
 				'type' => 'select',
821 821
 				'value' => 'ASC',
822 822
 				'group'	=> 'sort',
823 823
 				'options' => array(
824
-					'ASC' => __('ASC', 'gravityview'),
825
-					'DESC' => __('DESC', 'gravityview'),
824
+					'ASC' => __( 'ASC', 'gravityview' ),
825
+					'DESC' => __( 'DESC', 'gravityview' ),
826 826
 					//'RAND' => __('Random', 'gravityview'),
827 827
 				),
828 828
 				'show_in_shortcode' => true,
@@ -838,69 +838,69 @@  discard block
 block discarded – undo
838 838
 				'show_in_template' => array( 'default_table', 'preset_business_data', 'preset_issue_tracker', 'preset_resume_board', 'preset_job_board' ),
839 839
 			),
840 840
 			'start_date' => array(
841
-				'label' 	=> __('Filter by Start Date', 'gravityview'),
841
+				'label' 	=> __( 'Filter by Start Date', 'gravityview' ),
842 842
 				'class'	=> 'gv-datepicker',
843
-				'desc'	=> __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
843
+				'desc'	=> __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ),
844 844
 				'type' => 'text',
845 845
 				'value' => '',
846 846
 				'group'	=> 'filter',
847 847
 				'show_in_shortcode' => true,
848 848
 			),
849 849
 			'end_date' => array(
850
-				'label' 	=> __('Filter by End Date', 'gravityview'),
850
+				'label' 	=> __( 'Filter by End Date', 'gravityview' ),
851 851
 				'class'	=> 'gv-datepicker',
852
-				'desc'	=> __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
852
+				'desc'	=> __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ),
853 853
 				'type' => 'text',
854 854
 				'value' => '',
855 855
 				'group'	=> 'filter',
856 856
 				'show_in_shortcode' => true,
857 857
 			),
858 858
 			'class' => array(
859
-				'label' 	=> __('CSS Class', 'gravityview'),
860
-				'desc'	=> __('CSS class to add to the wrapping HTML container.', 'gravityview'),
859
+				'label' 	=> __( 'CSS Class', 'gravityview' ),
860
+				'desc'	=> __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ),
861 861
 				'group'	=> 'default',
862 862
 				'type' => 'text',
863 863
 				'value' => '',
864 864
 				'show_in_shortcode' => false,
865 865
 			),
866 866
 			'search_value' => array(
867
-				'label' 	=> __('Search Value', 'gravityview'),
868
-				'desc'	=> __('Define a default search value for the View', 'gravityview'),
867
+				'label' 	=> __( 'Search Value', 'gravityview' ),
868
+				'desc'	=> __( 'Define a default search value for the View', 'gravityview' ),
869 869
 				'type' => 'text',
870 870
 				'value' => '',
871 871
 				'group'	=> 'filter',
872 872
 				'show_in_shortcode' => false,
873 873
 			),
874 874
 			'search_field' => array(
875
-				'label' 	=> __('Search Field', 'gravityview'),
876
-				'desc'	=> __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'),
875
+				'label' 	=> __( 'Search Field', 'gravityview' ),
876
+				'desc'	=> __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ),
877 877
 				'type' => 'number',
878 878
 				'value' => '',
879 879
 				'group'	=> 'filter',
880 880
 				'show_in_shortcode' => false,
881 881
 			),
882 882
 			'single_title' => array(
883
-				'label'	=> __('Single Entry Title', 'gravityview'),
883
+				'label'	=> __( 'Single Entry Title', 'gravityview' ),
884 884
 				'type'	=> 'text',
885
-				'desc'	=> __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'),
885
+				'desc'	=> __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ),
886 886
 				'group'	=> 'default',
887 887
 				'value'	=> '',
888 888
 				'show_in_shortcode' => false,
889 889
 				'full_width' => true,
890 890
 			),
891 891
 			'back_link_label' => array(
892
-				'label'	=> __('Back Link Label', 'gravityview'),
892
+				'label'	=> __( 'Back Link Label', 'gravityview' ),
893 893
 				'group'	=> 'default',
894
-				'desc'	=> __('The text of the link that returns to the multiple entries view.', 'gravityview'),
894
+				'desc'	=> __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ),
895 895
 				'type'	=> 'text',
896 896
 				'value'	=> '',
897 897
 				'show_in_shortcode' => false,
898 898
 				'full_width' => true,
899 899
 			),
900 900
 			'embed_only' => array(
901
-				'label'	=> __('Prevent Direct Access', 'gravityview'),
901
+				'label'	=> __( 'Prevent Direct Access', 'gravityview' ),
902 902
 				'group'	=> 'default',
903
-				'desc'	=> __('Only allow access to this View when embedded using the shortcode.', 'gravityview'),
903
+				'desc'	=> __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ),
904 904
 				'type'	=> 'checkbox',
905 905
 				'value'	=> '',
906 906
 				'tooltip' => false,
@@ -912,15 +912,15 @@  discard block
 block discarded – undo
912 912
 				'value' => '',
913 913
 				'show_in_shortcode' => false,
914 914
 			),
915
-		));
915
+		) );
916 916
 
917 917
 		// By default, we only want the key => value pairing, not the whole array.
918
-		if( empty( $with_details ) ) {
918
+		if ( empty( $with_details ) ) {
919 919
 
920 920
 			$defaults = array();
921 921
 
922
-			foreach( $default_settings as $key => $value ) {
923
-				$defaults[ $key ] = $value['value'];
922
+			foreach ( $default_settings as $key => $value ) {
923
+				$defaults[ $key ] = $value[ 'value' ];
924 924
 			}
925 925
 
926 926
 			return $defaults;
@@ -929,12 +929,12 @@  discard block
 block discarded – undo
929 929
 		// But sometimes, we want all the details.
930 930
 		else {
931 931
 
932
-			foreach ($default_settings as $key => $value) {
932
+			foreach ( $default_settings as $key => $value ) {
933 933
 
934 934
 				// If the $group argument is set for the method,
935 935
 				// ignore any settings that aren't in that group.
936
-				if( !empty( $group ) && is_string( $group ) ) {
937
-					if( empty( $value['group'] ) || $value['group'] !== $group ) {
936
+				if ( ! empty( $group ) && is_string( $group ) ) {
937
+					if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) {
938 938
 						unset( $default_settings[ $key ] );
939 939
 					}
940 940
 				}
Please login to merge, or discard this patch.
includes/class-gravityview-admin-bar.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		/** @var WP_Admin_Bar $wp_admin_bar */
39 39
 		global $wp_admin_bar;
40 40
 
41
-		if( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) {
41
+		if ( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) {
42 42
 			return;
43 43
 		}
44 44
 
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 				'parent' => 'gravityview',
111 111
 				'title' => __( 'Edit Entry', 'gravityview' ),
112 112
 				'meta' => array(
113
-					'title' => sprintf( __( 'Edit Entry %s', 'gravityview' ), GravityView_API::get_entry_slug( $entry['id'], $entry ) ),
113
+					'title' => sprintf( __( 'Edit Entry %s', 'gravityview' ), GravityView_API::get_entry_slug( $entry[ 'id' ], $entry ) ),
114 114
 				),
115
-				'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&amp;screen_mode=edit&amp;view=entry&amp;id=%d&lid=%d', $entry['form_id'], $entry['id'] ) ) ),
115
+				'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&amp;screen_mode=edit&amp;view=entry&amp;id=%d&lid=%d', $entry[ 'form_id' ], $entry[ 'id' ] ) ) ),
116 116
 			) );
117 117
 
118 118
 		}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		/** @var WP_Admin_Bar $wp_admin_bar */
129 129
 		global $wp_admin_bar;
130 130
 
131
-		if( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) {
131
+		if ( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) {
132 132
 
133 133
 			if ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) ) {
134 134
 				$views = gravityview()->views->all();
@@ -152,21 +152,21 @@  discard block
 block discarded – undo
152 152
 						$form_id = $view->form ? $view->form->ID : null;
153 153
 					} else {
154 154
 						/** Deprecated. */
155
-						$view_id = $view['id'];
156
-						$form_id = $view['form_id'];
155
+						$view_id = $view[ 'id' ];
156
+						$form_id = $view[ 'form_id' ];
157 157
 					}
158 158
 
159 159
 					$edit_view_title = __( 'Edit View', 'gravityview' );
160 160
 					$edit_form_title = __( 'Edit Form', 'gravityview' );
161 161
 
162
-					if( sizeof( $views ) > 1 ) {
162
+					if ( sizeof( $views ) > 1 ) {
163 163
 						$edit_view_title = sprintf( _x( 'Edit View #%d', 'Edit View with the ID of %d', 'gravityview' ), $view_id );
164 164
 						$edit_form_title = sprintf( __( 'Edit Form #%d', 'Edit Form with the ID of %d', 'gravityview' ), $form_id );
165 165
 					}
166 166
 
167
-					if( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) {
167
+					if ( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) {
168 168
 
169
-						$added_views[] = $view_id;
169
+						$added_views[ ] = $view_id;
170 170
 
171 171
 						$wp_admin_bar->add_menu( array(
172 172
 							'id'    => 'edit-view-' . $view_id,
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 						) );
177 177
 					}
178 178
 
179
-					if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms )  ) {
179
+					if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms ) ) {
180 180
 
181
-						$added_forms[] = $form_id;
181
+						$added_forms[ ] = $form_id;
182 182
 
183 183
 						$wp_admin_bar->add_menu( array(
184 184
 							'id'    => 'edit-form-' . $form_id,
Please login to merge, or discard this patch.
future/includes/class-gv-collection-view.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,12 +129,12 @@
 block discarded – undo
129 129
 
130 130
 		/** Let's find us some [gravityview] shortcodes perhaps. */
131 131
 		foreach ( Shortcode::parse( $content ) as $shortcode ) {
132
-			if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts['id'] ) ) {
132
+			if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts[ 'id' ] ) ) {
133 133
 				continue;
134 134
 			}
135 135
 
136
-			if ( is_numeric( $shortcode->atts['id'] ) ) {
137
-				$view = View::by_id( $shortcode->atts['id'] );
136
+			if ( is_numeric( $shortcode->atts[ 'id' ] ) ) {
137
+				$view = View::by_id( $shortcode->atts[ 'id' ] );
138 138
 				if ( ! $view ) {
139 139
 					continue;
140 140
 				}
Please login to merge, or discard this patch.
future/includes/class-gv-collection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @return void
26 26
 	 */
27 27
 	public function add( $value ) {
28
-		$this->storage []= $value;
28
+		$this->storage [ ] = $value;
29 29
 	}
30 30
 
31 31
 	/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function merge( \GV\Collection $collection ) {
52
-		array_map( array( $this, 'add'), $collection->all() );
52
+		array_map( array( $this, 'add' ), $collection->all() );
53 53
 	}
54 54
 
55 55
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-logger-wp-action.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	protected function log( $level, $message, $context ) {
29 29
 
30 30
 		$backtrace = debug_backtrace();
31
-		$location = $this->interpolate( "{class}{type}{function}", $backtrace[2] );
31
+		$location = $this->interpolate( "{class}{type}{function}", $backtrace[ 2 ] );
32 32
 
33 33
 		$message = $this->interpolate( "[$level, $location] $message", $context );
34 34
 
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 			do_action(
53 53
 				sprintf( 'gravityview_log_%s_test', $action ),
54 54
 				$this->interpolate( $message, $context ),
55
-				empty( $context['data'] ) ? array() : $context['data']
55
+				empty( $context[ 'data' ] ) ? array() : $context[ 'data' ]
56 56
 			);
57 57
 		}
58 58
 		
59 59
 		do_action(
60 60
 			sprintf( 'gravityview_log_%s', $action ),
61 61
 			$this->interpolate( $message, $context ),
62
-			empty( $context['data'] ) ? array() : $context['data']
62
+			empty( $context[ 'data' ] ) ? array() : $context[ 'data' ]
63 63
 		);
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
future/includes/class-gv-logger.php 3 patches
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
  * Describes log levels.
11 11
  */
12 12
 class LogLevel {
13
-    const EMERGENCY = 'emergency';
14
-    const ALERT     = 'alert';
15
-    const CRITICAL  = 'critical';
16
-    const ERROR     = 'error';
17
-    const WARNING   = 'warning';
18
-    const NOTICE    = 'notice';
19
-    const INFO      = 'info';
20
-    const DEBUG     = 'debug';
13
+	const EMERGENCY = 'emergency';
14
+	const ALERT     = 'alert';
15
+	const CRITICAL  = 'critical';
16
+	const ERROR     = 'error';
17
+	const WARNING   = 'warning';
18
+	const NOTICE    = 'notice';
19
+	const INFO      = 'info';
20
+	const DEBUG     = 'debug';
21 21
 }
22 22
 
23 23
 /**
@@ -28,127 +28,127 @@  discard block
 block discarded – undo
28 28
  * @see https://github.com/php-fig/log/blob/master/Psr/Log/AbstractLogger.php
29 29
  */
30 30
 abstract class Logger /** @todo extends Psr\Log\AbstractLogger */ {
31
-    /**
32
-     * System is unusable.
33
-     *
34
-     * @param string $message
35
-     * @param array  $context
36
-     *
37
-     * @return void
38
-     */
39
-    public function emergency($message, array $context = array())
40
-    {
41
-        $this->log(LogLevel::EMERGENCY, $message, $context);
42
-    }
31
+	/**
32
+	 * System is unusable.
33
+	 *
34
+	 * @param string $message
35
+	 * @param array  $context
36
+	 *
37
+	 * @return void
38
+	 */
39
+	public function emergency($message, array $context = array())
40
+	{
41
+		$this->log(LogLevel::EMERGENCY, $message, $context);
42
+	}
43 43
 
44
-    /**
45
-     * Action must be taken immediately.
46
-     *
47
-     * Example: Entire website down, database unavailable, etc. This should
48
-     * trigger the SMS alerts and wake you up.
49
-     *
50
-     * @param string $message
51
-     * @param array  $context
52
-     *
53
-     * @return void
54
-     */
55
-    public function alert($message, array $context = array())
56
-    {
57
-        $this->log(LogLevel::ALERT, $message, $context);
58
-    }
44
+	/**
45
+	 * Action must be taken immediately.
46
+	 *
47
+	 * Example: Entire website down, database unavailable, etc. This should
48
+	 * trigger the SMS alerts and wake you up.
49
+	 *
50
+	 * @param string $message
51
+	 * @param array  $context
52
+	 *
53
+	 * @return void
54
+	 */
55
+	public function alert($message, array $context = array())
56
+	{
57
+		$this->log(LogLevel::ALERT, $message, $context);
58
+	}
59 59
 
60
-    /**
61
-     * Critical conditions.
62
-     *
63
-     * Example: Application component unavailable, unexpected exception.
64
-     *
65
-     * @param string $message
66
-     * @param array  $context
67
-     *
68
-     * @return void
69
-     */
70
-    public function critical($message, array $context = array())
71
-    {
72
-        $this->log(LogLevel::CRITICAL, $message, $context);
73
-    }
60
+	/**
61
+	 * Critical conditions.
62
+	 *
63
+	 * Example: Application component unavailable, unexpected exception.
64
+	 *
65
+	 * @param string $message
66
+	 * @param array  $context
67
+	 *
68
+	 * @return void
69
+	 */
70
+	public function critical($message, array $context = array())
71
+	{
72
+		$this->log(LogLevel::CRITICAL, $message, $context);
73
+	}
74 74
 
75
-    /**
76
-     * Runtime errors that do not require immediate action but should typically
77
-     * be logged and monitored.
78
-     *
79
-     * @param string $message
80
-     * @param array  $context
81
-     *
82
-     * @return void
83
-     */
84
-    public function error($message, array $context = array())
85
-    {
86
-        $this->log(LogLevel::ERROR, $message, $context);
87
-    }
75
+	/**
76
+	 * Runtime errors that do not require immediate action but should typically
77
+	 * be logged and monitored.
78
+	 *
79
+	 * @param string $message
80
+	 * @param array  $context
81
+	 *
82
+	 * @return void
83
+	 */
84
+	public function error($message, array $context = array())
85
+	{
86
+		$this->log(LogLevel::ERROR, $message, $context);
87
+	}
88 88
 
89
-    /**
90
-     * Exceptional occurrences that are not errors.
91
-     *
92
-     * Example: Use of deprecated APIs, poor use of an API, undesirable things
93
-     * that are not necessarily wrong.
94
-     *
95
-     * @param string $message
96
-     * @param array  $context
97
-     *
98
-     * @return void
99
-     */
100
-    public function warning($message, array $context = array())
101
-    {
102
-        $this->log(LogLevel::WARNING, $message, $context);
103
-    }
89
+	/**
90
+	 * Exceptional occurrences that are not errors.
91
+	 *
92
+	 * Example: Use of deprecated APIs, poor use of an API, undesirable things
93
+	 * that are not necessarily wrong.
94
+	 *
95
+	 * @param string $message
96
+	 * @param array  $context
97
+	 *
98
+	 * @return void
99
+	 */
100
+	public function warning($message, array $context = array())
101
+	{
102
+		$this->log(LogLevel::WARNING, $message, $context);
103
+	}
104 104
 
105
-    /**
106
-     * Normal but significant events.
107
-     *
108
-     * @param string $message
109
-     * @param array  $context
110
-     *
111
-     * @return void
112
-     */
113
-    public function notice($message, array $context = array())
114
-    {
115
-        $this->log(LogLevel::NOTICE, $message, $context);
116
-    }
105
+	/**
106
+	 * Normal but significant events.
107
+	 *
108
+	 * @param string $message
109
+	 * @param array  $context
110
+	 *
111
+	 * @return void
112
+	 */
113
+	public function notice($message, array $context = array())
114
+	{
115
+		$this->log(LogLevel::NOTICE, $message, $context);
116
+	}
117 117
 
118
-    /**
119
-     * Interesting events.
120
-     *
121
-     * Example: User logs in, SQL logs.
122
-     *
123
-     * @param string $message
124
-     * @param array  $context
125
-     *
126
-     * @return void
127
-     */
128
-    public function info($message, array $context = array())
129
-    {
130
-        $this->log(LogLevel::INFO, $message, $context);
131
-    }
118
+	/**
119
+	 * Interesting events.
120
+	 *
121
+	 * Example: User logs in, SQL logs.
122
+	 *
123
+	 * @param string $message
124
+	 * @param array  $context
125
+	 *
126
+	 * @return void
127
+	 */
128
+	public function info($message, array $context = array())
129
+	{
130
+		$this->log(LogLevel::INFO, $message, $context);
131
+	}
132 132
 
133
-    /**
134
-     * Detailed debug information.
135
-     *
136
-     * @param string $message
137
-     * @param array  $context
138
-     *
139
-     * @return void
140
-     */
141
-    public function debug($message, array $context = array())
142
-    {
143
-        $this->log(LogLevel::DEBUG, $message, $context);
144
-    }
133
+	/**
134
+	 * Detailed debug information.
135
+	 *
136
+	 * @param string $message
137
+	 * @param array  $context
138
+	 *
139
+	 * @return void
140
+	 */
141
+	public function debug($message, array $context = array())
142
+	{
143
+		$this->log(LogLevel::DEBUG, $message, $context);
144
+	}
145 145
 
146 146
 	/**
147 147
 	 * Bake the context into { } placeholders in the message.
148
-     * @param string $message
149
-     * @param array  $context
150
-     *
151
-     * @return string The baked message;
148
+	 * @param string $message
149
+	 * @param array  $context
150
+	 *
151
+	 * @return string The baked message;
152 152
 	 */
153 153
 	protected function interpolate( $message, $context ) {
154 154
 		foreach ( $context as $key => $val ) {
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return void
38 38
      */
39
-    public function emergency($message, array $context = array())
39
+    public function emergency( $message, array $context = array() )
40 40
     {
41
-        $this->log(LogLevel::EMERGENCY, $message, $context);
41
+        $this->log( LogLevel::EMERGENCY, $message, $context );
42 42
     }
43 43
 
44 44
     /**
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return void
54 54
      */
55
-    public function alert($message, array $context = array())
55
+    public function alert( $message, array $context = array() )
56 56
     {
57
-        $this->log(LogLevel::ALERT, $message, $context);
57
+        $this->log( LogLevel::ALERT, $message, $context );
58 58
     }
59 59
 
60 60
     /**
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @return void
69 69
      */
70
-    public function critical($message, array $context = array())
70
+    public function critical( $message, array $context = array() )
71 71
     {
72
-        $this->log(LogLevel::CRITICAL, $message, $context);
72
+        $this->log( LogLevel::CRITICAL, $message, $context );
73 73
     }
74 74
 
75 75
     /**
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return void
83 83
      */
84
-    public function error($message, array $context = array())
84
+    public function error( $message, array $context = array() )
85 85
     {
86
-        $this->log(LogLevel::ERROR, $message, $context);
86
+        $this->log( LogLevel::ERROR, $message, $context );
87 87
     }
88 88
 
89 89
     /**
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
      *
98 98
      * @return void
99 99
      */
100
-    public function warning($message, array $context = array())
100
+    public function warning( $message, array $context = array() )
101 101
     {
102
-        $this->log(LogLevel::WARNING, $message, $context);
102
+        $this->log( LogLevel::WARNING, $message, $context );
103 103
     }
104 104
 
105 105
     /**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      *
111 111
      * @return void
112 112
      */
113
-    public function notice($message, array $context = array())
113
+    public function notice( $message, array $context = array() )
114 114
     {
115
-        $this->log(LogLevel::NOTICE, $message, $context);
115
+        $this->log( LogLevel::NOTICE, $message, $context );
116 116
     }
117 117
 
118 118
     /**
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
      *
126 126
      * @return void
127 127
      */
128
-    public function info($message, array $context = array())
128
+    public function info( $message, array $context = array() )
129 129
     {
130
-        $this->log(LogLevel::INFO, $message, $context);
130
+        $this->log( LogLevel::INFO, $message, $context );
131 131
     }
132 132
 
133 133
     /**
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
      *
139 139
      * @return void
140 140
      */
141
-    public function debug($message, array $context = array())
141
+    public function debug( $message, array $context = array() )
142 142
     {
143
-        $this->log(LogLevel::DEBUG, $message, $context);
143
+        $this->log( LogLevel::DEBUG, $message, $context );
144 144
     }
145 145
 
146 146
 	/**
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return void
38 38
      */
39
-    public function emergency($message, array $context = array())
40
-    {
39
+    public function emergency($message, array $context = array()) {
41 40
         $this->log(LogLevel::EMERGENCY, $message, $context);
42 41
     }
43 42
 
@@ -52,8 +51,7 @@  discard block
 block discarded – undo
52 51
      *
53 52
      * @return void
54 53
      */
55
-    public function alert($message, array $context = array())
56
-    {
54
+    public function alert($message, array $context = array()) {
57 55
         $this->log(LogLevel::ALERT, $message, $context);
58 56
     }
59 57
 
@@ -67,8 +65,7 @@  discard block
 block discarded – undo
67 65
      *
68 66
      * @return void
69 67
      */
70
-    public function critical($message, array $context = array())
71
-    {
68
+    public function critical($message, array $context = array()) {
72 69
         $this->log(LogLevel::CRITICAL, $message, $context);
73 70
     }
74 71
 
@@ -81,8 +78,7 @@  discard block
 block discarded – undo
81 78
      *
82 79
      * @return void
83 80
      */
84
-    public function error($message, array $context = array())
85
-    {
81
+    public function error($message, array $context = array()) {
86 82
         $this->log(LogLevel::ERROR, $message, $context);
87 83
     }
88 84
 
@@ -97,8 +93,7 @@  discard block
 block discarded – undo
97 93
      *
98 94
      * @return void
99 95
      */
100
-    public function warning($message, array $context = array())
101
-    {
96
+    public function warning($message, array $context = array()) {
102 97
         $this->log(LogLevel::WARNING, $message, $context);
103 98
     }
104 99
 
@@ -110,8 +105,7 @@  discard block
 block discarded – undo
110 105
      *
111 106
      * @return void
112 107
      */
113
-    public function notice($message, array $context = array())
114
-    {
108
+    public function notice($message, array $context = array()) {
115 109
         $this->log(LogLevel::NOTICE, $message, $context);
116 110
     }
117 111
 
@@ -125,8 +119,7 @@  discard block
 block discarded – undo
125 119
      *
126 120
      * @return void
127 121
      */
128
-    public function info($message, array $context = array())
129
-    {
122
+    public function info($message, array $context = array()) {
130 123
         $this->log(LogLevel::INFO, $message, $context);
131 124
     }
132 125
 
@@ -138,8 +131,7 @@  discard block
 block discarded – undo
138 131
      *
139 132
      * @return void
140 133
      */
141
-    public function debug($message, array $context = array())
142
-    {
134
+    public function debug($message, array $context = array()) {
143 135
         $this->log(LogLevel::DEBUG, $message, $context);
144 136
     }
145 137
 
Please login to merge, or discard this patch.
future/includes/class-gv-collection-entry-filter-gravityforms.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@
 block discarded – undo
55 55
 						$search_criteria[ $key ] = $field_filters;
56 56
 					}
57 57
 
58
-					if ( ! empty( $b[ $key ]['mode'] ) ) {
59
-						$search_criteria[ $key ]['mode' ] = $b[ $key ]['mode'];
60
-					} else if ( ! empty( $a[ $key ]['mode'] ) ) {
61
-						$search_criteria[ $key ]['mode' ] = $a[ $key ]['mode'];
58
+					if ( ! empty( $b[ $key ][ 'mode' ] ) ) {
59
+						$search_criteria[ $key ][ 'mode' ] = $b[ $key ][ 'mode' ];
60
+					} else if ( ! empty( $a[ $key ][ 'mode' ] ) ) {
61
+						$search_criteria[ $key ][ 'mode' ] = $a[ $key ][ 'mode' ];
62 62
 					}
63 63
 					break;
64 64
 				case 'start_date':
Please login to merge, or discard this patch.
future/includes/class-gv-settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return void
27 27
 	 */
28 28
 	public function set( $key, $value ) {
29
-		$this->settings[$key] = $value;
29
+		$this->settings[ $key ] = $value;
30 30
 	}
31 31
 
32 32
 	/**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @return mixed|null
41 41
 	 */
42 42
 	public function get( $key, $default = null ) {
43
-		return isset( $this->settings[$key] ) ? $this->settings[$key] : $default;
43
+		return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : $default;
44 44
 	}
45 45
 
46 46
 	/**
Please login to merge, or discard this patch.