Completed
Pull Request — master (#827)
by Zack
07:57 queued 04:27
created
future/includes/class-gv-core.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,9 @@  discard block
 block discarded – undo
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 core GravityView API.
@@ -45,8 +46,9 @@  discard block
 block discarded – undo
45 46
 	 * @return \GV\Core The global instance of GravityView Core.
46 47
 	 */
47 48
 	public static function get() {
48
-		if ( ! self::$__instance instanceof self )
49
-			self::$__instance = new self;
49
+		if ( ! self::$__instance instanceof self ) {
50
+					self::$__instance = new self;
51
+		}
50 52
 		return self::$__instance;
51 53
 	}
52 54
 
Please login to merge, or discard this patch.
future/includes/class-gv-plugin.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	 * @return string The version of PHP.
201 201
 	 */
202 202
 	private function get_php_version() {
203
-		return !empty( $GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] ) ?
204
-			$GLOBALS['GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE'] : phpversion();
203
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] ) ?
204
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_PHP_VERSION_OVERRIDE' ] : phpversion();
205 205
 	}
206 206
 
207 207
 	/**
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 	 * @return string The version of WordPress.
213 213
 	 */
214 214
 	private function get_wordpress_version() {
215
-		return !empty( $GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] ) ?
216
-			$GLOBALS['GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE'] : $GLOBALS['wp_version'];
215
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] ) ?
216
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_WP_VERSION_OVERRIDE' ] : $GLOBALS[ 'wp_version' ];
217 217
 	}
218 218
 
219 219
 	/**
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	 * @return string The version of Gravity Forms.
226 226
 	 */
227 227
 	private function get_gravityforms_version() {
228
-		if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) )
228
+		if ( ! class_exists( '\GFCommon' ) || ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE' ] ) )
229 229
 			throw new \ErrorException( __( 'Gravity Forms is inactive or not installed at all.', 'gravityview' ) );
230 230
 
231
-		return !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
232
-			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
231
+		return ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] ) ?
232
+			$GLOBALS[ 'GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE' ] : \GFCommon::$version;
233 233
 	}
234 234
 
235 235
 	private function __clone() { }
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,8 +2,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -225,8 +227,9 @@  discard block
 block discarded – undo
225 227
 	 * @return string The version of Gravity Forms.
226 228
 	 */
227 229
 	private function get_gravityforms_version() {
228
-		if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) )
229
-			throw new \ErrorException( __( 'Gravity Forms is inactive or not installed.', 'gravityview' ) );
230
+		if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) {
231
+					throw new \ErrorException( __( 'Gravity Forms is inactive or not installed.', 'gravityview' ) );
232
+		}
230 233
 
231 234
 		return !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ?
232 235
 			$GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version;
Please login to merge, or discard this patch.
future/gravityview.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 	die();
5 5
 
6 6
 /** The future branch of GravityView requires PHP 5.3+ namespaces and SPL. */
7
-if ( version_compare( phpversion(), '5.3' , '<' ) )
7
+if ( version_compare( phpversion(), '5.3', '<' ) )
8 8
 	return false;
9 9
 
