@@ -2,8 +2,9 @@ |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * The Request abstract class. |
@@ -2,8 +2,9 @@ |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * The base \GV\Shortcode class. |
@@ -2,8 +2,9 @@ |
||
2 | 2 | namespace GV\Shortcodes; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * The base \GV\Shortcode class. |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | $this->context_view_id = $_GET['gvid']; |
246 | 246 | |
247 | - } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
247 | + } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
248 | 248 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
249 | 249 | $this->context_view_id = array_pop( $array_keys ); |
250 | 250 | unset( $array_keys ); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | } |
453 | 453 | |
454 | 454 | // User reported WooCommerce doesn't pass two args. |
455 | - if ( empty( $passed_post_id ) ) { |
|
455 | + if ( empty( $passed_post_id ) ) { |
|
456 | 456 | return $title; |
457 | 457 | } |
458 | 458 | |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | */ |
1308 | 1308 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
1309 | 1309 | |
1310 | - switch( strtolower( $address_part ) ){ |
|
1310 | + switch( strtolower( $address_part ) ) { |
|
1311 | 1311 | case 'street': |
1312 | 1312 | $sort_field_id .= '.1'; |
1313 | 1313 | break; |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | */ |
1393 | 1393 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
1394 | 1394 | |
1395 | - if ( empty( $single_entry ) ){ |
|
1395 | + if ( empty( $single_entry ) ) { |
|
1396 | 1396 | return false; |
1397 | 1397 | } else { |
1398 | 1398 | return $single_entry; |
@@ -312,8 +312,9 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public static function is_admin() { |
314 | 314 | |
315 | - if ( function_exists( 'gravityview' ) ) |
|
316 | - return gravityview()->request->is_admin(); |
|
315 | + if ( function_exists( 'gravityview' ) ) { |
|
316 | + return gravityview()->request->is_admin(); |
|
317 | + } |
|
317 | 318 | |
318 | 319 | $doing_ajax = defined( 'DOING_AJAX' ) ? DOING_AJAX : false; |
319 | 320 | |
@@ -382,7 +383,7 @@ discard block |
||
382 | 383 | * @param mixed $data Additional data to display |
383 | 384 | * @return void |
384 | 385 | */ |
385 | - public static function log_debug( $message, $data = null ){ |
|
386 | + public static function log_debug( $message, $data = null ) { |
|
386 | 387 | /** |
387 | 388 | * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
388 | 389 | * @param string $message Message to display |
@@ -396,7 +397,7 @@ discard block |
||
396 | 397 | * @param string $message log message |
397 | 398 | * @return void |
398 | 399 | */ |
399 | - public static function log_error( $message, $data = null ){ |
|
400 | + public static function log_error( $message, $data = null ) { |
|
400 | 401 | /** |
401 | 402 | * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
402 | 403 | * @param string $message Error message to display |
@@ -2,8 +2,9 @@ discard block |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * A collection of \GV\View objects. |
@@ -39,8 +40,9 @@ discard block |
||
39 | 40 | */ |
40 | 41 | public function get( $view_id ) { |
41 | 42 | foreach ( $this->all() as $view ) { |
42 | - if ( $view->ID == $view_id ) |
|
43 | - return $view; |
|
43 | + if ( $view->ID == $view_id ) { |
|
44 | + return $view; |
|
45 | + } |
|
44 | 46 | } |
45 | 47 | return null; |
46 | 48 | } |
@@ -2,8 +2,9 @@ discard block |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * The GravityView WordPress plugin class. |
@@ -68,8 +69,9 @@ discard block |
||
68 | 69 | * @return \GV\Plugin The global instance of GravityView Plugin. |
69 | 70 | */ |
70 | 71 | public static function get() { |
71 | - if ( ! self::$__instance instanceof self ) |
|
72 | - self::$__instance = new self; |
|
72 | + if ( ! self::$__instance instanceof self ) { |
|
73 | + self::$__instance = new self; |
|
74 | + } |
|
73 | 75 | return self::$__instance; |
74 | 76 | } |
75 | 77 | |
@@ -92,8 +94,9 @@ discard block |
||
92 | 94 | * Stop all further functionality from loading if the WordPress |
93 | 95 | * plugin is incompatible with the current environment. |
94 | 96 | */ |
95 | - if ( ! $this->is_compatible() ) |
|
96 | - return; |
|
97 | + if ( ! $this->is_compatible() ) { |
|
98 | + return; |
|
99 | + } |
|
97 | 100 | |
98 | 101 | /** Register hooks that are fired when the plugin is activated and deactivated. */ |
99 | 102 | register_activation_hook( $this->dir( 'gravityview.php' ), array( $this, 'activate' ) ); |
@@ -236,8 +239,9 @@ discard block |
||
236 | 239 | * @return string The version of Gravity Forms. |
237 | 240 | */ |
238 | 241 | private function get_gravityforms_version() { |
239 | - if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) |
|
240 | - throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
242 | + if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) { |
|
243 | + throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
244 | + } |
|
241 | 245 | |
242 | 246 | return !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ? |
243 | 247 | $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version; |
@@ -2,8 +2,9 @@ |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * A generic Collection base class. |
@@ -2,8 +2,9 @@ |
||
2 | 2 | namespace GV; |
3 | 3 | |
4 | 4 | /** If this file is called directly, abort. */ |
5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
6 | 6 | die(); |
7 | +} |
|
7 | 8 | |
8 | 9 | /** |
9 | 10 | * The default Request class. |