@@ -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 | |
@@ -228,8 +230,9 @@ discard block |
||
| 228 | 230 | * @return string The version of Gravity Forms. |
| 229 | 231 | */ |
| 230 | 232 | private function get_gravityforms_version() { |
| 231 | - if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) |
|
| 232 | - throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
| 233 | + if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) { |
|
| 234 | + throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
| 235 | + } |
|
| 233 | 236 | |
| 234 | 237 | return !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ? |
| 235 | 238 | $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version; |
@@ -1,11 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** If this file is called directly, abort. */ |
| 3 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 3 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 4 | 4 | die(); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** The future branch of GravityView requires PHP 5.3+ namespaces and SPL. */ |
| 7 | -if ( version_compare( phpversion(), '5.3' , '<' ) ) |
|
| 8 | +if ( version_compare( phpversion(), '5.3' , '<' ) ) { |
|
| 8 | 9 | return false; |
| 10 | +} |
|
| 9 | 11 | |
| 10 | 12 | /** Require core */ |
| 11 | 13 | require GRAVITYVIEW_DIR . 'future/includes/class-gv-core.php'; |