10 10
 /** Require */
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,13 @@
 block discarded – undo
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 */
11 13
 require GRAVITYVIEW_DIR . 'future/includes/class-gv-core.php';
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-address.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 
59 59
 			if ( 'address' === rgar( $search_field, 'type' ) ) {
60 60
 
61
-				$field_id = intval( floor( $search_field['key'] ) );
62
-				$input_id = gravityview_get_input_id_from_id( $search_field['key'] );
61
+				$field_id = intval( floor( $search_field[ 'key' ] ) );
62
+				$input_id = gravityview_get_input_id_from_id( $search_field[ 'key' ] );
63 63
 				$form = GravityView_View::getInstance()->getForm();
64 64
 
65 65
 				/** @var GF_Field_Address $address_field */
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				$choices = array();
69 69
 
70 70
 				$method_name = 'get_choices_' . self::get_input_type_from_input_id( $input_id );
71
-				if( method_exists( $this, $method_name ) ) {
71
+				if ( method_exists( $this, $method_name ) ) {
72 72
 					/**
73 73
 					 * @uses GravityView_Field_Address::get_choices_country()
74 74
 					 * @uses GravityView_Field_Address::get_choices_state()
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 					$choices = $this->{$method_name}( $address_field );
77 77
 				}
78 78
 
79
-				if( ! empty( $choices ) ) {
80
-					$search_field['choices'] = $choices;
81
-					$search_field['type'] = rgar( $search_field, 'input');
79
+				if ( ! empty( $choices ) ) {
80
+					$search_field[ 'choices' ] = $choices;
81
+					$search_field[ 'type' ] = rgar( $search_field, 'input' );
82 82
 				} else {
83
-					$search_field['type'] = 'text';
84
-					$search_field['input'] = 'input_text';
83
+					$search_field[ 'type' ] = 'text';
84
+					$search_field[ 'input' ] = 'input_text';
85 85
 				}
86 86
 			}
87 87
 		}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$country_choices = array();
108 108
 
109 109
 		foreach ( $countries as $key => $country ) {
110
-			$country_choices[] = array(
110
+			$country_choices[ ] = array(
111 111
 				'value' => $country,
112 112
 				'text' => $country,
113 113
 			);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	private function get_choices_state( $address_field ) {
133 133
 
134
-		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form['id'] ) : $address_field->addressType;
134
+		$address_type = empty( $address_field->addressType ) ? $address_field->get_default_address_type( $form[ 'id' ] ) : $address_field->addressType;
135 135
 
136 136
 		$state_choices = array();
137 137
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 				$states = GFCommon::get_canadian_provinces();
144 144
 				break;
145 145
 			default:
146
-				$states = empty( $address_types[ $address_type ]['states'] ) ? array() : $address_types[ $address_type ]['states'];
146
+				$states = empty( $address_types[ $address_type ][ 'states' ] ) ? array() : $address_types[ $address_type ][ 'states' ];
147 147
 				break;
148 148
 		}
149 149
 
150 150
 		foreach ( $states as $key => $state ) {
151
-			$state_choices[] = array(
151
+			$state_choices[ ] = array(
152 152
 				'value' => $state,
153 153
 				'text' => $state,
154 154
 			);
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 		// Use the same inputs as the "text" input type allows
172 172
 		$text_inputs = rgar( $input_types, 'text' );
173 173
 
174
-		$input_types['street'] = $text_inputs;
175
-		$input_types['street2'] = $text_inputs;
176
-		$input_types['city'] = $text_inputs;
174
+		$input_types[ 'street' ] = $text_inputs;
175
+		$input_types[ 'street2' ] = $text_inputs;
176
+		$input_types[ 'city' ] = $text_inputs;
177 177
 
178
-		$input_types['state'] = array( 'select', 'radio', 'link' ) + $text_inputs;
179
-		$input_types['zip'] = array( 'input_text' );
180
-		$input_types['country'] = array( 'select', 'radio', 'link' ) + $text_inputs;
178
+		$input_types[ 'state' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
179
+		$input_types[ 'zip' ] = array( 'input_text' );
180
+		$input_types[ 'country' ] = array( 'select', 'radio', 'link' ) + $text_inputs;
181 181
 
182 182
 		return $input_types;
183 183
 	}
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 		// Is this search field for an input (eg: 4.2) or the whole address field (eg: 4)?
199 199
 		$input_id = gravityview_get_input_id_from_id( $field_id );
200 200
 
201
-		if( 'address' === $field_type && $input_id ) {
201
+		if ( 'address' === $field_type && $input_id ) {
202 202
 
203 203
 			// If the input ID matches an expected address input, set to that. Otherwise, keep existing input type.
204
-			if( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
204
+			if ( $address_field_name = self::get_input_type_from_input_id( $input_id ) ) {
205 205
 				$input_type = $address_field_name;
206 206
 			}
207 207
 		}
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
 	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
251 251
 
252 252
 		// If this is NOT the full address field, return default options.
253
-		if( floor( $field_id ) !== floatval( $field_id ) ) {
253
+		if ( floor( $field_id ) !== floatval( $field_id ) ) {
254 254
 			return $field_options;
255 255
 		}
256 256
 
257
-		if( 'edit' === $context ) {
257
+		if ( 'edit' === $context ) {
258 258
 			return $field_options;
259 259
 		}
260 260
 
261 261
 		$add_options = array();
262 262
 
263
-		$add_options['show_map_link'] = array(
263
+		$add_options[ 'show_map_link' ] = array(
264 264
 			'type' => 'checkbox',
265 265
 			'label' => __( 'Show Map Link:', 'gravityview' ),
266
-			'desc' => __('Display a "Map It" link below the address', 'gravityview'),
266
+			'desc' => __( 'Display a "Map It" link below the address', 'gravityview' ),
267 267
 			'value' => true,
268 268
 			'merge_tags' => false,
269 269
 		);
Please login to merge, or discard this patch.