Completed
Branch BUG-9647-cpt-queries (303307)
by
unknown
201:19 queued 184:10
created
core/db_classes/EE_Line_Item.class.php 2 patches
Doc Comments   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	/**
108 108
 	 * Sets TXN_ID
109 109
 	 * @param int $TXN_ID
110
-	 * @return boolean
110
+	 * @return boolean|null
111 111
 	 */
112 112
 	function set_TXN_ID( $TXN_ID ) {
113 113
 		$this->set( 'TXN_ID', $TXN_ID );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	/**
133 133
 	 * Sets name
134 134
 	 * @param string $name
135
-	 * @return boolean
135
+	 * @return boolean|null
136 136
 	 */
137 137
 	function set_name( $name ) {
138 138
 		$this->set( 'LIN_name', $name );
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	/**
154 154
 	 * Sets desc
155 155
 	 * @param string $desc
156
-	 * @return boolean
156
+	 * @return boolean|null
157 157
 	 */
158 158
 	function set_desc( $desc ) {
159 159
 		$this->set( 'LIN_desc', $desc );
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	/**
175 175
 	 * Sets quantity
176 176
 	 * @param int $quantity
177
-	 * @return boolean
177
+	 * @return boolean|null
178 178
 	 */
179 179
 	function set_quantity( $quantity ) {
180 180
 		$this->set( 'LIN_quantity', $quantity );
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	/**
196 196
 	 * Sets item_id
197 197
 	 * @param string $item_id
198
-	 * @return boolean
198
+	 * @return boolean|null
199 199
 	 */
200 200
 	function set_OBJ_ID( $item_id ) {
201 201
 		$this->set( 'OBJ_ID', $item_id );
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	/**
217 217
 	 * Sets item_type
218 218
 	 * @param string $OBJ_type
219
-	 * @return boolean
219
+	 * @return boolean|null
220 220
 	 */
221 221
 	function set_OBJ_type( $OBJ_type ) {
222 222
 		$this->set( 'OBJ_type', $OBJ_type );
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	/**
238 238
 	 * Sets unit_price
239 239
 	 * @param float $unit_price
240
-	 * @return boolean
240
+	 * @return boolean|null
241 241
 	 */
242 242
 	function set_unit_price( $unit_price ) {
243 243
 		$this->set( 'LIN_unit_price', $unit_price );
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	/**
286 286
 	 * Sets percent (between 100-0.01)
287 287
 	 * @param float $percent
288
-	 * @return boolean
288
+	 * @return boolean|null
289 289
 	 */
290 290
 	function set_percent( $percent ) {
291 291
 		$this->set( 'LIN_percent', $percent );
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	/**
307 307
 	 * Sets total
308 308
 	 * @param float $total
309
-	 * @return boolean
309
+	 * @return boolean|null
310 310
 	 */
311 311
 	function set_total( $total ) {
312 312
 		$this->set( 'LIN_total', $total );
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	/**
348 348
 	 * Sets parent
349 349
 	 * @param int $parent
350
-	 * @return boolean
350
+	 * @return boolean|null
351 351
 	 */
352 352
 	function set_parent_ID( $parent ) {
353 353
 		$this->set( 'LIN_parent', $parent );
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 	/**
369 369
 	 * Sets type
370 370
 	 * @param string $type
371
-	 * @return boolean
371
+	 * @return boolean|null
372 372
 	 */
373 373
 	function set_type( $type ) {
374 374
 		$this->set( 'LIN_type', $type );
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	/**
427 427
 	 * Sets code
428 428
 	 * @param string $code
429
-	 * @return boolean
429
+	 * @return boolean|null
430 430
 	 */
431 431
 	function set_code( $code ) {
432 432
 		$this->set( 'LIN_code', $code );
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	/**
448 448
 	 * Sets is_taxable
449 449
 	 * @param boolean $is_taxable
450
-	 * @return boolean
450
+	 * @return boolean|null
451 451
 	 */
452 452
 	function set_is_taxable( $is_taxable ) {
453 453
 		$this->set( 'LIN_is_taxable', $is_taxable );
Please login to merge, or discard this patch.
Spacing   +211 added lines, -211 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 	 *                             		    date_format and the second value is the time format
51 51
 	 * @return EE_Line_Item
52 52
 	 */
53
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
54
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
55
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
53
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
54
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
55
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
56 56
 	}
57 57
 
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 *                          		the website will be used.
64 64
 	 * @return EE_Line_Item
65 65
 	 */
66
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
67
-		return new self( $props_n_values, TRUE, $timezone );
66
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
67
+		return new self($props_n_values, TRUE, $timezone);
68 68
 	}
69 69
 
70 70
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 * @param bool   $bydb
76 76
 	 * @param string $timezone
77 77
 	 */
78
-	protected function __construct( $fieldValues = array(), $bydb = FALSE, $timezone = '' ) {
79
-		parent::__construct( $fieldValues, $bydb, $timezone );
80
-		if ( ! $this->get( 'LIN_code' ) ) {
81
-			$this->set_code( $this->generate_code() );
78
+	protected function __construct($fieldValues = array(), $bydb = FALSE, $timezone = '') {
79
+		parent::__construct($fieldValues, $bydb, $timezone);
80
+		if ( ! $this->get('LIN_code')) {
81
+			$this->set_code($this->generate_code());
82 82
 		}
83 83
 	}
84 84
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @return int
90 90
 	 */
91 91
 	function ID() {
92
-		return $this->get( 'LIN_ID' );
92
+		return $this->get('LIN_ID');
93 93
 	}
94 94
 
95 95
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return int
100 100
 	 */
101 101
 	function TXN_ID() {
102
-		return $this->get( 'TXN_ID' );
102
+		return $this->get('TXN_ID');
103 103
 	}
104 104
 
105 105
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @param int $TXN_ID
110 110
 	 * @return boolean
111 111
 	 */
112
-	function set_TXN_ID( $TXN_ID ) {
113
-		$this->set( 'TXN_ID', $TXN_ID );
112
+	function set_TXN_ID($TXN_ID) {
113
+		$this->set('TXN_ID', $TXN_ID);
114 114
 	}
115 115
 
116 116
 
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 	 * @return string
121 121
 	 */
122 122
 	function name() {
123
-		$name =  $this->get( 'LIN_name' );
124
-		if( ! $name ){
125
-			$name = ucwords( str_replace( '-', ' ', $this->type() ) );
123
+		$name = $this->get('LIN_name');
124
+		if ( ! $name) {
125
+			$name = ucwords(str_replace('-', ' ', $this->type()));
126 126
 		}
127 127
 		return $name;
128 128
 	}
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	 * @param string $name
135 135
 	 * @return boolean
136 136
 	 */
137
-	function set_name( $name ) {
138
-		$this->set( 'LIN_name', $name );
137
+	function set_name($name) {
138
+		$this->set('LIN_name', $name);
139 139
 	}
140 140
 
141 141
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * @return string
146 146
 	 */
147 147
 	function desc() {
148
-		return $this->get( 'LIN_desc' );
148
+		return $this->get('LIN_desc');
149 149
 	}
150 150
 
151 151
 
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 	 * @param string $desc
156 156
 	 * @return boolean
157 157
 	 */
158
-	function set_desc( $desc ) {
159
-		$this->set( 'LIN_desc', $desc );
158
+	function set_desc($desc) {
159
+		$this->set('LIN_desc', $desc);
160 160
 	}
161 161
 
162 162
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @return int
167 167
 	 */
168 168
 	function quantity() {
169
-		return $this->get( 'LIN_quantity' );
169
+		return $this->get('LIN_quantity');
170 170
 	}
171 171
 
172 172
 
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 	 * @param int $quantity
177 177
 	 * @return boolean
178 178
 	 */
179
-	function set_quantity( $quantity ) {
180
-		$this->set( 'LIN_quantity', $quantity );
179
+	function set_quantity($quantity) {
180
+		$this->set('LIN_quantity', $quantity);
181 181
 	}
182 182
 
183 183
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @return string
188 188
 	 */
189 189
 	function OBJ_ID() {
190
-		return $this->get( 'OBJ_ID' );
190
+		return $this->get('OBJ_ID');
191 191
 	}
192 192
 
193 193
 
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 	 * @param string $item_id
198 198
 	 * @return boolean
199 199
 	 */
200
-	function set_OBJ_ID( $item_id ) {
201
-		$this->set( 'OBJ_ID', $item_id );
200
+	function set_OBJ_ID($item_id) {
201
+		$this->set('OBJ_ID', $item_id);
202 202
 	}
203 203
 
204 204
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 * @return string
209 209
 	 */
210 210
 	function OBJ_type() {
211
-		return $this->get( 'OBJ_type' );
211
+		return $this->get('OBJ_type');
212 212
 	}
213 213
 
214 214
 
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
 	 * @param string $OBJ_type
219 219
 	 * @return boolean
220 220
 	 */
221
-	function set_OBJ_type( $OBJ_type ) {
222
-		$this->set( 'OBJ_type', $OBJ_type );
221
+	function set_OBJ_type($OBJ_type) {
222
+		$this->set('OBJ_type', $OBJ_type);
223 223
 	}
224 224
 
225 225
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 * @return float
230 230
 	 */
231 231
 	function unit_price() {
232
-		return $this->get( 'LIN_unit_price' );
232
+		return $this->get('LIN_unit_price');
233 233
 	}
234 234
 
235 235
 
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 	 * @param float $unit_price
240 240
 	 * @return boolean
241 241
 	 */
242
-	function set_unit_price( $unit_price ) {
243
-		$this->set( 'LIN_unit_price', $unit_price );
242
+	function set_unit_price($unit_price) {
243
+		$this->set('LIN_unit_price', $unit_price);
244 244
 	}
245 245
 
246 246
 
@@ -251,19 +251,19 @@  discard block
 block discarded – undo
251 251
 	 * @return boolean
252 252
 	 */
253 253
 	function is_percent() {
254
-		if( $this->is_tax_sub_total() ) {
254
+		if ($this->is_tax_sub_total()) {
255 255
 			//tax subtotals HAVE a percent on them, that percentage only applies
256 256
 			//to taxable items, so its' an exception. Treat it like a flat line item
257 257
 			return false;
258 258
 		}
259
-		$unit_price = abs( $this->get( 'LIN_unit_price' ) );
260
-		$percent = abs( $this->get( 'LIN_percent' ) );
261
-		if ( $unit_price < .001 && $percent ) {
259
+		$unit_price = abs($this->get('LIN_unit_price'));
260
+		$percent = abs($this->get('LIN_percent'));
261
+		if ($unit_price < .001 && $percent) {
262 262
 			return TRUE;
263
-		} elseif ( $unit_price >= .001 && !$percent ) {
263
+		} elseif ($unit_price >= .001 && ! $percent) {
264 264
 			return FALSE;
265
-		} elseif ( $unit_price >= .001 && $percent ) {
266
-			throw new EE_Error( sprintf( __( "A Line Item can not have a unit price of (%s) AND a percent (%s)!", "event_espresso" ), $unit_price, $percent ) );
265
+		} elseif ($unit_price >= .001 && $percent) {
266
+			throw new EE_Error(sprintf(__("A Line Item can not have a unit price of (%s) AND a percent (%s)!", "event_espresso"), $unit_price, $percent));
267 267
 		} else {
268 268
 			// if they're both 0, assume its not a percent item
269 269
 			return FALSE;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 * @return float
278 278
 	 */
279 279
 	function percent() {
280
-		return $this->get( 'LIN_percent' );
280
+		return $this->get('LIN_percent');
281 281
 	}
282 282
 
283 283
 
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
 	 * @param float $percent
288 288
 	 * @return boolean
289 289
 	 */
290
-	function set_percent( $percent ) {
291
-		$this->set( 'LIN_percent', $percent );
290
+	function set_percent($percent) {
291
+		$this->set('LIN_percent', $percent);
292 292
 	}
293 293
 
294 294
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	 * @return float
299 299
 	 */
300 300
 	function total() {
301
-		return $this->get( 'LIN_total' );
301
+		return $this->get('LIN_total');
302 302
 	}
303 303
 
304 304
 
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 	 * @param float $total
309 309
 	 * @return boolean
310 310
 	 */
311
-	function set_total( $total ) {
312
-		$this->set( 'LIN_total', $total );
311
+	function set_total($total) {
312
+		$this->set('LIN_total', $total);
313 313
 	}
314 314
 
315 315
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @return int
320 320
 	 */
321 321
 	function order() {
322
-		return $this->get( 'LIN_order' );
322
+		return $this->get('LIN_order');
323 323
 	}
324 324
 
325 325
 
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * Sets order
329 329
 	 * @param int $order
330 330
 	 */
331
-	function set_order( $order ) {
332
-		$this->set( 'LIN_order', $order );
331
+	function set_order($order) {
332
+		$this->set('LIN_order', $order);
333 333
 	}
334 334
 
335 335
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 * @return int
340 340
 	 */
341 341
 	function parent_ID() {
342
-		return $this->get( 'LIN_parent' );
342
+		return $this->get('LIN_parent');
343 343
 	}
344 344
 
345 345
 
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
 	 * @param int $parent
350 350
 	 * @return boolean
351 351
 	 */
352
-	function set_parent_ID( $parent ) {
353
-		$this->set( 'LIN_parent', $parent );
352
+	function set_parent_ID($parent) {
353
+		$this->set('LIN_parent', $parent);
354 354
 	}
355 355
 
356 356
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @return string
361 361
 	 */
362 362
 	function type() {
363
-		return $this->get( 'LIN_type' );
363
+		return $this->get('LIN_type');
364 364
 	}
365 365
 
366 366
 
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
 	 * @param string $type
371 371
 	 * @return boolean
372 372
 	 */
373
-	function set_type( $type ) {
374
-		$this->set( 'LIN_type', $type );
373
+	function set_type($type) {
374
+		$this->set('LIN_type', $type);
375 375
 	}
376 376
 
377 377
 
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 	 * @return EE_Line_Item
385 385
 	 */
386 386
 	public function parent() {
387
-		if( $this->ID() ) {
388
-			return $this->get_model()->get_one_by_ID( $this->parent_ID() );
387
+		if ($this->ID()) {
388
+			return $this->get_model()->get_one_by_ID($this->parent_ID());
389 389
 		} else {
390 390
 			return $this->_parent;
391 391
 		}
@@ -398,13 +398,13 @@  discard block
 block discarded – undo
398 398
 	 * @return EE_Line_Item[]
399 399
 	 */
400 400
 	public function children() {
401
-		if ( $this->ID() ) {
401
+		if ($this->ID()) {
402 402
 			return $this->get_model()->get_all(
403 403
 					array(
404
-						array( 'LIN_parent' => $this->ID() ),
405
-						'order_by' => array( 'LIN_order' => 'ASC' ) ) );
404
+						array('LIN_parent' => $this->ID()),
405
+						'order_by' => array('LIN_order' => 'ASC') ) );
406 406
 		} else {
407
-			if ( ! is_array( $this->_children ) ) {
407
+			if ( ! is_array($this->_children)) {
408 408
 				$this->_children = array();
409 409
 			}
410 410
 			return $this->_children;
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 * @return string
419 419
 	 */
420 420
 	function code() {
421
-		return $this->get( 'LIN_code' );
421
+		return $this->get('LIN_code');
422 422
 	}
423 423
 
424 424
 
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
 	 * @param string $code
429 429
 	 * @return boolean
430 430
 	 */
431
-	function set_code( $code ) {
432
-		$this->set( 'LIN_code', $code );
431
+	function set_code($code) {
432
+		$this->set('LIN_code', $code);
433 433
 	}
434 434
 
435 435
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	 * @return boolean
440 440
 	 */
441 441
 	function is_taxable() {
442
-		return $this->get( 'LIN_is_taxable' );
442
+		return $this->get('LIN_is_taxable');
443 443
 	}
444 444
 
445 445
 
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
 	 * @param boolean $is_taxable
450 450
 	 * @return boolean
451 451
 	 */
452
-	function set_is_taxable( $is_taxable ) {
453
-		$this->set( 'LIN_is_taxable', $is_taxable );
452
+	function set_is_taxable($is_taxable) {
453
+		$this->set('LIN_is_taxable', $is_taxable);
454 454
 	}
455 455
 
456 456
 
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 	 */
466 466
 	function get_object() {
467 467
 		$model_name_of_related_obj = $this->OBJ_type();
468
-		return $this->get_model()->has_relation(  $model_name_of_related_obj ) ? $this->get_first_related( $model_name_of_related_obj ) : NULL;
468
+		return $this->get_model()->has_relation($model_name_of_related_obj) ? $this->get_first_related($model_name_of_related_obj) : NULL;
469 469
 	}
470 470
 
471 471
 
@@ -476,11 +476,11 @@  discard block
 block discarded – undo
476 476
 	 * @param array $query_params
477 477
 	 * @return EE_Ticket
478 478
 	 */
479
-	function ticket( $query_params = array() ) {
479
+	function ticket($query_params = array()) {
480 480
 		//we're going to assume that when this method is called we always want to receive the attached ticket EVEN if that ticket is archived.  This can be overridden via the incoming $query_params argument
481
-		$remove_defaults = array( 'default_where_conditions' => 'none' );
482
-		$query_params = array_merge( $remove_defaults, $query_params );
483
-		return $this->get_first_related( 'Ticket', $query_params );
481
+		$remove_defaults = array('default_where_conditions' => 'none');
482
+		$query_params = array_merge($remove_defaults, $query_params);
483
+		return $this->get_first_related('Ticket', $query_params);
484 484
 	}
485 485
 
486 486
 
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 	 * @return EE_Datetime | NULL
491 491
 	 */
492 492
 	function get_ticket_datetime() {
493
-		if ( $this->OBJ_type() === 'Ticket' ) {
493
+		if ($this->OBJ_type() === 'Ticket') {
494 494
 			$ticket = $this->ticket();
495
-			if ( $ticket instanceof EE_Ticket ) {
495
+			if ($ticket instanceof EE_Ticket) {
496 496
 				$datetime = $ticket->first_datetime();
497
-				if ( $datetime instanceof EE_Datetime ) {
497
+				if ($datetime instanceof EE_Datetime) {
498 498
 					return $datetime;
499 499
 				}
500 500
 			}
@@ -510,9 +510,9 @@  discard block
 block discarded – undo
510 510
 	 * @return string
511 511
 	 */
512 512
 	function ticket_event_name() {
513
-		$event_name = __( "Unknown", "event_espresso" );
513
+		$event_name = __("Unknown", "event_espresso");
514 514
 		$event = $this->ticket_event();
515
-		if ( $event instanceof EE_Event ) {
515
+		if ($event instanceof EE_Event) {
516 516
 			$event_name = $event->name();
517 517
 		}
518 518
 		return $event_name;
@@ -526,9 +526,9 @@  discard block
 block discarded – undo
526 526
 	function ticket_event() {
527 527
 		$event = null;
528 528
 		$ticket = $this->ticket();
529
-		if ( $ticket instanceof EE_Ticket ) {
529
+		if ($ticket instanceof EE_Ticket) {
530 530
 			$datetime = $ticket->first_datetime();
531
-			if ( $datetime instanceof EE_Datetime ) {
531
+			if ($datetime instanceof EE_Datetime) {
532 532
 				$event = $datetime->event();
533 533
 			}
534 534
 		}
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
 	 * @param string $time_format
544 544
 	 * @return string
545 545
 	 */
546
-	function ticket_datetime_start( $date_format = '', $time_format = '' ) {
547
-		$first_datetime_string = __( "Unknown", "event_espresso" );
546
+	function ticket_datetime_start($date_format = '', $time_format = '') {
547
+		$first_datetime_string = __("Unknown", "event_espresso");
548 548
 		$datetime = $this->get_ticket_datetime();
549
-		if ( $datetime ) {
550
-			$first_datetime_string = $datetime->start_date_and_time( $date_format, $time_format );
549
+		if ($datetime) {
550
+			$first_datetime_string = $datetime->start_date_and_time($date_format, $time_format);
551 551
 		}
552 552
 		return $first_datetime_string;
553 553
 	}
@@ -562,26 +562,26 @@  discard block
 block discarded – undo
562 562
 	 * @return bool success
563 563
 	 * @throws \EE_Error
564 564
 	 */
565
-	function add_child_line_item( EEI_Line_Item $line_item, $set_order = true ) {
565
+	function add_child_line_item(EEI_Line_Item $line_item, $set_order = true) {
566 566
 		// should we calculate the LIN_order for this line item ?
567
-		if ( $set_order || $line_item->order() === null ) {
568
-			$line_item->set_order( count( $this->children() ) );
567
+		if ($set_order || $line_item->order() === null) {
568
+			$line_item->set_order(count($this->children()));
569 569
 		}
570
-		if ( $this->ID() ) {
570
+		if ($this->ID()) {
571 571
 			//check for any duplicate line items (with the same code), if so, this replaces it
572
-			$line_item_with_same_code = $this->get_child_line_item(  $line_item->code() );
573
-			if( $line_item_with_same_code instanceof EE_Line_Item && $line_item_with_same_code !== $line_item ) {
574
-				$this->delete_child_line_item( $line_item_with_same_code->code() );
572
+			$line_item_with_same_code = $this->get_child_line_item($line_item->code());
573
+			if ($line_item_with_same_code instanceof EE_Line_Item && $line_item_with_same_code !== $line_item) {
574
+				$this->delete_child_line_item($line_item_with_same_code->code());
575 575
 			}
576
-			$line_item->set_parent_ID( $this->ID() );
577
-			if( $this->TXN_ID() ){
578
-				$line_item->set_TXN_ID( $this->TXN_ID() );
576
+			$line_item->set_parent_ID($this->ID());
577
+			if ($this->TXN_ID()) {
578
+				$line_item->set_TXN_ID($this->TXN_ID());
579 579
 			}
580 580
 			return $line_item->save();
581 581
 		} else {
582
-			$this->_children[ $line_item->code() ] = $line_item;
583
-			if( $line_item->parent() != $this ) {
584
-				$line_item->set_parent( $this );
582
+			$this->_children[$line_item->code()] = $line_item;
583
+			if ($line_item->parent() != $this) {
584
+				$line_item->set_parent($this);
585 585
 			}
586 586
 			return TRUE;
587 587
 		}
@@ -595,16 +595,16 @@  discard block
 block discarded – undo
595 595
 	 * @param EE_Line_Item $line_item
596 596
 	 *
597 597
 	 */
598
-	public function set_parent( $line_item ) {
599
-		if ( $this->ID() ) {
600
-			if( ! $line_item->ID() ) {
598
+	public function set_parent($line_item) {
599
+		if ($this->ID()) {
600
+			if ( ! $line_item->ID()) {
601 601
 				$line_item->save();
602 602
 			}
603
-			$this->set_parent_ID( $line_item->ID() );
603
+			$this->set_parent_ID($line_item->ID());
604 604
 			$this->save();
605 605
 		} else {
606 606
 			$this->_parent = $line_item;
607
-			$this->set_parent_ID( $line_item->ID() );
607
+			$this->set_parent_ID($line_item->ID());
608 608
 		}
609 609
 	}
610 610
 
@@ -617,11 +617,11 @@  discard block
 block discarded – undo
617 617
 	 * @param string $code
618 618
 	 * @return EE_Line_Item
619 619
 	 */
620
-	function get_child_line_item( $code ) {
621
-		if ( $this->ID() ) {
622
-			return $this->get_model()->get_one( array( array( 'LIN_parent' => $this->ID(), 'LIN_code' => $code ) ) );
620
+	function get_child_line_item($code) {
621
+		if ($this->ID()) {
622
+			return $this->get_model()->get_one(array(array('LIN_parent' => $this->ID(), 'LIN_code' => $code)));
623 623
 		} else {
624
-			return isset( $this->_children[ $code ] ) ? $this->_children[ $code ] : null;
624
+			return isset($this->_children[$code]) ? $this->_children[$code] : null;
625 625
 		}
626 626
 	}
627 627
 
@@ -632,10 +632,10 @@  discard block
 block discarded – undo
632 632
 	 * @return int
633 633
 	 */
634 634
 	function delete_children_line_items() {
635
-		if ( $this->ID() ) {
636
-			return $this->get_model()->delete( array( array( 'LIN_parent' => $this->ID() ) ) );
635
+		if ($this->ID()) {
636
+			return $this->get_model()->delete(array(array('LIN_parent' => $this->ID())));
637 637
 		} else {
638
-			$count = count( $this->_children );
638
+			$count = count($this->_children);
639 639
 			$this->_children = array();
640 640
 			return $count;
641 641
 		}
@@ -652,25 +652,25 @@  discard block
 block discarded – undo
652 652
 	 * @param bool $stop_search_once_found
653 653
 	 * @return int count of items deleted (or simply removed from the line item's cache, if not has not been saved to the DB yet)
654 654
 	 */
655
-	function delete_child_line_item( $code, $stop_search_once_found = true ) {
656
-		if ( $this->ID() ) {
655
+	function delete_child_line_item($code, $stop_search_once_found = true) {
656
+		if ($this->ID()) {
657 657
 			$items_deleted = 0;
658
-			if( $this->code() == $code ) {
659
-				$items_deleted += EEH_Line_Item::delete_all_child_items( $this );
660
-				$items_deleted += intval( $this->delete() );
661
-				if( $stop_search_once_found ){
658
+			if ($this->code() == $code) {
659
+				$items_deleted += EEH_Line_Item::delete_all_child_items($this);
660
+				$items_deleted += intval($this->delete());
661
+				if ($stop_search_once_found) {
662 662
 					return $items_deleted;
663 663
 				}
664 664
 			}
665
-			foreach( $this->children() as $child_line_item ) {
666
-				$items_deleted += $child_line_item->delete_child_line_item( $code, $stop_search_once_found );
665
+			foreach ($this->children() as $child_line_item) {
666
+				$items_deleted += $child_line_item->delete_child_line_item($code, $stop_search_once_found);
667 667
 			}
668 668
 			return $items_deleted;
669 669
 		} else {
670
-			if( isset( $this->_children[ $code ] ) ) {
671
-				unset( $this->_children[ $code ] );
670
+			if (isset($this->_children[$code])) {
671
+				unset($this->_children[$code]);
672 672
 				return 1;
673
-			}else{
673
+			} else {
674 674
 				return 0;
675 675
 			}
676 676
 		}
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
 	 * @return boolean
684 684
 	 */
685 685
 	public function delete_if_childless_subtotal() {
686
-		if( $this->ID() &&
686
+		if ($this->ID() &&
687 687
 				$this->type() == EEM_Line_Item::type_sub_total &&
688
-				! $this->children() ) {
688
+				! $this->children()) {
689 689
 			return $this->delete();
690 690
 		} else {
691 691
 			return false;
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	 */
701 701
 	function generate_code() {
702 702
 		// each line item in the cart requires a unique identifier
703
-		return md5( $this->get( 'OBJ_type' ) . $this->get( 'OBJ_ID' ) . microtime() );
703
+		return md5($this->get('OBJ_type').$this->get('OBJ_ID').microtime());
704 704
 	}
705 705
 
706 706
 
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 	 * @return string like '2, 004.00', formatted according to the localized currency
765 765
 	 */
766 766
 	function unit_price_no_code() {
767
-		return $this->get_pretty( 'LIN_unit_price', 'no_currency_code' );
767
+		return $this->get_pretty('LIN_unit_price', 'no_currency_code');
768 768
 	}
769 769
 
770 770
 
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 	 * @return string like '2, 004.00', formatted according to the localized currency
775 775
 	 */
776 776
 	function total_no_code() {
777
-		return $this->get_pretty( 'LIN_total', 'no_currency_code' );
777
+		return $this->get_pretty('LIN_total', 'no_currency_code');
778 778
 	}
779 779
 
780 780
 
@@ -793,17 +793,17 @@  discard block
 block discarded – undo
793 793
 
794 794
 		$total = $pre_tax_total + $tax_total;
795 795
 		// no negative totals plz
796
-		$total = max( $total, 0 );
797
-		$this->set_total( $total );
796
+		$total = max($total, 0);
797
+		$this->set_total($total);
798 798
 		//only update the related transaction's total
799 799
 		//if we intend to save this line item and its a grand total
800
-		if(
800
+		if (
801 801
 			$this->allow_persist() &&
802 802
 			$this->type() == EEM_Line_Item::type_total &&
803 803
 			$this->transaction() instanceof EE_Transaction
804
-		){
805
-			$this->transaction()->set_total( $total );
806
-			if ( $this->transaction()->ID() ) {
804
+		) {
805
+			$this->transaction()->set_total($total);
806
+			if ($this->transaction()->ID()) {
807 807
 				$this->transaction()->save();
808 808
 			}
809 809
 		}
@@ -824,42 +824,42 @@  discard block
 block discarded – undo
824 824
 		$total = 0;
825 825
 		$my_children = $this->children();
826 826
 		//completely ignore tax and tax sub-totals when calculating the pre-tax-total
827
-		if ( $this->is_tax_sub_total() || $this->is_tax() ) {
827
+		if ($this->is_tax_sub_total() || $this->is_tax()) {
828 828
 			return 0;
829 829
 		} elseif (
830
-			( $this->is_sub_line_item() || $this->is_line_item() )
831
-			&& empty( $my_children )
830
+			($this->is_sub_line_item() || $this->is_line_item())
831
+			&& empty($my_children)
832 832
 		) {
833 833
 			$total = $this->unit_price() * $this->quantity();
834
-		} elseif( $this->is_sub_total() || $this->is_total() ) {
835
-			$total = $this->_recalculate_pretax_total_for_subtotal( $total, $my_children );
836
-		} elseif (  $this->is_line_item() && ! empty( $my_children ) ) {
837
-			$total = $this->_recalculate_pretax_total_for_line_item( $total, $my_children );
834
+		} elseif ($this->is_sub_total() || $this->is_total()) {
835
+			$total = $this->_recalculate_pretax_total_for_subtotal($total, $my_children);
836
+		} elseif ($this->is_line_item() && ! empty($my_children)) {
837
+			$total = $this->_recalculate_pretax_total_for_line_item($total, $my_children);
838 838
 		}
839 839
 		//ensure all non-line items and non-sub-line-items have a quantity of 1
840
-		if( ! $this->is_line_item() && ! $this->is_sub_line_item() ) {
841
-			$this->set_quantity( 1 );
842
-			if( ! $this->is_percent() ) {
843
-				$this->set_unit_price( $this->total() );
840
+		if ( ! $this->is_line_item() && ! $this->is_sub_line_item()) {
841
+			$this->set_quantity(1);
842
+			if ( ! $this->is_percent()) {
843
+				$this->set_unit_price($this->total());
844 844
 			}
845 845
 		}
846 846
 
847 847
 		//we don't want to bother saving grand totals, because that needs to factor in taxes anyways
848 848
 		//so it ought to be
849
-		if( ! $this->is_total() ) {
850
-			$this->set_total( $total );
849
+		if ( ! $this->is_total()) {
850
+			$this->set_total($total);
851 851
 			//if not a percent line item, make sure we keep the unit price in sync
852
-			if(
852
+			if (
853 853
 				$this->is_line_item() &&
854
-				! empty( $my_children ) &&
854
+				! empty($my_children) &&
855 855
 				! $this->is_percent()
856 856
 			) {
857
-				if( $this->quantity() === 0 ){
857
+				if ($this->quantity() === 0) {
858 858
 					$new_unit_price = 0;
859 859
 				} else {
860 860
 					$new_unit_price = $this->total() / $this->quantity();
861 861
 				}
862
-				$this->set_unit_price( $new_unit_price );
862
+				$this->set_unit_price($new_unit_price);
863 863
 			}
864 864
 			$this->maybe_save();
865 865
 		}
@@ -875,14 +875,14 @@  discard block
 block discarded – undo
875 875
 	 * @param EE_Line_Item[] $my_children
876 876
 	 * @return float
877 877
 	 */
878
-	protected function _recalculate_pretax_total_for_subtotal( $calculated_total_so_far, $my_children = null ) {
879
-		if( $my_children === null ) {
878
+	protected function _recalculate_pretax_total_for_subtotal($calculated_total_so_far, $my_children = null) {
879
+		if ($my_children === null) {
880 880
 			$my_children = $this->children();
881 881
 		}
882 882
 		//get the total of all its children
883
-		foreach ( $my_children as $child_line_item ) {
884
-			if ( $child_line_item instanceof EE_Line_Item ) {
885
-				if ( $child_line_item->is_percent() ) {
883
+		foreach ($my_children as $child_line_item) {
884
+			if ($child_line_item instanceof EE_Line_Item) {
885
+				if ($child_line_item->is_percent()) {
886 886
 					
887 887
 					//round as we go so that the line items add up ok
888 888
 					$percent_total = round(
@@ -890,25 +890,25 @@  discard block
 block discarded – undo
890 890
 						EE_Registry::instance()->CFG->currency->dec_plc
891 891
 					);
892 892
 					
893
-					$child_line_item->set_total( $percent_total );
893
+					$child_line_item->set_total($percent_total);
894 894
 					//so far all percent line items should have a quantity of 1
895 895
 					//(ie, no double percent discounts. Although that might be requested someday)
896
-					$child_line_item->set_quantity( 1 );
896
+					$child_line_item->set_quantity(1);
897 897
 					$child_line_item->maybe_save();
898 898
 					$calculated_total_so_far += $percent_total;
899 899
 				} else {
900 900
 					//verify flat sub-line-item quantities match their parent
901
-					if( $child_line_item->is_sub_line_item() ) {
902
-						$child_line_item->set_quantity( $this->quantity() );
901
+					if ($child_line_item->is_sub_line_item()) {
902
+						$child_line_item->set_quantity($this->quantity());
903 903
 					}
904 904
 					$calculated_total_so_far += $child_line_item->recalculate_pre_tax_total();
905 905
 				}
906 906
 			}
907 907
 		}
908 908
 
909
-		if( $this->is_sub_total() ){
909
+		if ($this->is_sub_total()) {
910 910
 			// no negative totals plz
911
-			$calculated_total_so_far = max( $calculated_total_so_far, 0 );
911
+			$calculated_total_so_far = max($calculated_total_so_far, 0);
912 912
 		}
913 913
 		return $calculated_total_so_far;
914 914
 	}
@@ -922,8 +922,8 @@  discard block
 block discarded – undo
922 922
 	 * @param EE_Line_Item[] $my_children
923 923
 	 * @return float
924 924
 	 */
925
-	protected function _recalculate_pretax_total_for_line_item( $calculated_total_so_far, $my_children = null ) {
926
-		if( $my_children === null ) {
925
+	protected function _recalculate_pretax_total_for_line_item($calculated_total_so_far, $my_children = null) {
926
+		if ($my_children === null) {
927 927
 			$my_children = $this->children();
928 928
 		}
929 929
 		//we need to keep track of the running total for a single item,
@@ -931,9 +931,9 @@  discard block
 block discarded – undo
931 931
 		$unit_price_for_total = 0;
932 932
 		$quantity_for_total = 1;
933 933
 		//get the total of all its children
934
-		foreach ( $my_children as $child_line_item ) {
935
-			if ( $child_line_item instanceof EE_Line_Item ) {
936
-				if ( $child_line_item->is_percent() ) {
934
+		foreach ($my_children as $child_line_item) {
935
+			if ($child_line_item instanceof EE_Line_Item) {
936
+				if ($child_line_item->is_percent()) {
937 937
 					//it should be the unit-price-so-far multiplied by teh percent multiplied by the quantity
938 938
 					//not total multiplied by percent, because that ignores rounding along-the-way
939 939
 					$percent_unit_price = round(
@@ -941,17 +941,17 @@  discard block
 block discarded – undo
941 941
 						EE_Registry::instance()->CFG->currency->dec_plc
942 942
 					);
943 943
 					$percent_total = $percent_unit_price * $quantity_for_total;
944
-					$child_line_item->set_total( $percent_total );
944
+					$child_line_item->set_total($percent_total);
945 945
 					//so far all percent line items should have a quantity of 1
946 946
 					//(ie, no double percent discounts. Although that might be requested someday)
947
-					$child_line_item->set_quantity( 1 );
947
+					$child_line_item->set_quantity(1);
948 948
 					$child_line_item->maybe_save();
949 949
 					$calculated_total_so_far += $percent_total;
950 950
 					$unit_price_for_total += $percent_unit_price;
951 951
 				} else {
952 952
 					//verify flat sub-line-item quantities match their parent
953
-					if( $child_line_item->is_sub_line_item() ) {
954
-						$child_line_item->set_quantity( $this->quantity() );
953
+					if ($child_line_item->is_sub_line_item()) {
954
+						$child_line_item->set_quantity($this->quantity());
955 955
 					}
956 956
 					$quantity_for_total = $child_line_item->quantity();
957 957
 					$calculated_total_so_far += $child_line_item->recalculate_pre_tax_total();
@@ -975,10 +975,10 @@  discard block
 block discarded – undo
975 975
 		//calculate the pretax total
976 976
 		$taxable_total = $this->taxable_total();
977 977
 		$tax_total = 0;
978
-		foreach ( $taxes as $tax ) {
978
+		foreach ($taxes as $tax) {
979 979
 			$total_on_this_tax = $taxable_total * $tax->percent() / 100;
980 980
 			//remember the total on this line item
981
-			$tax->set_total( $total_on_this_tax );
981
+			$tax->set_total($total_on_this_tax);
982 982
 			$tax_total += $tax->total();
983 983
 		}
984 984
 		$this->_recalculate_tax_sub_total();
@@ -992,21 +992,21 @@  discard block
 block discarded – undo
992 992
 	 * @return void
993 993
 	 */
994 994
 	private function _recalculate_tax_sub_total() {
995
-		if ( $this->is_tax_sub_total() ) {
995
+		if ($this->is_tax_sub_total()) {
996 996
 			$total = 0;
997 997
 			$total_percent = 0;
998 998
 			//simply loop through all its children (which should be taxes) and sum their total
999
-			foreach ( $this->children() as $child_tax ) {
1000
-				if ( $child_tax instanceof EE_Line_Item ) {
999
+			foreach ($this->children() as $child_tax) {
1000
+				if ($child_tax instanceof EE_Line_Item) {
1001 1001
 					$total += $child_tax->total();
1002 1002
 					$total_percent += $child_tax->percent();
1003 1003
 				}
1004 1004
 			}
1005
-			$this->set_total( $total );
1006
-			$this->set_percent( $total_percent );
1007
-		} elseif ( $this->is_total() ) {
1008
-			foreach ( $this->children() as $maybe_tax_subtotal ) {
1009
-				if ( $maybe_tax_subtotal instanceof EE_Line_Item ) {
1005
+			$this->set_total($total);
1006
+			$this->set_percent($total_percent);
1007
+		} elseif ($this->is_total()) {
1008
+			foreach ($this->children() as $maybe_tax_subtotal) {
1009
+				if ($maybe_tax_subtotal instanceof EE_Line_Item) {
1010 1010
 					$maybe_tax_subtotal->_recalculate_tax_sub_total();
1011 1011
 				}
1012 1012
 			}
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 	public function get_total_tax() {
1023 1023
 		$this->_recalculate_tax_sub_total();
1024 1024
 		$total = 0;
1025
-		foreach ( $this->tax_descendants() as $tax_line_item ) {
1026
-			if ( $tax_line_item instanceof EE_Line_Item ) {
1025
+		foreach ($this->tax_descendants() as $tax_line_item) {
1026
+			if ($tax_line_item instanceof EE_Line_Item) {
1027 1027
 				$total += $tax_line_item->total();
1028 1028
 			}
1029 1029
 		}
@@ -1037,15 +1037,15 @@  discard block
 block discarded – undo
1037 1037
 	 */
1038 1038
 	public function get_items_total() {
1039 1039
 		//by default, let's make sure we're consistent with the existing line item
1040
-		if( $this->is_total() ) {
1041
-			$pretax_subtotal_li = EEH_Line_Item::get_pre_tax_subtotal( $this );
1042
-			if( $pretax_subtotal_li instanceof EE_Line_Item ) {
1040
+		if ($this->is_total()) {
1041
+			$pretax_subtotal_li = EEH_Line_Item::get_pre_tax_subtotal($this);
1042
+			if ($pretax_subtotal_li instanceof EE_Line_Item) {
1043 1043
 				return $pretax_subtotal_li->total();
1044 1044
 			}
1045 1045
 		}
1046 1046
 		$total = 0;
1047
-		foreach ( $this->get_items() as $item ) {
1048
-			if ( $item instanceof EE_Line_Item ) {
1047
+		foreach ($this->get_items() as $item) {
1048
+			if ($item instanceof EE_Line_Item) {
1049 1049
 				$total += $item->total();
1050 1050
 			}
1051 1051
 		}
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 	 * @return EE_Line_Item[]
1061 1061
 	 */
1062 1062
 	function tax_descendants() {
1063
-		return EEH_Line_Item::get_tax_descendants( $this );
1063
+		return EEH_Line_Item::get_tax_descendants($this);
1064 1064
 	}
1065 1065
 
1066 1066
 
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 	 * @return EE_Line_Item[]
1071 1071
 	 */
1072 1072
 	function get_items() {
1073
-		return EEH_Line_Item::get_line_item_descendants( $this );
1073
+		return EEH_Line_Item::get_line_item_descendants($this);
1074 1074
 	}
1075 1075
 
1076 1076
 
@@ -1084,22 +1084,22 @@  discard block
 block discarded – undo
1084 1084
 	 */
1085 1085
 	function taxable_total() {
1086 1086
 		$total = 0;
1087
-		if ( $this->children() ) {
1088
-			foreach ( $this->children() as $child_line_item ) {
1089
-				if ( $child_line_item->type() == EEM_Line_Item::type_line_item && $child_line_item->is_taxable()) {
1087
+		if ($this->children()) {
1088
+			foreach ($this->children() as $child_line_item) {
1089
+				if ($child_line_item->type() == EEM_Line_Item::type_line_item && $child_line_item->is_taxable()) {
1090 1090
 					//if it's a percent item, only take into account the percent
1091 1091
 					//that's taxable too (the taxable total so far)
1092
-					if( $child_line_item->is_percent() ) {
1093
-						$total = $total + ( $total * $child_line_item->percent() / 100 );
1094
-					}else{
1092
+					if ($child_line_item->is_percent()) {
1093
+						$total = $total + ($total * $child_line_item->percent() / 100);
1094
+					} else {
1095 1095
 						$total += $child_line_item->total();
1096 1096
 					}
1097
-				}elseif( $child_line_item->type() == EEM_Line_Item::type_sub_total ){
1097
+				}elseif ($child_line_item->type() == EEM_Line_Item::type_sub_total) {
1098 1098
 					$total += $child_line_item->taxable_total();
1099 1099
 				}
1100 1100
 			}
1101 1101
 		}
1102
-		return max( $total, 0 );
1102
+		return max($total, 0);
1103 1103
 	}
1104 1104
 
1105 1105
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
 	 * @return EE_Transaction
1110 1110
 	 */
1111 1111
 	public function transaction() {
1112
-		return $this->get_first_related( 'Transaction' );
1112
+		return $this->get_first_related('Transaction');
1113 1113
 	}
1114 1114
 
1115 1115
 
@@ -1122,17 +1122,17 @@  discard block
 block discarded – undo
1122 1122
 	 * @param int $txn_id if none is provided, assumes $this->TXN_ID()
1123 1123
 	 * @return int count of items saved
1124 1124
 	 */
1125
-	public function save_this_and_descendants_to_txn( $txn_id = NULL ) {
1126
-		if ( ! $txn_id ) {
1125
+	public function save_this_and_descendants_to_txn($txn_id = NULL) {
1126
+		if ( ! $txn_id) {
1127 1127
 			$txn_id = $this->TXN_ID();
1128 1128
 		}
1129
-		$this->set_TXN_ID( $txn_id );
1129
+		$this->set_TXN_ID($txn_id);
1130 1130
 		$children = $this->children();
1131 1131
 		$this->save();
1132
-		foreach ( $children as $child_line_item ) {
1133
-			if ( $child_line_item instanceof EE_Line_Item ) {
1134
-				$child_line_item->set_parent_ID( $this->ID() );
1135
-				$child_line_item->save_this_and_descendants_to_txn( $txn_id );
1132
+		foreach ($children as $child_line_item) {
1133
+			if ($child_line_item instanceof EE_Line_Item) {
1134
+				$child_line_item->set_parent_ID($this->ID());
1135
+				$child_line_item->save_this_and_descendants_to_txn($txn_id);
1136 1136
 			}
1137 1137
 		}
1138 1138
 	}
@@ -1144,9 +1144,9 @@  discard block
 block discarded – undo
1144 1144
 	 * @param string $type one of the constants on EEM_Line_Item
1145 1145
 	 * @return EE_Line_Item[]
1146 1146
 	 */
1147
-	protected function _get_descendants_of_type( $type ) {
1148
-		EE_Error::doing_it_wrong( 'EE_Line_Item::_get_descendants_of_type()', __('Method replaced with EEH_Line_Item::get_descendants_of_type()', 'event_espresso'), '4.6.0' );
1149
-		return EEH_Line_Item::get_descendants_of_type( $this, $type );
1147
+	protected function _get_descendants_of_type($type) {
1148
+		EE_Error::doing_it_wrong('EE_Line_Item::_get_descendants_of_type()', __('Method replaced with EEH_Line_Item::get_descendants_of_type()', 'event_espresso'), '4.6.0');
1149
+		return EEH_Line_Item::get_descendants_of_type($this, $type);
1150 1150
 	}
1151 1151
 
1152 1152
 
@@ -1156,9 +1156,9 @@  discard block
 block discarded – undo
1156 1156
 	 * @param string $type like one of the EEM_Line_Item::type_*
1157 1157
 	 * @return EE_Line_Item
1158 1158
 	 */
1159
-	public function get_nearest_descendant_of_type( $type ) {
1160
-		EE_Error::doing_it_wrong( 'EE_Line_Item::get_nearest_descendant_of_type()', __('Method replaced with EEH_Line_Item::get_nearest_descendant_of_type()', 'event_espresso'), '4.6.0' );
1161
-		return EEH_Line_Item::get_nearest_descendant_of_type( $this, $type );
1159
+	public function get_nearest_descendant_of_type($type) {
1160
+		EE_Error::doing_it_wrong('EE_Line_Item::get_nearest_descendant_of_type()', __('Method replaced with EEH_Line_Item::get_nearest_descendant_of_type()', 'event_espresso'), '4.6.0');
1161
+		return EEH_Line_Item::get_nearest_descendant_of_type($this, $type);
1162 1162
 	}
1163 1163
 
1164 1164
 
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 	 * @return int count of items saved
1170 1170
 	 */
1171 1171
 	public function maybe_save() {
1172
-		if ( $this->ID() ) {
1172
+		if ($this->ID()) {
1173 1173
 			return $this->save();
1174 1174
 		}
1175 1175
 		return false;
Please login to merge, or discard this patch.
core/db_classes/EE_Message_Template_Group.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@
 block discarded – undo
224 224
 	 * appropriately.
225 225
 	 *
226 226
 	 * @throws EE_Error
227
-	 * @return EE_message_type|false if exception thrown.
227
+	 * @return null|EE_message_type if exception thrown.
228 228
 	 */
229 229
 	public function message_type_obj() {
230 230
 		$message_type = $this->message_type();
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * EE_Message_Template_Group class
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 * @param string $timezone
19 19
 	 * @return EE_Message_Template_Group|mixed
20 20
 	 */
21
-	public static function new_instance( $props_n_values = array(), $timezone = '' ) {
22
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone );
23
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
21
+	public static function new_instance($props_n_values = array(), $timezone = '') {
22
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
23
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone);
24 24
 	}
25 25
 
26 26
 
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	 * @param string $timezone
31 31
 	 * @return EE_Message_Template_Group
32 32
 	 */
33
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) {
34
-		return new self( $props_n_values, TRUE, $timezone );
33
+	public static function new_instance_from_db($props_n_values = array(), $timezone = '') {
34
+		return new self($props_n_values, TRUE, $timezone);
35 35
 	}
36 36
 
37 37
 
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 	 * @param bool $message_type
41 41
 	 * @throws EE_Error
42 42
 	 */
43
-	public function set_message_type( $message_type = FALSE ) {
44
-		if ( ! $message_type ) {
45
-			throw new EE_Error( __( 'Missing required value for the message_type parameter', 'event_espresso' ) );
43
+	public function set_message_type($message_type = FALSE) {
44
+		if ( ! $message_type) {
45
+			throw new EE_Error(__('Missing required value for the message_type parameter', 'event_espresso'));
46 46
 		}
47
-		$this->set( 'MTP_message_type', $message_type );
47
+		$this->set('MTP_message_type', $message_type);
48 48
 	}
49 49
 
50 50
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	 * @param bool $messenger
54 54
 	 * @throws EE_Error
55 55
 	 */
56
-	public function set_messenger( $messenger = FALSE ) {
57
-		if ( ! $messenger ) {
58
-			throw new EE_Error( __( 'Missing required value for the messenger parameter', 'event_espresso' ) );
56
+	public function set_messenger($messenger = FALSE) {
57
+		if ( ! $messenger) {
58
+			throw new EE_Error(__('Missing required value for the messenger parameter', 'event_espresso'));
59 59
 		}
60
-		$this->set( 'MTP_messenger', $messenger );
60
+		$this->set('MTP_messenger', $messenger);
61 61
 	}
62 62
 
63 63
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	 * @param bool $GRP_ID
67 67
 	 * @throws EE_Error
68 68
 	 */
69
-	public function set_group_template_id( $GRP_ID = FALSE ) {
70
-		if ( ! $GRP_ID ) {
71
-			throw new EE_Error( __( 'Missing required value for the message template group id', 'event_espresso' ) );
69
+	public function set_group_template_id($GRP_ID = FALSE) {
70
+		if ( ! $GRP_ID) {
71
+			throw new EE_Error(__('Missing required value for the message template group id', 'event_espresso'));
72 72
 		}
73
-		$this->set( 'GRP_ID', $GRP_ID );
73
+		$this->set('GRP_ID', $GRP_ID);
74 74
 	}
75 75
 
76 76
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return int
82 82
 	 */
83 83
 	public function GRP_ID() {
84
-		return $this->get( 'GRP_ID' );
84
+		return $this->get('GRP_ID');
85 85
 	}
86 86
 
87 87
 
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 	 * @return int
93 93
 	 */
94 94
 	public function user() {
95
-		$user_id = $this->get( 'MTP_user_id' );
96
-		return empty( $user_id ) ? get_current_user_id() : $user_id;
95
+		$user_id = $this->get('MTP_user_id');
96
+		return empty($user_id) ? get_current_user_id() : $user_id;
97 97
 	}
98 98
 
99 99
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @return int
117 117
 	 */
118 118
 	public function count_events() {
119
-		return $this->count_related( 'Event' );
119
+		return $this->count_related('Event');
120 120
 	}
121 121
 
122 122
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @return string
127 127
 	 */
128 128
 	public function name() {
129
-		return $this->get( 'MTP_name' );
129
+		return $this->get('MTP_name');
130 130
 	}
131 131
 
132 132
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return string
137 137
 	 */
138 138
 	public function description() {
139
-		return $this->get( 'MTP_description' );
139
+		return $this->get('MTP_description');
140 140
 	}
141 141
 
142 142
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 	 * @param  array $query_params like EEM_Base::get_all()
147 147
 	 * @return EE_Message_Template[]
148 148
 	 */
149
-	public function message_templates( $query_params = array() ) {
150
-		return $this->get_many_related( 'Message_Template', $query_params );
149
+	public function message_templates($query_params = array()) {
150
+		return $this->get_many_related('Message_Template', $query_params);
151 151
 	}
152 152
 
153 153
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @return string
159 159
 	 */
160 160
 	public function messenger() {
161
-		return $this->get( 'MTP_messenger' );
161
+		return $this->get('MTP_messenger');
162 162
 	}
163 163
 
164 164
 
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 	public function messenger_obj() {
176 176
 		$messenger = $this->messenger();
177 177
 		try {
178
-			$messenger = EEH_MSG_Template::messenger_obj( $messenger );
179
-		} catch( EE_Error $e ) {
178
+			$messenger = EEH_MSG_Template::messenger_obj($messenger);
179
+		} catch (EE_Error $e) {
180 180
 			//if an exception was thrown then let's deactivate this message template group because it means there is no class for this messenger in this group.
181
-			$this->set( 'MTP_is_active', false );
181
+			$this->set('MTP_is_active', false);
182 182
 			$this->save();
183 183
 			return null;
184 184
 		}
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 * @return string
195 195
 	 */
196 196
 	public function message_type() {
197
-		return $this->get( 'MTP_message_type' );
197
+		return $this->get('MTP_message_type');
198 198
 	}
199 199
 
200 200
 
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 	public function message_type_obj() {
213 213
 		$message_type = $this->message_type();
214 214
 		try {
215
-			$message_type = EEH_MSG_Template::message_type_obj( $message_type );
216
-		} catch(EE_Error $e) {
215
+			$message_type = EEH_MSG_Template::message_type_obj($message_type);
216
+		} catch (EE_Error $e) {
217 217
 			//if an exception was thrown then let's deactivate this message template group because it means there is no class for the message type in this group.
218
-			$this->set( 'MTP_is_active', false );
218
+			$this->set('MTP_is_active', false);
219 219
 			$this->save();
220 220
 			return null;
221 221
 		}
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 	 */
253 253
 	public function context_templates() {
254 254
 		$mtps_arr = array();
255
-		$mtps = $this->get_many_related( 'Message_Template' );
256
-		if ( empty( $mtps ) ) {
255
+		$mtps = $this->get_many_related('Message_Template');
256
+		if (empty($mtps)) {
257 257
 			return array();
258 258
 		}
259 259
 		//note contexts could have CHECKBOX fields per context. So we return the objects indexed by context AND field.
260
-		foreach ( $mtps as $mtp ) {
261
-			$mtps_arr[ $mtp->get( 'MTP_context' ) ][ $mtp->get( 'MTP_template_field' ) ] = $mtp;
260
+		foreach ($mtps as $mtp) {
261
+			$mtps_arr[$mtp->get('MTP_context')][$mtp->get('MTP_template_field')] = $mtp;
262 262
 		}
263 263
 		return $mtps_arr;
264 264
 	}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 * @return boolean true if it is, false if it isn't
271 271
 	 */
272 272
 	public function is_global() {
273
-		return $this->get( 'MTP_is_global' );
273
+		return $this->get('MTP_is_global');
274 274
 	}
275 275
 
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 * @return boolean true if it is, false if it isn't
281 281
 	 */
282 282
 	public function is_active() {
283
-		return $this->get( 'MTP_is_active' );
283
+		return $this->get('MTP_is_active');
284 284
 	}
285 285
 
286 286
 
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
 	 * @param bool   $merged  If TRUE then we don't return shortcodes indexed by field but instead an array of the unique shortcodes for all the given (or all) fields.
297 297
 	 * @return mixed (array|bool) an array of shortcodes in the format array( '[shortcode] => 'label') OR FALSE if no shortcodes found.
298 298
 	 */
299
-	public function get_shortcodes( $context, $fields = array(), $merged = FALSE ) {
299
+	public function get_shortcodes($context, $fields = array(), $merged = FALSE) {
300 300
 		$messenger = $this->messenger();
301 301
 		$message_type = $this->message_type();
302
-		return EEH_MSG_Template::get_shortcodes( $message_type, $messenger, $fields, $context, $merged );
302
+		return EEH_MSG_Template::get_shortcodes($message_type, $messenger, $fields, $context, $merged);
303 303
 	}
304 304
 
305 305
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	 * @return string
341 341
 	 */
342 342
 	public function get_template_pack_name() {
343
-		return $this->get_extra_meta( 'MTP_template_pack', TRUE, 'default' );
343
+		return $this->get_extra_meta('MTP_template_pack', TRUE, 'default');
344 344
 	}
345 345
 
346 346
 
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 	 */
356 356
 	public function get_template_pack() {
357 357
 		$pack_name = $this->get_template_pack_name();
358
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
359
-		return EEH_MSG_Template::get_template_pack( $pack_name );
358
+		EE_Registry::instance()->load_helper('MSG_Template');
359
+		return EEH_MSG_Template::get_template_pack($pack_name);
360 360
 	}
361 361
 
362 362
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	 * @return string
370 370
 	 */
371 371
 	public function get_template_pack_variation() {
372
-		return $this->get_extra_meta( 'MTP_variation', TRUE, 'default' );
372
+		return $this->get_extra_meta('MTP_variation', TRUE, 'default');
373 373
 	}
374 374
 
375 375
 
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	 * @param string $template_pack_name What message template pack is assigned.
382 382
 	 * @return int
383 383
 	 */
384
-	public function set_template_pack_name( $template_pack_name ) {
385
-		return $this->update_extra_meta( 'MTP_template_pack', $template_pack_name );
384
+	public function set_template_pack_name($template_pack_name) {
385
+		return $this->update_extra_meta('MTP_template_pack', $template_pack_name);
386 386
 	}
387 387
 
388 388
 
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
 	 * @param string $variation What variation is being set on the message template group.
395 395
 	 * @return int
396 396
 	 */
397
-	public function set_template_pack_variation( $variation ) {
398
-		return $this->update_extra_meta( 'MTP_variation', $variation );
397
+	public function set_template_pack_variation($variation) {
398
+		return $this->update_extra_meta('MTP_variation', $variation);
399 399
 	}
400 400
 }
401 401
 //end EE_Message_Template_Group class
Please login to merge, or discard this patch.
core/db_classes/EE_Payment.class.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	 * @param array  $props_n_values          incoming values
16 16
 	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
17 17
 	 *                                        used.)
18
-	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
18
+	 * @param string[]  $date_formats            incoming date_formats in an array where the first value is the
19 19
 	 *                                        date_format and the second value is the time format
20 20
 	 * @return EE_Payment
21 21
 	 * @throws \EE_Error
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 	 * Gets all the extra meta info on this payment
591 591
 	 *
592 592
 	 * @param array $query_params like EEM_Base::get_all
593
-	 * @return EE_Extra_Meta
593
+	 * @return EE_Base_Class[]
594 594
 	 * @throws \EE_Error
595 595
 	 */
596 596
 	public function extra_meta( $query_params = array() ) {
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -662,11 +662,11 @@  discard block
 block discarded – undo
662 662
 				$redirect_url = str_replace( '?' . $querystring, '', $redirect_url );
663 663
 			}
664 664
 			$form = EEH_HTML::nl( 1 )
665
-			        . '<form method="'
666
-			        . $method
667
-			        . '" name="gateway_form" action="'
668
-			        . $redirect_url
669
-			        . '">';
665
+					. '<form method="'
666
+					. $method
667
+					. '" name="gateway_form" action="'
668
+					. $redirect_url
669
+					. '">';
670 670
 			$form .= EEH_HTML::nl( 1 ) . $this->redirect_args_as_inputs();
671 671
 			$form .= $inside_form_html;
672 672
 			$form .= EEH_HTML::nl( -1 ) . '</form>' . EEH_HTML::nl( -1 );
@@ -704,11 +704,11 @@  discard block
 block discarded – undo
704 704
 			EE_Registry::instance()->load_helper( 'HTML' );
705 705
 			foreach ( $args as $name => $value ) {
706 706
 				$html .= EEH_HTML::nl( 0 )
707
-				         . '<input type="hidden" name="'
708
-				         . $name
709
-				         . '" value="'
710
-				         . esc_attr( $value )
711
-				         . '"/>';
707
+						 . '<input type="hidden" name="'
708
+						 . $name
709
+						 . '" value="'
710
+						 . esc_attr( $value )
711
+						 . '"/>';
712 712
 			}
713 713
 		}
714 714
 		return $html;
Please login to merge, or discard this patch.
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 /**
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 	 * @return EE_Payment
21 21
 	 * @throws \EE_Error
22 22
 	 */
23
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
24
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
25
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
23
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
24
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
25
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
26 26
 	}
27 27
 
28 28
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @return EE_Payment
35 35
 	 * @throws \EE_Error
36 36
 	 */
37
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
38
-		return new self( $props_n_values, true, $timezone );
37
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
38
+		return new self($props_n_values, true, $timezone);
39 39
 	}
40 40
 
41 41
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @param int $TXN_ID
48 48
 	 * @throws \EE_Error
49 49
 	 */
50
-	public function set_transaction_id( $TXN_ID = 0 ) {
51
-		$this->set( 'TXN_ID', $TXN_ID );
50
+	public function set_transaction_id($TXN_ID = 0) {
51
+		$this->set('TXN_ID', $TXN_ID);
52 52
 	}
53 53
 
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @throws \EE_Error
61 61
 	 */
62 62
 	public function transaction() {
63
-		return $this->get_first_related( 'Transaction' );
63
+		return $this->get_first_related('Transaction');
64 64
 	}
65 65
 
66 66
 
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @param string $STS_ID
73 73
 	 * @throws \EE_Error
74 74
 	 */
75
-	public function set_status( $STS_ID = '' ) {
76
-		$this->set( 'STS_ID', $STS_ID );
75
+	public function set_status($STS_ID = '') {
76
+		$this->set('STS_ID', $STS_ID);
77 77
 	}
78 78
 
79 79
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @param int $timestamp
86 86
 	 * @throws \EE_Error
87 87
 	 */
88
-	public function set_timestamp( $timestamp = 0 ) {
89
-		$this->set( 'PAY_timestamp', $timestamp );
88
+	public function set_timestamp($timestamp = 0) {
89
+		$this->set('PAY_timestamp', $timestamp);
90 90
 	}
91 91
 
92 92
 
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	 * @param string $PAY_source
99 99
 	 * @throws \EE_Error
100 100
 	 */
101
-	public function set_source( $PAY_source = '' ) {
102
-		$this->set( 'PAY_source', $PAY_source );
101
+	public function set_source($PAY_source = '') {
102
+		$this->set('PAY_source', $PAY_source);
103 103
 	}
104 104
 
105 105
 
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @param float $amount
112 112
 	 * @throws \EE_Error
113 113
 	 */
114
-	public function set_amount( $amount = 0.00 ) {
115
-		$this->set( 'PAY_amount', (float)$amount );
114
+	public function set_amount($amount = 0.00) {
115
+		$this->set('PAY_amount', (float) $amount);
116 116
 	}
117 117
 
118 118
 
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 	 * @param string $gateway_response
125 125
 	 * @throws \EE_Error
126 126
 	 */
127
-	public function set_gateway_response( $gateway_response = '' ) {
128
-		$this->set( 'PAY_gateway_response', $gateway_response );
127
+	public function set_gateway_response($gateway_response = '') {
128
+		$this->set('PAY_gateway_response', $gateway_response);
129 129
 	}
130 130
 
131 131
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			),
149 149
 			'4.6.0'
150 150
 		);
151
-		return $this->payment_method() ? $this->payment_method()->name() : __( 'Unknown', 'event_espresso' );
151
+		return $this->payment_method() ? $this->payment_method()->name() : __('Unknown', 'event_espresso');
152 152
 	}
153 153
 
154 154
 
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 	 * @param string $txn_id_chq_nmbr
161 161
 	 * @throws \EE_Error
162 162
 	 */
163
-	public function set_txn_id_chq_nmbr( $txn_id_chq_nmbr = '' ) {
164
-		$this->set( 'PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr );
163
+	public function set_txn_id_chq_nmbr($txn_id_chq_nmbr = '') {
164
+		$this->set('PAY_txn_id_chq_nmbr', $txn_id_chq_nmbr);
165 165
 	}
166 166
 
167 167
 
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	 * @param string $po_number
174 174
 	 * @throws \EE_Error
175 175
 	 */
176
-	public function set_po_number( $po_number = '' ) {
177
-		$this->set( 'PAY_po_number', $po_number );
176
+	public function set_po_number($po_number = '') {
177
+		$this->set('PAY_po_number', $po_number);
178 178
 	}
179 179
 
180 180
 
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 	 * @param string $extra_accntng
187 187
 	 * @throws \EE_Error
188 188
 	 */
189
-	public function set_extra_accntng( $extra_accntng = '' ) {
190
-		$this->set( 'PAY_extra_accntng', $extra_accntng );
189
+	public function set_extra_accntng($extra_accntng = '') {
190
+		$this->set('PAY_extra_accntng', $extra_accntng);
191 191
 	}
192 192
 
193 193
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 	 * @param bool $via_admin
200 200
 	 * @throws \EE_Error
201 201
 	 */
202
-	public function set_payment_made_via_admin( $via_admin = false ) {
203
-		if ( $via_admin ) {
204
-			$this->set( 'PAY_source', EEM_Payment_Method::scope_admin );
202
+	public function set_payment_made_via_admin($via_admin = false) {
203
+		if ($via_admin) {
204
+			$this->set('PAY_source', EEM_Payment_Method::scope_admin);
205 205
 		} else {
206
-			$this->set( 'PAY_source', EEM_Payment_Method::scope_cart );
206
+			$this->set('PAY_source', EEM_Payment_Method::scope_cart);
207 207
 		}
208 208
 	}
209 209
 
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
 	 * @param string|array $details
217 217
 	 * @throws \EE_Error
218 218
 	 */
219
-	public function set_details( $details = '' ) {
220
-		if ( is_array( $details ) ) {
221
-			array_walk_recursive( $details, array( $this, '_strip_all_tags_within_array' ) );
219
+	public function set_details($details = '') {
220
+		if (is_array($details)) {
221
+			array_walk_recursive($details, array($this, '_strip_all_tags_within_array'));
222 222
 		} else {
223
-			$details = wp_strip_all_tags( $details );
223
+			$details = wp_strip_all_tags($details);
224 224
 		}
225
-		$this->set( 'PAY_details', $details );
225
+		$this->set('PAY_details', $details);
226 226
 	}
227 227
 
228 228
 
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 	 * @param string $redirect_url
234 234
 	 * @throws \EE_Error
235 235
 	 */
236
-	public function set_redirect_url( $redirect_url ) {
237
-		$this->set( 'PAY_redirect_url', $redirect_url );
236
+	public function set_redirect_url($redirect_url) {
237
+		$this->set('PAY_redirect_url', $redirect_url);
238 238
 	}
239 239
 
240 240
 
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 	 * @param array $redirect_args
246 246
 	 * @throws \EE_Error
247 247
 	 */
248
-	public function set_redirect_args( $redirect_args ) {
249
-		$this->set( 'PAY_redirect_args', $redirect_args );
248
+	public function set_redirect_args($redirect_args) {
249
+		$this->set('PAY_redirect_args', $redirect_args);
250 250
 	}
251 251
 
252 252
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 * @throws \EE_Error
259 259
 	 */
260 260
 	public function TXN_ID() {
261
-		return $this->get( 'TXN_ID' );
261
+		return $this->get('TXN_ID');
262 262
 	}
263 263
 
264 264
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	 * @throws \EE_Error
271 271
 	 */
272 272
 	public function status() {
273
-		return $this->get( 'STS_ID' );
273
+		return $this->get('STS_ID');
274 274
 	}
275 275
 
276 276
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 * @throws \EE_Error
283 283
 	 */
284 284
 	public function STS_ID() {
285
-		return $this->get( 'STS_ID' );
285
+		return $this->get('STS_ID');
286 286
 	}
287 287
 
288 288
 
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
 	 * @return string
297 297
 	 * @throws \EE_Error
298 298
 	 */
299
-	public function timestamp( $dt_frmt = '', $tm_frmt = '' ) {
300
-		return $this->get_datetime( 'PAY_timestamp', $dt_frmt, $tm_frmt );
299
+	public function timestamp($dt_frmt = '', $tm_frmt = '') {
300
+		return $this->get_datetime('PAY_timestamp', $dt_frmt, $tm_frmt);
301 301
 	}
302 302
 
303 303
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @throws \EE_Error
310 310
 	 */
311 311
 	public function source() {
312
-		return $this->get( 'PAY_source' );
312
+		return $this->get('PAY_source');
313 313
 	}
314 314
 
315 315
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	 * @throws \EE_Error
323 323
 	 */
324 324
 	public function amount() {
325
-		return (float)$this->get( 'PAY_amount' );
325
+		return (float) $this->get('PAY_amount');
326 326
 	}
327 327
 
328 328
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 * @throws \EE_Error
333 333
 	 */
334 334
 	public function amount_no_code() {
335
-		return $this->get_pretty( 'PAY_amount', 'no_currency_code' );
335
+		return $this->get_pretty('PAY_amount', 'no_currency_code');
336 336
 	}
337 337
 
338 338
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 * @throws \EE_Error
345 345
 	 */
346 346
 	public function gateway_response() {
347
-		return $this->get( 'PAY_gateway_response' );
347
+		return $this->get('PAY_gateway_response');
348 348
 	}
349 349
 
350 350
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 	 * @throws \EE_Error
357 357
 	 */
358 358
 	public function txn_id_chq_nmbr() {
359
-		return $this->get( 'PAY_txn_id_chq_nmbr' );
359
+		return $this->get('PAY_txn_id_chq_nmbr');
360 360
 	}
361 361
 
362 362
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 	 * @throws \EE_Error
369 369
 	 */
370 370
 	public function po_number() {
371
-		return $this->get( 'PAY_po_number' );
371
+		return $this->get('PAY_po_number');
372 372
 	}
373 373
 
374 374
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 * @throws \EE_Error
381 381
 	 */
382 382
 	public function extra_accntng() {
383
-		return $this->get( 'PAY_extra_accntng' );
383
+		return $this->get('PAY_extra_accntng');
384 384
 	}
385 385
 
386 386
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 * @throws \EE_Error
393 393
 	 */
394 394
 	public function payment_made_via_admin() {
395
-		return ( $this->get( 'PAY_source' ) === EEM_Payment_Method::scope_admin );
395
+		return ($this->get('PAY_source') === EEM_Payment_Method::scope_admin);
396 396
 	}
397 397
 
398 398
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 * @throws \EE_Error
405 405
 	 */
406 406
 	public function details() {
407
-		return $this->get( 'PAY_details' );
407
+		return $this->get('PAY_details');
408 408
 	}
409 409
 
410 410
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 * @throws \EE_Error
417 417
 	 */
418 418
 	public function redirect_url() {
419
-		return $this->get( 'PAY_redirect_url' );
419
+		return $this->get('PAY_redirect_url');
420 420
 	}
421 421
 
422 422
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	 * @throws \EE_Error
429 429
 	 */
430 430
 	public function redirect_args() {
431
-		return $this->get( 'PAY_redirect_args' );
431
+		return $this->get('PAY_redirect_args');
432 432
 	}
433 433
 
434 434
 
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 	 * @return void
441 441
 	 * @throws \EE_Error
442 442
 	 */
443
-	public function e_pretty_status( $show_icons = false ) {
444
-		echo $this->pretty_status( $show_icons );
443
+	public function e_pretty_status($show_icons = false) {
444
+		echo $this->pretty_status($show_icons);
445 445
 	}
446 446
 
447 447
 
@@ -453,14 +453,14 @@  discard block
 block discarded – undo
453 453
 	 * @return string
454 454
 	 * @throws \EE_Error
455 455
 	 */
456
-	public function pretty_status( $show_icons = false ) {
456
+	public function pretty_status($show_icons = false) {
457 457
 		$status = EEM_Status::instance()->localized_status(
458
-			array( $this->STS_ID() => __( 'unknown', 'event_espresso' ) ),
458
+			array($this->STS_ID() => __('unknown', 'event_espresso')),
459 459
 			false,
460 460
 			'sentence'
461 461
 		);
462 462
 		$icon = '';
463
-		switch ( $this->STS_ID() ) {
463
+		switch ($this->STS_ID()) {
464 464
 			case EEM_Payment::status_id_approved:
465 465
 				$icon = $show_icons
466 466
 					? '<span class="dashicons dashicons-yes ee-icon-size-24 green-text"></span>'
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 					: '';
483 483
 				break;
484 484
 		}
485
-		return $icon . $status[ $this->STS_ID() ];
485
+		return $icon.$status[$this->STS_ID()];
486 486
 	}
487 487
 
488 488
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 	 * @throws \EE_Error
495 495
 	 */
496 496
 	public function is_approved() {
497
-		return $this->status_is( EEM_Payment::status_id_approved );
497
+		return $this->status_is(EEM_Payment::status_id_approved);
498 498
 	}
499 499
 
500 500
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 	 * @return boolean whether the status of this payment equals the status id
509 509
 	 * @throws \EE_Error
510 510
 	 */
511
-	protected function status_is( $STS_ID ) {
511
+	protected function status_is($STS_ID) {
512 512
 		return $STS_ID === $this->STS_ID() ? true : false;
513 513
 	}
514 514
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 	 * @throws \EE_Error
522 522
 	 */
523 523
 	public function is_pending() {
524
-		return $this->status_is( EEM_Payment::status_id_pending );
524
+		return $this->status_is(EEM_Payment::status_id_pending);
525 525
 	}
526 526
 
527 527
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 	 * @throws \EE_Error
534 534
 	 */
535 535
 	public function is_cancelled() {
536
-		return $this->status_is( EEM_Payment::status_id_cancelled );
536
+		return $this->status_is(EEM_Payment::status_id_cancelled);
537 537
 	}
538 538
 
539 539
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	 * @throws \EE_Error
546 546
 	 */
547 547
 	public function is_declined() {
548
-		return $this->status_is( EEM_Payment::status_id_declined );
548
+		return $this->status_is(EEM_Payment::status_id_declined);
549 549
 	}
550 550
 
551 551
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 	 * @throws \EE_Error
558 558
 	 */
559 559
 	public function is_failed() {
560
-		return $this->status_is( EEM_Payment::status_id_failed );
560
+		return $this->status_is(EEM_Payment::status_id_failed);
561 561
 	}
562 562
 
563 563
 
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 	 * @throws \EE_Error
582 582
 	 */
583 583
 	public function status_obj() {
584
-		return $this->get_first_related( 'Status' );
584
+		return $this->get_first_related('Status');
585 585
 	}
586 586
 
587 587
 
@@ -593,8 +593,8 @@  discard block
 block discarded – undo
593 593
 	 * @return EE_Extra_Meta
594 594
 	 * @throws \EE_Error
595 595
 	 */
596
-	public function extra_meta( $query_params = array() ) {
597
-		return $this->get_many_related( 'Extra_Meta', $query_params );
596
+	public function extra_meta($query_params = array()) {
597
+		return $this->get_many_related('Extra_Meta', $query_params);
598 598
 	}
599 599
 
600 600
 
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 * @throws \EE_Error
609 609
 	 */
610 610
 	public function payment_method() {
611
-		return $this->get_first_related( 'Payment_Method' );
611
+		return $this->get_first_related('Payment_Method');
612 612
 	}
613 613
 
614 614
 
@@ -626,18 +626,18 @@  discard block
 block discarded – undo
626 626
 	 * @return string html
627 627
 	 * @throws \EE_Error
628 628
 	 */
629
-	public function redirect_form( $inside_form_html = null ) {
629
+	public function redirect_form($inside_form_html = null) {
630 630
 		$redirect_url = $this->redirect_url();
631
-		if ( ! empty( $redirect_url ) ) {
631
+		if ( ! empty($redirect_url)) {
632 632
 			// what ? no inner form content?
633
-			if ( $inside_form_html === null ) {
633
+			if ($inside_form_html === null) {
634 634
 				$inside_form_html = EEH_HTML::p(
635 635
 					sprintf(
636 636
 						__(
637 637
 							'If you are not automatically redirected to the payment website within 10 seconds... %1$s %2$s Click Here %3$s',
638 638
 							'event_espresso'
639 639
 						),
640
-						EEH_HTML::br( 2 ),
640
+						EEH_HTML::br(2),
641 641
 						'<input type="submit" value="',
642 642
 						'">'
643 643
 					),
@@ -653,22 +653,22 @@  discard block
 block discarded – undo
653 653
 			);
654 654
 			//if it's a GET request, we need to remove all the GET params in the querystring
655 655
 			//and put them into the form instead
656
-			if ( $method === 'GET' ) {
657
-				$querystring = parse_url( $redirect_url, PHP_URL_QUERY );
656
+			if ($method === 'GET') {
657
+				$querystring = parse_url($redirect_url, PHP_URL_QUERY);
658 658
 				$get_params = null;
659
-				parse_str( $querystring, $get_params );
660
-				$inside_form_html .= $this->_args_as_inputs( $get_params );
661
-				$redirect_url = str_replace( '?' . $querystring, '', $redirect_url );
659
+				parse_str($querystring, $get_params);
660
+				$inside_form_html .= $this->_args_as_inputs($get_params);
661
+				$redirect_url = str_replace('?'.$querystring, '', $redirect_url);
662 662
 			}
663
-			$form = EEH_HTML::nl( 1 )
663
+			$form = EEH_HTML::nl(1)
664 664
 			        . '<form method="'
665 665
 			        . $method
666 666
 			        . '" name="gateway_form" action="'
667 667
 			        . $redirect_url
668 668
 			        . '">';
669
-			$form .= EEH_HTML::nl( 1 ) . $this->redirect_args_as_inputs();
669
+			$form .= EEH_HTML::nl(1).$this->redirect_args_as_inputs();
670 670
 			$form .= $inside_form_html;
671
-			$form .= EEH_HTML::nl( -1 ) . '</form>' . EEH_HTML::nl( -1 );
671
+			$form .= EEH_HTML::nl( -1 ).'</form>'.EEH_HTML::nl( -1 );
672 672
 			return $form;
673 673
 		} else {
674 674
 			return null;
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 	 * @throws \EE_Error
686 686
 	 */
687 687
 	public function redirect_args_as_inputs() {
688
-		return $this->_args_as_inputs( $this->redirect_args() );
688
+		return $this->_args_as_inputs($this->redirect_args());
689 689
 	}
690 690
 
691 691
 
@@ -697,15 +697,15 @@  discard block
 block discarded – undo
697 697
 	 * @param array $args key-value pairs
698 698
 	 * @return string
699 699
 	 */
700
-	protected function _args_as_inputs( $args ) {
700
+	protected function _args_as_inputs($args) {
701 701
 		$html = '';
702
-		if ( $args !== null && is_array( $args ) ) {
703
-			foreach ( $args as $name => $value ) {
704
-				$html .= EEH_HTML::nl( 0 )
702
+		if ($args !== null && is_array($args)) {
703
+			foreach ($args as $name => $value) {
704
+				$html .= EEH_HTML::nl(0)
705 705
 				         . '<input type="hidden" name="'
706 706
 				         . $name
707 707
 				         . '" value="'
708
-				         . esc_attr( $value )
708
+				         . esc_attr($value)
709 709
 				         . '"/>';
710 710
 			}
711 711
 		}
@@ -734,14 +734,14 @@  discard block
 block discarded – undo
734 734
 	 * @access private
735 735
 	 * @param mixed $item
736 736
 	 */
737
-	private function _strip_all_tags_within_array( &$item ) {
738
-		if ( is_object( $item ) ) {
739
-			$item = (array)$item;
737
+	private function _strip_all_tags_within_array(&$item) {
738
+		if (is_object($item)) {
739
+			$item = (array) $item;
740 740
 		}
741
-		if ( is_array( $item ) ) {
742
-			array_walk_recursive( $item, array( $this, '_strip_all_tags_within_array' ) );
741
+		if (is_array($item)) {
742
+			array_walk_recursive($item, array($this, '_strip_all_tags_within_array'));
743 743
 		} else {
744
-			$item = wp_strip_all_tags( $item );
744
+			$item = wp_strip_all_tags($item);
745 745
 		}
746 746
 	}
747 747
 
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 		$original_status = EEH_Array::is_set(
759 759
 			$this->_props_n_values_provided_in_constructor,
760 760
 			'STS_ID',
761
-			$this->get_model()->field_settings_for( 'STS_ID' )->get_default_value()
761
+			$this->get_model()->field_settings_for('STS_ID')->get_default_value()
762 762
 		);
763 763
 		$current_status = $this->status();
764 764
 		if (
@@ -784,11 +784,11 @@  discard block
 block discarded – undo
784 784
 	 * @return mixed
785 785
 	 * @throws \EE_Error
786 786
 	 */
787
-	public function get_pretty( $field_name, $extra_cache_ref = null ) {
788
-		if ( $field_name === 'PAY_gateway' ) {
789
-			return $this->payment_method() ? $this->payment_method()->name() : __( 'Unknown', 'event_espresso' );
787
+	public function get_pretty($field_name, $extra_cache_ref = null) {
788
+		if ($field_name === 'PAY_gateway') {
789
+			return $this->payment_method() ? $this->payment_method()->name() : __('Unknown', 'event_espresso');
790 790
 		}
791
-		return $this->_get_cached_property( $field_name, true, $extra_cache_ref );
791
+		return $this->_get_cached_property($field_name, true, $extra_cache_ref);
792 792
 	}
793 793
 
794 794
 
@@ -800,8 +800,8 @@  discard block
 block discarded – undo
800 800
 	 * @return EE_Registration_Payment[]
801 801
 	 * @throws \EE_Error
802 802
 	 */
803
-	public function registration_payments( $query_params = array() ) {
804
-		return $this->get_many_related( 'Registration_Payment', $query_params );
803
+	public function registration_payments($query_params = array()) {
804
+		return $this->get_many_related('Registration_Payment', $query_params);
805 805
 	}
806 806
 
807 807
 
Please login to merge, or discard this patch.
core/db_classes/EE_Registration.class.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 	 * (either the question's ID or a question object)
803 803
 	 * @param EE_Question|int $question
804 804
 	 * @param bool            $pretty_value
805
-	 * @return array|string if pretty_value= true, the result will always be a string
805
+	 * @return string if pretty_value= true, the result will always be a string
806 806
 	 * (because the answer might be an array of answer values, so passing pretty_value=true
807 807
 	 * will convert it into some kind of string)
808 808
 	 */
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 	/**
902 902
 	 * Sets deleted
903 903
 	 * @param boolean $deleted
904
-	 * @return boolean
904
+	 * @return boolean|null
905 905
 	 */
906 906
 	public function set_deleted($deleted) {
907 907
 		$this->set( 'REG_deleted', $deleted );
@@ -945,6 +945,7 @@  discard block
 block discarded – undo
945 945
 	 *
946 946
 	 * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against
947 947
 	 * @param bool   $check_approved   This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access.
948
+	 * @param integer $DTT_OR_ID
948 949
 	 *
949 950
 	 * @return bool
950 951
 	 */
@@ -1305,7 +1306,7 @@  discard block
 block discarded – undo
1305 1306
 	 * This grabs the payment method corresponding to the last payment made for the amount owing on the registration.
1306 1307
 	 * Note: if there are no payments on the registration there will be no payment method returned.
1307 1308
 	 *
1308
-	 * @return EE_Payment_Method|null
1309
+	 * @return EE_Base_Class|null
1309 1310
 	 */
1310 1311
 	public function payment_method() {
1311 1312
 		return EEM_Payment_Method::instance()->get_last_used_for_registration( $this );
Please login to merge, or discard this patch.
Spacing   +188 added lines, -188 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * EE_Registration class
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	 *                             		    date_format and the second value is the time format
42 42
 	 * @return EE_Registration
43 43
 	 */
44
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
45
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
46
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
44
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
45
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
46
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
47 47
 	}
48 48
 
49 49
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 *                          		the website will be used.
55 55
 	 * @return EE_Registration
56 56
 	 */
57
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
58
-		return new self( $props_n_values, TRUE, $timezone );
57
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
58
+		return new self($props_n_values, TRUE, $timezone);
59 59
 	}
60 60
 
61 61
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 * @access        public
67 67
 	 * @param        int $EVT_ID Event ID
68 68
 	 */
69
-	public function set_event( $EVT_ID = 0 ) {
70
-		$this->set( 'EVT_ID', $EVT_ID );
69
+	public function set_event($EVT_ID = 0) {
70
+		$this->set('EVT_ID', $EVT_ID);
71 71
 	}
72 72
 
73 73
 
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
 	 * @param mixed  $field_value
79 79
 	 * @param bool   $use_default
80 80
 	 */
81
-	public function set( $field_name, $field_value, $use_default = FALSE ) {
82
-		switch( $field_name ) {
81
+	public function set($field_name, $field_value, $use_default = FALSE) {
82
+		switch ($field_name) {
83 83
 			case 'REG_code' :
84
-				if ( ! empty( $field_value ) && $this->reg_code() == '' ) {
85
-					$this->set_reg_code( $field_value, $use_default );
84
+				if ( ! empty($field_value) && $this->reg_code() == '') {
85
+					$this->set_reg_code($field_value, $use_default);
86 86
 				}
87 87
 				break;
88 88
 			case 'STS_ID' :
89
-				$this->set_status( $field_value, $use_default );
89
+				$this->set_status($field_value, $use_default);
90 90
 				break;
91 91
 			default :
92
-				parent::set( $field_name, $field_value, $use_default );
92
+				parent::set($field_name, $field_value, $use_default);
93 93
 		}
94 94
 	}
95 95
 
@@ -106,30 +106,30 @@  discard block
 block discarded – undo
106 106
 	 * @param boolean $use_default
107 107
 	 * @return bool
108 108
 	 */
109
-	public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) {
109
+	public function set_status($new_STS_ID = NULL, $use_default = FALSE) {
110 110
 		// get current REG_Status
111 111
 		$old_STS_ID = $this->status_ID();
112 112
 		// if status has changed
113
-		if ( $old_STS_ID != $new_STS_ID  ) {
113
+		if ($old_STS_ID != $new_STS_ID) {
114 114
 			// TO approved
115
-			if ( $new_STS_ID == EEM_Registration::status_id_approved ) {
115
+			if ($new_STS_ID == EEM_Registration::status_id_approved) {
116 116
 				// reserve a space by incrementing ticket and datetime sold values
117 117
 				$this->_reserve_registration_space();
118
-				do_action( 'AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID );
118
+				do_action('AHEE__EE_Registration__set_status__to_approved', $this, $old_STS_ID, $new_STS_ID);
119 119
 			// OR FROM  approved
120
-			} else if ( $old_STS_ID == EEM_Registration::status_id_approved ) {
120
+			} else if ($old_STS_ID == EEM_Registration::status_id_approved) {
121 121
 				// release a space by decrementing ticket and datetime sold values
122 122
 				$this->_release_registration_space();
123
-				do_action( 'AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID );
123
+				do_action('AHEE__EE_Registration__set_status__from_approved', $this, $old_STS_ID, $new_STS_ID);
124 124
 			}
125 125
 			// update status
126
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
127
-			do_action( 'AHEE__EE_Registration__set_status__after_update', $this );
126
+			parent::set('STS_ID', $new_STS_ID, $use_default);
127
+			do_action('AHEE__EE_Registration__set_status__after_update', $this);
128 128
 			return TRUE;
129
-		}else{
129
+		} else {
130 130
 			//even though the old value matches the new value, it's still good to
131 131
 			//allow the parent set method to have a say
132
-			parent::set( 'STS_ID', $new_STS_ID, $use_default );
132
+			parent::set('STS_ID', $new_STS_ID, $use_default);
133 133
 			return TRUE;
134 134
 		}
135 135
 	}
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @access        public
142 142
 	 */
143 143
 	public function status_ID() {
144
-		return $this->get( 'STS_ID' );
144
+		return $this->get('STS_ID');
145 145
 	}
146 146
 
147 147
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 * @param boolean $include_archived whether to include archived tickets or not.
167 167
 	 * @return EE_Ticket
168 168
 	 */
169
-	public function ticket( $include_archived = TRUE ) {
169
+	public function ticket($include_archived = TRUE) {
170 170
 		$query_params = array();
171
-		if ( $include_archived ) {
172
-			$query_params[ 'default_where_conditions' ] = 'none';
171
+		if ($include_archived) {
172
+			$query_params['default_where_conditions'] = 'none';
173 173
 		}
174
-		return $this->get_first_related( 'Ticket', $query_params );
174
+		return $this->get_first_related('Ticket', $query_params);
175 175
 	}
176 176
 
177 177
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 * @return EE_Event
182 182
 	 */
183 183
 	public function event() {
184
-		return $this->get_first_related( 'Event' );
184
+		return $this->get_first_related('Event');
185 185
 	}
186 186
 
187 187
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	public function wp_user() {
197 197
 		$event = $this->event();
198
-		if ( $event instanceof EE_Event ) {
198
+		if ($event instanceof EE_Event) {
199 199
 			return $event->wp_user();
200 200
 		}
201 201
 		return 0;
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 * @access        public
222 222
 	 * @param        int $ATT_ID Attendee ID
223 223
 	 */
224
-	public function set_attendee_id( $ATT_ID = 0 ) {
225
-		$this->set( 'ATT_ID', $ATT_ID );
224
+	public function set_attendee_id($ATT_ID = 0) {
225
+		$this->set('ATT_ID', $ATT_ID);
226 226
 	}
227 227
 
228 228
 
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 	 * @access        public
234 234
 	 * @param        int $TXN_ID Transaction ID
235 235
 	 */
236
-	public function set_transaction_id( $TXN_ID = 0 ) {
237
-		$this->set( 'TXN_ID', $TXN_ID );
236
+	public function set_transaction_id($TXN_ID = 0) {
237
+		$this->set('TXN_ID', $TXN_ID);
238 238
 	}
239 239
 
240 240
 
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 	 * @access    public
246 246
 	 * @param    string $REG_session PHP Session ID
247 247
 	 */
248
-	public function set_session( $REG_session = '' ) {
249
-		$this->set( 'REG_session', $REG_session );
248
+	public function set_session($REG_session = '') {
249
+		$this->set('REG_session', $REG_session);
250 250
 	}
251 251
 
252 252
 
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 	 * @access    public
258 258
 	 * @param    string $REG_url_link Registration URL Link
259 259
 	 */
260
-	public function set_reg_url_link( $REG_url_link = '' ) {
261
-		$this->set( 'REG_url_link', $REG_url_link );
260
+	public function set_reg_url_link($REG_url_link = '') {
261
+		$this->set('REG_url_link', $REG_url_link);
262 262
 	}
263 263
 
264 264
 
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 	 * @access        public
270 270
 	 * @param        int $REG_count Primary Attendee
271 271
 	 */
272
-	public function set_count( $REG_count = 1 ) {
273
-		$this->set( 'REG_count', $REG_count );
272
+	public function set_count($REG_count = 1) {
273
+		$this->set('REG_count', $REG_count);
274 274
 	}
275 275
 
276 276
 
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
 	 * @access        public
282 282
 	 * @param        boolean $REG_group_size Group Registration
283 283
 	 */
284
-	public function set_group_size( $REG_group_size = FALSE ) {
285
-		$this->set( 'REG_group_size', $REG_group_size );
284
+	public function set_group_size($REG_group_size = FALSE) {
285
+		$this->set('REG_group_size', $REG_group_size);
286 286
 	}
287 287
 
288 288
 
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 	 * @access        public
366 366
 	 * @param        mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date
367 367
 	 */
368
-	public function set_reg_date( $REG_date = FALSE ) {
369
-		$this->set( 'REG_date', $REG_date );
368
+	public function set_reg_date($REG_date = FALSE) {
369
+		$this->set('REG_date', $REG_date);
370 370
 	}
371 371
 
372 372
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 	 * @access    public
378 378
 	 * @param    float $REG_final_price
379 379
 	 */
380
-	public function set_final_price( $REG_final_price = 0.00 ) {
381
-		$this->set( 'REG_final_price', $REG_final_price );
380
+	public function set_final_price($REG_final_price = 0.00) {
381
+		$this->set('REG_final_price', $REG_final_price);
382 382
 	}
383 383
 
384 384
 
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 	 * @access    public
390 390
 	 * @param    float $REG_paid
391 391
 	 */
392
-	public function set_paid( $REG_paid = 0.00 ) {
393
-		$this->set( 'REG_paid', $REG_paid );
392
+	public function set_paid($REG_paid = 0.00) {
393
+		$this->set('REG_paid', $REG_paid);
394 394
 	}
395 395
 
396 396
 
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 	 * @access        public
402 402
 	 * @param        boolean $REG_att_is_going Attendee Is Going
403 403
 	 */
404
-	public function set_att_is_going( $REG_att_is_going = FALSE ) {
405
-		$this->set( 'REG_att_is_going', $REG_att_is_going );
404
+	public function set_att_is_going($REG_att_is_going = FALSE) {
405
+		$this->set('REG_att_is_going', $REG_att_is_going);
406 406
 	}
407 407
 
408 408
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 * @return EE_Attendee
413 413
 	 */
414 414
 	public function attendee() {
415
-		return $this->get_first_related( 'Attendee' );
415
+		return $this->get_first_related('Attendee');
416 416
 	}
417 417
 
418 418
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	 * @access        public
423 423
 	 */
424 424
 	public function event_ID() {
425
-		return $this->get( 'EVT_ID' );
425
+		return $this->get('EVT_ID');
426 426
 	}
427 427
 
428 428
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 	 */
434 434
 	public function event_name() {
435 435
 		$event = $this->event_obj();
436
-		if ( $event ) {
436
+		if ($event) {
437 437
 			return $event->name();
438 438
 		} else {
439 439
 			return NULL;
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	 * @return EE_Event
448 448
 	 */
449 449
 	public function event_obj() {
450
-		return $this->get_first_related( 'Event' );
450
+		return $this->get_first_related('Event');
451 451
 	}
452 452
 
453 453
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	 * @access        public
458 458
 	 */
459 459
 	public function attendee_ID() {
460
-		return $this->get( 'ATT_ID' );
460
+		return $this->get('ATT_ID');
461 461
 	}
462 462
 
463 463
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	 * @access        public
468 468
 	 */
469 469
 	public function session_ID() {
470
-		return $this->get( 'REG_session' );
470
+		return $this->get('REG_session');
471 471
 	}
472 472
 
473 473
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
478 478
 	 * @return string
479 479
 	 */
480
-	public function receipt_url( $messenger = 'html' ) {
480
+	public function receipt_url($messenger = 'html') {
481 481
 
482 482
 		/**
483 483
 		 * The below will be deprecated one version after this.  We check first if there is a custom receipt template already in use on old system.  If there is then we just return the standard url for it.
@@ -485,12 +485,12 @@  discard block
 block discarded – undo
485 485
 		 * @since 4.5.0
486 486
 		 */
487 487
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/receipt_body.template.php';
488
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
488
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
489 489
 
490
-		if ( $has_custom ) {
491
-			return add_query_arg( array( 'receipt' => 'true' ), $this->invoice_url( 'launch' ) );
490
+		if ($has_custom) {
491
+			return add_query_arg(array('receipt' => 'true'), $this->invoice_url('launch'));
492 492
 		}
493
-		return apply_filters( 'FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt' );
493
+		return apply_filters('FHEE__EE_Registration__receipt_url__receipt_url', '', $this, $messenger, 'receipt');
494 494
 	}
495 495
 
496 496
 
@@ -501,28 +501,28 @@  discard block
 block discarded – undo
501 501
 	 * @param string $messenger 'pdf' or 'html'.  Default 'html'.
502 502
 	 * @return string
503 503
 	 */
504
-	public function invoice_url( $messenger = 'html' ) {
504
+	public function invoice_url($messenger = 'html') {
505 505
 		/**
506 506
 		 * The below will be deprecated one version after this.  We check first if there is a custom invoice template already in use on old system.  If there is then we just return the standard url for it.
507 507
 		 *
508 508
 		 * @since 4.5.0
509 509
 		 */
510 510
 		$template_relative_path = 'modules/gateways/Invoice/lib/templates/invoice_body.template.php';
511
-		$has_custom = EEH_Template::locate_template( $template_relative_path , array(), TRUE, TRUE, TRUE );
511
+		$has_custom = EEH_Template::locate_template($template_relative_path, array(), TRUE, TRUE, TRUE);
512 512
 
513
-		if ( $has_custom ) {
514
-			if ( $messenger == 'html' ) {
515
-				return $this->invoice_url( 'launch' );
513
+		if ($has_custom) {
514
+			if ($messenger == 'html') {
515
+				return $this->invoice_url('launch');
516 516
 			}
517 517
 			$route = $messenger == 'download' || $messenger == 'pdf' ? 'download_invoice' : 'launch_invoice';
518 518
 
519
-			$query_args = array( 'ee' => $route, 'id' => $this->reg_url_link() );
520
-			if ( $messenger == 'html' ) {
519
+			$query_args = array('ee' => $route, 'id' => $this->reg_url_link());
520
+			if ($messenger == 'html') {
521 521
 				$query_args['html'] = TRUE;
522 522
 			}
523
-			return add_query_arg( $query_args, get_permalink( EE_Registry::instance()->CFG->core->thank_you_page_id ) );
523
+			return add_query_arg($query_args, get_permalink(EE_Registry::instance()->CFG->core->thank_you_page_id));
524 524
 		}
525
-		return apply_filters( 'FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice' );
525
+		return apply_filters('FHEE__EE_Registration__invoice_url__invoice_url', '', $this, $messenger, 'invoice');
526 526
 	}
527 527
 
528 528
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	 * @throws \EE_Error
536 536
 	 */
537 537
 	public function reg_url_link() {
538
-		return (string)$this->get( 'REG_url_link' );
538
+		return (string) $this->get('REG_url_link');
539 539
 	}
540 540
 
541 541
 
@@ -545,8 +545,8 @@  discard block
 block discarded – undo
545 545
 	 * @param string $type 'download','launch', or 'html' (default is 'launch')
546 546
 	 * @return void
547 547
 	 */
548
-	public function e_invoice_url( $type = 'launch' ) {
549
-		echo $this->invoice_url( $type );
548
+	public function e_invoice_url($type = 'launch') {
549
+		echo $this->invoice_url($type);
550 550
 	}
551 551
 
552 552
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 	 * @return string
567 567
 	 */
568 568
 	public function payment_overview_url() {
569
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
569
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'payment_options', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
570 570
 	}
571 571
 
572 572
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	 * @return string
578 578
 	 */
579 579
 	public function edit_attendee_information_url() {
580
-		return add_query_arg( array( 'e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE ), EE_Registry::instance()->CFG->core->reg_page_url() );
580
+		return add_query_arg(array('e_reg_url_link' => $this->reg_url_link(), 'step' => 'attendee_information', 'revisit' => TRUE), EE_Registry::instance()->CFG->core->reg_page_url());
581 581
 	}
582 582
 
583 583
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 * @return string
588 588
 	 */
589 589
 	public function get_admin_edit_url() {
590
-		return EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID() ), admin_url( 'admin.php' ) );
590
+		return EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'view_registration', '_REG_ID' => $this->ID()), admin_url('admin.php'));
591 591
 	}
592 592
 
593 593
 
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	 * @access        public
598 598
 	 */
599 599
 	public function is_primary_registrant() {
600
-		return $this->get( 'REG_count' ) == 1 ? TRUE : FALSE;
600
+		return $this->get('REG_count') == 1 ? TRUE : FALSE;
601 601
 	}
602 602
 
603 603
 
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 * This returns the primary registration object for this registration group (which may be this object).
607 607
 	 * @return EE_Registration
608 608
 	 */
609
-	public function get_primary_registration()  {
610
-		if ( $this->is_primary_registrant() )
609
+	public function get_primary_registration() {
610
+		if ($this->is_primary_registrant())
611 611
 			return $this;
612 612
 
613 613
 		//k reg_count !== 1 so let's get the EE_Registration object matching this txn_id and reg_count == 1
614
-		$primary_registrant = EEM_Registration::instance()->get_one( array( array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1 ) ) );
614
+		$primary_registrant = EEM_Registration::instance()->get_one(array(array('TXN_ID' => $this->transaction_ID(), 'REG_count' => 1)));
615 615
 		return $primary_registrant;
616 616
 	}
617 617
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	* 		@access		public
623 623
 	*/
624 624
 	public function count() {
625
-		return $this->get( 'REG_count' );
625
+		return $this->get('REG_count');
626 626
 	}
627 627
 
628 628
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 * @access        public
633 633
 	 */
634 634
 	public function group_size() {
635
-		return $this->get( 'REG_group_size' );
635
+		return $this->get('REG_group_size');
636 636
 	}
637 637
 
638 638
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 	 * @access        public
643 643
 	 */
644 644
 	public function date() {
645
-		return $this->get( 'REG_date' );
645
+		return $this->get('REG_date');
646 646
 	}
647 647
 
648 648
 
@@ -653,8 +653,8 @@  discard block
 block discarded – undo
653 653
 	 * @param string $time_format
654 654
 	 * @return string
655 655
 	 */
656
-	public function pretty_date( $date_format = NULL, $time_format = NULL ) {
657
-		return $this->get_datetime( 'REG_date', $date_format, $time_format );
656
+	public function pretty_date($date_format = NULL, $time_format = NULL) {
657
+		return $this->get_datetime('REG_date', $date_format, $time_format);
658 658
 	}
659 659
 
660 660
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 * @return    float
668 668
 	 */
669 669
 	public function final_price() {
670
-		return $this->get( 'REG_final_price' );
670
+		return $this->get('REG_final_price');
671 671
 	}
672 672
 
673 673
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 	 * @return string
679 679
 	 */
680 680
 	public function pretty_final_price() {
681
-		return $this->get_pretty( 'REG_final_price' );
681
+		return $this->get_pretty('REG_final_price');
682 682
 	}
683 683
 
684 684
 
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 	 * @return 	float
690 690
 	 */
691 691
 	public function paid() {
692
-		return $this->get( 'REG_paid' );
692
+		return $this->get('REG_paid');
693 693
 	}
694 694
 
695 695
 
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 	 * @return 	float
701 701
 	 */
702 702
 	public function pretty_paid() {
703
-		return $this->get_pretty( 'REG_paid' );
703
+		return $this->get_pretty('REG_paid');
704 704
 	}
705 705
 
706 706
 
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
 	 * @param array $requires_payment
713 713
 	 * @return bool
714 714
 	 */
715
-	public function owes_monies_and_can_pay( $requires_payment = array()) {
715
+	public function owes_monies_and_can_pay($requires_payment = array()) {
716 716
 		// these reg statuses require payment (if event is not free)
717
-		$requires_payment = ! empty( $requires_payment ) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
717
+		$requires_payment = ! empty($requires_payment) ? $requires_payment : EEM_Registration::reg_statuses_that_allow_payment();
718 718
 		if (
719
-			in_array( $this->status_ID(), $requires_payment ) &&
719
+			in_array($this->status_ID(), $requires_payment) &&
720 720
 			$this->final_price() != 0 &&
721 721
 			$this->final_price() != $this->paid()
722 722
 		) {
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
 	 * @param bool $show_icons
734 734
 	 * @return void
735 735
 	 */
736
-	public function e_pretty_status( $show_icons = FALSE ) {
737
-		echo $this->pretty_status( $show_icons );
736
+	public function e_pretty_status($show_icons = FALSE) {
737
+		echo $this->pretty_status($show_icons);
738 738
 	}
739 739
 
740 740
 
@@ -745,10 +745,10 @@  discard block
 block discarded – undo
745 745
 	 * @param bool $show_icons
746 746
 	 * @return string
747 747
 	 */
748
-	public function pretty_status( $show_icons = FALSE ) {
749
-		$status = EEM_Status::instance()->localized_status( array( $this->status_ID() => __( 'unknown', 'event_espresso' ) ), FALSE, 'sentence' );
748
+	public function pretty_status($show_icons = FALSE) {
749
+		$status = EEM_Status::instance()->localized_status(array($this->status_ID() => __('unknown', 'event_espresso')), FALSE, 'sentence');
750 750
 		$icon = '';
751
-		switch ( $this->status_ID() ) {
751
+		switch ($this->status_ID()) {
752 752
 			case EEM_Registration::status_id_approved:
753 753
 				$icon = $show_icons ? '<span class="dashicons dashicons-star-filled ee-icon-size-16 green-text"></span>' : '';
754 754
 				break;
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 				$icon = $show_icons ? '<span class="dashicons dashicons-no ee-icon-size-16 red-text"></span>' : '';
769 769
 				break;
770 770
 		}
771
-		return $icon . $status[ $this->status_ID() ];
771
+		return $icon.$status[$this->status_ID()];
772 772
 	}
773 773
 
774 774
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	 * @access        public
779 779
 	 */
780 780
 	public function att_is_going() {
781
-		return $this->get( 'REG_att_is_going' );
781
+		return $this->get('REG_att_is_going');
782 782
 	}
783 783
 
784 784
 
@@ -788,8 +788,8 @@  discard block
 block discarded – undo
788 788
 	 * @param array $query_params like EEM_Base::get_all
789 789
 	 * @return EE_Answer[]
790 790
 	 */
791
-	public function answers( $query_params = NULL ) {
792
-		return $this->get_many_related( 'Answer', $query_params );
791
+	public function answers($query_params = NULL) {
792
+		return $this->get_many_related('Answer', $query_params);
793 793
 	}
794 794
 
795 795
 
@@ -803,9 +803,9 @@  discard block
 block discarded – undo
803 803
 	 * (because the answer might be an array of answer values, so passing pretty_value=true
804 804
 	 * will convert it into some kind of string)
805 805
 	 */
806
-	public function answer_value_to_question( $question, $pretty_value=true ) {
806
+	public function answer_value_to_question($question, $pretty_value = true) {
807 807
 		$question_id = EEM_Question::instance()->ensure_is_ID($question);
808
-		return EEM_Answer::instance()->get_answer_value_to_question($this,$question_id,$pretty_value);
808
+		return EEM_Answer::instance()->get_answer_value_to_question($this, $question_id, $pretty_value);
809 809
 	}
810 810
 
811 811
 
@@ -818,13 +818,13 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	public function question_groups() {
820 820
 		$question_groups = array();
821
-		if ( $this->event() instanceof EE_Event ) {
821
+		if ($this->event() instanceof EE_Event) {
822 822
 			$question_groups = $this->event()->question_groups(
823 823
 				array(
824 824
 					array(
825 825
 						'Event_Question_Group.EQG_primary' => $this->count() == 1 ? true : false
826 826
 					),
827
-					'order_by' => array( 'QSG_order' => 'ASC' )
827
+					'order_by' => array('QSG_order' => 'ASC')
828 828
 				)
829 829
 			);
830 830
 		}
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 	 */
842 842
 	public function count_question_groups() {
843 843
 		$qg_count = 0;
844
-		if ( $this->event() instanceof EE_Event ) {
844
+		if ($this->event() instanceof EE_Event) {
845 845
 			$qg_count = $this->event()->count_related(
846 846
 				'Question_Group',
847 847
 				array(
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
 	 * @return string
863 863
 	 */
864 864
 	public function reg_date() {
865
-		return $this->get_datetime( 'REG_date' );
865
+		return $this->get_datetime('REG_date');
866 866
 	}
867 867
 
868 868
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 	 * @return EE_Datetime_Ticket
875 875
 	 */
876 876
 	public function datetime_ticket() {
877
-		return $this->get_first_related( 'Datetime_Ticket' );
877
+		return $this->get_first_related('Datetime_Ticket');
878 878
 	}
879 879
 
880 880
 
@@ -884,15 +884,15 @@  discard block
 block discarded – undo
884 884
 	 * @param EE_Datetime_Ticket $datetime_ticket
885 885
 	 * @return EE_Datetime_Ticket
886 886
 	 */
887
-	public function set_datetime_ticket( $datetime_ticket ) {
888
-		return $this->_add_relation_to( $datetime_ticket, 'Datetime_Ticket' );
887
+	public function set_datetime_ticket($datetime_ticket) {
888
+		return $this->_add_relation_to($datetime_ticket, 'Datetime_Ticket');
889 889
 	}
890 890
 	/**
891 891
 	 * Gets deleted
892 892
 	 * @return boolean
893 893
 	 */
894 894
 	public function deleted() {
895
-		return $this->get( 'REG_deleted' );
895
+		return $this->get('REG_deleted');
896 896
 	}
897 897
 
898 898
 	/**
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 	 * @return boolean
902 902
 	 */
903 903
 	public function set_deleted($deleted) {
904
-		$this->set( 'REG_deleted', $deleted );
904
+		$this->set('REG_deleted', $deleted);
905 905
 	}
906 906
 
907 907
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 	 * @return EE_Status
912 912
 	 */
913 913
 	public function status_obj() {
914
-		return $this->get_first_related( 'Status' );
914
+		return $this->get_first_related('Status');
915 915
 	}
916 916
 
917 917
 
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 	 * @return int
923 923
 	 */
924 924
 	public function count_checkins() {
925
-		return $this->get_model()->count_related( $this, 'Checkin' );
925
+		return $this->get_model()->count_related($this, 'Checkin');
926 926
 	}
927 927
 
928 928
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 	 * @return int
933 933
 	 */
934 934
 	public function count_checkins_not_checkedout() {
935
-		return $this->get_model()->count_related( $this, 'Checkin', array( array( 'CHK_in' => 1 ) ) );
935
+		return $this->get_model()->count_related($this, 'Checkin', array(array('CHK_in' => 1)));
936 936
 	}
937 937
 
938 938
 
@@ -945,20 +945,20 @@  discard block
 block discarded – undo
945 945
 	 *
946 946
 	 * @return bool
947 947
 	 */
948
-	public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) {
949
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
948
+	public function can_checkin($DTT_OR_ID, $check_approved = TRUE) {
949
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
950 950
 
951 951
 		//first check registration status
952
-		if (  ( $check_approved && ! $this->is_approved() ) || ! $DTT_ID ) {
952
+		if (($check_approved && ! $this->is_approved()) || ! $DTT_ID) {
953 953
 			return false;
954 954
 		}
955 955
 		//is there a datetime ticket that matches this dtt_ID?
956
-		if ( ! ( EEM_Datetime_Ticket::instance()->exists( array( array( 'TKT_ID' => $this->get('TKT_ID' ), 'DTT_ID' => $DTT_ID ) ) ) ) ) {
956
+		if ( ! (EEM_Datetime_Ticket::instance()->exists(array(array('TKT_ID' => $this->get('TKT_ID'), 'DTT_ID' => $DTT_ID))))) {
957 957
 			return false;
958 958
 		}
959 959
 
960 960
 		//final check is against TKT_uses
961
-		return $this->verify_can_checkin_against_TKT_uses( $DTT_ID );
961
+		return $this->verify_can_checkin_against_TKT_uses($DTT_ID);
962 962
 	}
963 963
 
964 964
 
@@ -971,10 +971,10 @@  discard block
 block discarded – undo
971 971
 	 * @param int | EE_Datetime  $DTT_OR_ID  The datetime the registration is being checked against
972 972
 	 * @return bool   true means can checkin.  false means cannot checkin.
973 973
 	 */
974
-	public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) {
975
-		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID( $DTT_OR_ID );
974
+	public function verify_can_checkin_against_TKT_uses($DTT_OR_ID) {
975
+		$DTT_ID = EEM_Datetime::instance()->ensure_is_ID($DTT_OR_ID);
976 976
 
977
-		if ( ! $DTT_ID ) {
977
+		if ( ! $DTT_ID) {
978 978
 			return false;
979 979
 		}
980 980
 
@@ -982,23 +982,23 @@  discard block
 block discarded – undo
982 982
 
983 983
 		// if max uses is not set or equals infinity then return true cause its not a factor for whether user can check-in
984 984
 		// or not.
985
-		if ( ! $max_uses || $max_uses === EE_INF ) {
985
+		if ( ! $max_uses || $max_uses === EE_INF) {
986 986
 			return true;
987 987
 		}
988 988
 
989 989
 		//does this datetime have a checkin record?  If so, then the dtt count has already been verified so we can just
990 990
 		//go ahead and toggle.
991
-		if ( EEM_Checkin::instance()->exists( array( array( 'REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID ) ) ) ) {
991
+		if (EEM_Checkin::instance()->exists(array(array('REG_ID' => $this->ID(), 'DTT_ID' => $DTT_ID)))) {
992 992
 			return true;
993 993
 		}
994 994
 
995 995
 		//made it here so the last check is whether the number of checkins per unique datetime on this registration
996 996
 		//disallows further check-ins.
997
-		$count_unique_dtt_checkins = EEM_Checkin::instance()->count( array( array( 'REG_ID' => $this->ID(), 'CHK_in' => true ) ), 'DTT_ID', true );
997
+		$count_unique_dtt_checkins = EEM_Checkin::instance()->count(array(array('REG_ID' => $this->ID(), 'CHK_in' => true)), 'DTT_ID', true);
998 998
 		// checkins have already reached their max number of uses
999 999
 		// so registrant can NOT checkin
1000
-		if ( $count_unique_dtt_checkins >= $max_uses ) {
1001
-			EE_Error::add_error( __( 'Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1000
+		if ($count_unique_dtt_checkins >= $max_uses) {
1001
+			EE_Error::add_error(__('Check-in denied because number of datetime uses for the ticket has been reached or exceeded.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1002 1002
 			return false;
1003 1003
 		}
1004 1004
 		return true;
@@ -1019,15 +1019,15 @@  discard block
 block discarded – undo
1019 1019
 	 * @param  bool $verify  If true then can_checkin() is used to verify whether the person can be checked in or not.  Otherwise this forces change in checkin status.
1020 1020
 	 * @return int|BOOL            the chk_in status toggled to OR false if nothing got changed.
1021 1021
 	 */
1022
-	public function toggle_checkin_status( $DTT_ID = null, $verify = false ) {
1023
-		if ( empty( $DTT_ID ) ) {
1022
+	public function toggle_checkin_status($DTT_ID = null, $verify = false) {
1023
+		if (empty($DTT_ID)) {
1024 1024
 			$datetime = $this->get_related_primary_datetime();
1025 1025
 			$DTT_ID = $datetime->ID();
1026 1026
 		// verify the registration can checkin for the given DTT_ID
1027
-		} elseif ( ! $this->can_checkin( $DTT_ID, $verify ) ) {
1027
+		} elseif ( ! $this->can_checkin($DTT_ID, $verify)) {
1028 1028
 			EE_Error::add_error(
1029 1029
 					sprintf(
1030
-						__( 'The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1030
+						__('The given registration (ID:%1$d) can not be checked in to the given DTT_ID (%2$d), because the registration does not have access', 'event_espresso'),
1031 1031
 						$this->ID(),
1032 1032
 						$DTT_ID
1033 1033
 					),
@@ -1041,8 +1041,8 @@  discard block
 block discarded – undo
1041 1041
 			EE_Registration::checkin_status_out => EE_Registration::checkin_status_in
1042 1042
 		);
1043 1043
 		//start by getting the current status so we know what status we'll be changing to.
1044
-		$cur_status = $this->check_in_status_for_datetime( $DTT_ID, NULL );
1045
-		$status_to = $status_paths[ $cur_status ];
1044
+		$cur_status = $this->check_in_status_for_datetime($DTT_ID, NULL);
1045
+		$status_to = $status_paths[$cur_status];
1046 1046
 		// database only records true for checked IN or false for checked OUT
1047 1047
 		// no record ( null ) means checked in NEVER, but we obviously don't save that
1048 1048
 		$new_status = $status_to == EE_Registration::checkin_status_in ? true : false;
@@ -1050,24 +1050,24 @@  discard block
 block discarded – undo
1050 1050
 		// because we are keeping track of Check-ins over time.
1051 1051
 		// Eventually we'll probably want to show a list table
1052 1052
 		// for the individual Check-ins so that they can be managed.
1053
-		$checkin = EE_Checkin::new_instance( array(
1053
+		$checkin = EE_Checkin::new_instance(array(
1054 1054
 				'REG_ID' => $this->ID(),
1055 1055
 				'DTT_ID' => $DTT_ID,
1056 1056
 				'CHK_in' => $new_status
1057
-		) );
1057
+		));
1058 1058
 		// if the record could not be saved then return false
1059
-		if ( $checkin->save() === 0 ) {
1060
-			if ( WP_DEBUG ) {
1059
+		if ($checkin->save() === 0) {
1060
+			if (WP_DEBUG) {
1061 1061
 				global $wpdb;
1062 1062
 				$error = sprintf(
1063
-					__( 'Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso' ),
1063
+					__('Registration check in update failed because of the following database error: %1$s%2$s', 'event_espresso'),
1064 1064
 					'<br />',
1065 1065
 					$wpdb->last_error
1066 1066
 				);
1067 1067
 			} else {
1068
-				$error = __( 'Registration check in update failed because of an unknown database error', 'event_espresso' );
1068
+				$error = __('Registration check in update failed because of an unknown database error', 'event_espresso');
1069 1069
 			}
1070
-			EE_Error::add_error( $error, __FILE__, __FUNCTION__, __LINE__ );
1070
+			EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
1071 1071
 			return false;
1072 1072
 		}
1073 1073
 		return $status_to;
@@ -1091,19 +1091,19 @@  discard block
 block discarded – undo
1091 1091
 	 * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id.
1092 1092
 	 * @return int            Integer representing Check-in status.
1093 1093
 	 */
1094
-	public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) {
1095
-		if ( empty( $DTT_ID ) && ! $checkin instanceof EE_Checkin ) {
1094
+	public function check_in_status_for_datetime($DTT_ID = 0, $checkin = NULL) {
1095
+		if (empty($DTT_ID) && ! $checkin instanceof EE_Checkin) {
1096 1096
 			$datetime = $this->get_related_primary_datetime();
1097
-			if ( ! $datetime instanceof EE_Datetime ) {
1097
+			if ( ! $datetime instanceof EE_Datetime) {
1098 1098
 				return 0;
1099 1099
 			}
1100 1100
 			$DTT_ID = $datetime->ID();
1101 1101
 		//verify the registration can checkin for the given DTT_ID
1102 1102
 		}
1103 1103
 		//get checkin object (if exists)
1104
-		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related( 'Checkin', array( array( 'DTT_ID' => $DTT_ID ), 'order_by' => array( 'CHK_timestamp' => 'DESC' ) ) );
1105
-		if ( $checkin instanceof EE_Checkin ) {
1106
-			if ( $checkin->get( 'CHK_in' ) ) {
1104
+		$checkin = $checkin instanceof EE_Checkin ? $checkin : $this->get_first_related('Checkin', array(array('DTT_ID' => $DTT_ID), 'order_by' => array('CHK_timestamp' => 'DESC')));
1105
+		if ($checkin instanceof EE_Checkin) {
1106
+			if ($checkin->get('CHK_in')) {
1107 1107
 				return EE_Registration::checkin_status_in; //checked in
1108 1108
 			} else {
1109 1109
 				return EE_Registration::checkin_status_out; //had checked in but is now checked out.
@@ -1121,28 +1121,28 @@  discard block
 block discarded – undo
1121 1121
 	 * @param bool $error  This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name.
1122 1122
 	 * @return string         internationalized message
1123 1123
 	 */
1124
-	public function get_checkin_msg( $DTT_ID, $error = FALSE ) {
1124
+	public function get_checkin_msg($DTT_ID, $error = FALSE) {
1125 1125
 		//let's get the attendee first so we can include the name of the attendee
1126
-		$attendee = $this->get_first_related( 'Attendee' );
1127
-		if ( $attendee instanceof EE_Attendee ) {
1128
-			if ( $error ) {
1129
-				return sprintf( __( "%s's check-in status was not changed.", "event_espresso" ), $attendee->full_name() );
1126
+		$attendee = $this->get_first_related('Attendee');
1127
+		if ($attendee instanceof EE_Attendee) {
1128
+			if ($error) {
1129
+				return sprintf(__("%s's check-in status was not changed.", "event_espresso"), $attendee->full_name());
1130 1130
 			}
1131
-			$cur_status = $this->check_in_status_for_datetime( $DTT_ID );
1131
+			$cur_status = $this->check_in_status_for_datetime($DTT_ID);
1132 1132
 			//what is the status message going to be?
1133
-			switch ( $cur_status ) {
1133
+			switch ($cur_status) {
1134 1134
 				case EE_Registration::checkin_status_never :
1135
-					return sprintf( __( "%s has been removed from Check-in records", "event_espresso" ), $attendee->full_name() );
1135
+					return sprintf(__("%s has been removed from Check-in records", "event_espresso"), $attendee->full_name());
1136 1136
 					break;
1137 1137
 				case EE_Registration::checkin_status_in :
1138
-					return sprintf( __( '%s has been checked in', 'event_espresso' ), $attendee->full_name() );
1138
+					return sprintf(__('%s has been checked in', 'event_espresso'), $attendee->full_name());
1139 1139
 					break;
1140 1140
 				case EE_Registration::checkin_status_out :
1141
-					return sprintf( __( '%s has been checked out', 'event_espresso' ), $attendee->full_name() );
1141
+					return sprintf(__('%s has been checked out', 'event_espresso'), $attendee->full_name());
1142 1142
 					break;
1143 1143
 			}
1144 1144
 		}
1145
-		return __( "The check-in status could not be determined.", "event_espresso" );
1145
+		return __("The check-in status could not be determined.", "event_espresso");
1146 1146
 	}
1147 1147
 
1148 1148
 
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
 	 * @return EE_Transaction
1153 1153
 	 */
1154 1154
 	public function transaction() {
1155
-		return $this->get_first_related( 'Transaction' );
1155
+		return $this->get_first_related('Transaction');
1156 1156
 	}
1157 1157
 
1158 1158
 
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 	 * @access        public
1164 1164
 	 */
1165 1165
 	public function reg_code() {
1166
-		return $this->get( 'REG_code' );
1166
+		return $this->get('REG_code');
1167 1167
 	}
1168 1168
 
1169 1169
 
@@ -1173,7 +1173,7 @@  discard block
 block discarded – undo
1173 1173
 	 * @access        public
1174 1174
 	 */
1175 1175
 	public function transaction_ID() {
1176
-		return $this->get( 'TXN_ID' );
1176
+		return $this->get('TXN_ID');
1177 1177
 	}
1178 1178
 
1179 1179
 
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 	 * @return int
1183 1183
 	 */
1184 1184
 	public function ticket_ID() {
1185
-		return $this->get( 'TKT_ID' );
1185
+		return $this->get('TKT_ID');
1186 1186
 	}
1187 1187
 
1188 1188
 
@@ -1194,17 +1194,17 @@  discard block
 block discarded – undo
1194 1194
 	 * @param    string $REG_code Registration Code
1195 1195
 	 * @param	boolean $use_default
1196 1196
 	 */
1197
-	public function set_reg_code( $REG_code, $use_default = FALSE ) {
1198
-		if ( empty( $REG_code )) {
1199
-			EE_Error::add_error( __( 'REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
1197
+	public function set_reg_code($REG_code, $use_default = FALSE) {
1198
+		if (empty($REG_code)) {
1199
+			EE_Error::add_error(__('REG_code can not be empty.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1200 1200
 			return;
1201 1201
 		}
1202
-		if ( ! $this->reg_code() ) {
1203
-			parent::set( 'REG_code', $REG_code, $use_default );
1202
+		if ( ! $this->reg_code()) {
1203
+			parent::set('REG_code', $REG_code, $use_default);
1204 1204
 		} else {
1205 1205
 			EE_Error::doing_it_wrong(
1206
-				__CLASS__ . '::' . __FUNCTION__,
1207
-				__( 'Can not change a registration REG_code once it has been set.', 'event_espresso' ),
1206
+				__CLASS__.'::'.__FUNCTION__,
1207
+				__('Can not change a registration REG_code once it has been set.', 'event_espresso'),
1208 1208
 				'4.6.0'
1209 1209
 			);
1210 1210
 		}
@@ -1224,17 +1224,17 @@  discard block
 block discarded – undo
1224 1224
 	 * @return EE_Registration[]  or empty array if this isn't a group registration.
1225 1225
 	 */
1226 1226
 	public function get_all_other_registrations_in_group() {
1227
-		if ( $this->group_size() < 2 ) {
1227
+		if ($this->group_size() < 2) {
1228 1228
 			return array();
1229 1229
 		}
1230 1230
 
1231 1231
 		$query[0] = array(
1232 1232
 			'TXN_ID' => $this->transaction_ID(),
1233
-			'REG_ID' => array( '!=', $this->ID() ),
1233
+			'REG_ID' => array('!=', $this->ID()),
1234 1234
 			'TKT_ID' => $this->ticket_ID()
1235 1235
 			);
1236 1236
 
1237
-		$registrations = $this->get_model()->get_all( $query );
1237
+		$registrations = $this->get_model()->get_all($query);
1238 1238
 		return $registrations;
1239 1239
 	}
1240 1240
 
@@ -1243,14 +1243,14 @@  discard block
 block discarded – undo
1243 1243
 	 * @return string
1244 1244
 	 */
1245 1245
 	public function get_admin_details_link() {
1246
-		EE_Registry::instance()->load_helper( 'URL' );
1246
+		EE_Registry::instance()->load_helper('URL');
1247 1247
 		return EEH_URL::add_query_args_and_nonce(
1248 1248
 			array(
1249 1249
 				'page' => 'espresso_registrations',
1250 1250
 				'action' => 'view_registration',
1251 1251
 				'_REG_ID' => $this->ID()
1252 1252
 			),
1253
-			admin_url( 'admin.php' )
1253
+			admin_url('admin.php')
1254 1254
 		);
1255 1255
 	}
1256 1256
 
@@ -1275,12 +1275,12 @@  discard block
 block discarded – undo
1275 1275
 	 * @return string
1276 1276
 	 */
1277 1277
 	public function get_admin_overview_link() {
1278
-		EE_Registry::instance()->load_helper( 'URL' );
1278
+		EE_Registry::instance()->load_helper('URL');
1279 1279
 		return EEH_URL::add_query_args_and_nonce(
1280 1280
 			array(
1281 1281
 				'page' => 'espresso_registrations'
1282 1282
 			),
1283
-			admin_url( 'admin.php' )
1283
+			admin_url('admin.php')
1284 1284
 		);
1285 1285
 	}
1286 1286
 
@@ -1289,8 +1289,8 @@  discard block
 block discarded – undo
1289 1289
 	 * @param array $query_params
1290 1290
 	 * @return \EE_Registration[]
1291 1291
 	 */
1292
-	public function payments( $query_params = array() ) {
1293
-		return $this->get_many_related( 'Payment', $query_params );
1292
+	public function payments($query_params = array()) {
1293
+		return $this->get_many_related('Payment', $query_params);
1294 1294
 	}
1295 1295
 
1296 1296
 
@@ -1299,8 +1299,8 @@  discard block
 block discarded – undo
1299 1299
 	 * @param array $query_params
1300 1300
 	 * @return \EE_Registration[]
1301 1301
 	 */
1302
-	public function registration_payments( $query_params = array() ) {
1303
-		return $this->get_many_related( 'Registration_Payment', $query_params );
1302
+	public function registration_payments($query_params = array()) {
1303
+		return $this->get_many_related('Registration_Payment', $query_params);
1304 1304
 	}
1305 1305
 
1306 1306
 
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 	 * @access 	public
1312 1312
 	 */
1313 1313
 	public function price_paid() {
1314
-		EE_Error::doing_it_wrong( 'EE_Registration::price_paid()', __( 'This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso' ), '4.7.0' );
1314
+		EE_Error::doing_it_wrong('EE_Registration::price_paid()', __('This method is deprecated, please use EE_Registration::final_price() instead.', 'event_espresso'), '4.7.0');
1315 1315
 		return $this->final_price();
1316 1316
 	}
1317 1317
 
@@ -1323,9 +1323,9 @@  discard block
 block discarded – undo
1323 1323
 	 * @access    public
1324 1324
 	 * @param    float $REG_final_price
1325 1325
 	 */
1326
-	public function set_price_paid( $REG_final_price = 0.00 ) {
1327
-		EE_Error::doing_it_wrong( 'EE_Registration::set_price_paid()', __( 'This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso' ), '4.7.0' );
1328
-		$this->set_final_price( $REG_final_price );
1326
+	public function set_price_paid($REG_final_price = 0.00) {
1327
+		EE_Error::doing_it_wrong('EE_Registration::set_price_paid()', __('This method is deprecated, please use EE_Registration::set_final_price() instead.', 'event_espresso'), '4.7.0');
1328
+		$this->set_final_price($REG_final_price);
1329 1329
 	}
1330 1330
 
1331 1331
 
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 	 * @return string
1337 1337
 	 */
1338 1338
 	public function pretty_price_paid() {
1339
-		EE_Error::doing_it_wrong( 'EE_Registration::pretty_price_paid()', __( 'This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso' ), '4.7.0' );
1339
+		EE_Error::doing_it_wrong('EE_Registration::pretty_price_paid()', __('This method is deprecated, please use EE_Registration::pretty_final_price() instead.', 'event_espresso'), '4.7.0');
1340 1340
 		return $this->pretty_final_price();
1341 1341
 	}
1342 1342
 
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 	 * @return EE_Payment_Method|null
1351 1351
 	 */
1352 1352
 	public function payment_method() {
1353
-		return EEM_Payment_Method::instance()->get_last_used_for_registration( $this );
1353
+		return EEM_Payment_Method::instance()->get_last_used_for_registration($this);
1354 1354
 	}
1355 1355
 
1356 1356
 
Please login to merge, or discard this patch.
core/EE_Cart.core.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 *	@access public
198 198
 	 *	@param EE_Ticket $ticket
199 199
 	 *	@param int $qty
200
-	 *	@return TRUE on success, FALSE on fail
200
+	 *	@return boolean on success, FALSE on fail
201 201
 	 */
202 202
 	public function add_ticket_to_cart( EE_Ticket $ticket, $qty = 1 ) {
203 203
 		EEH_Line_Item::add_ticket_purchase( $this->get_grand_total(), $ticket, $qty );
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	/**
285 285
 	 *	@remove ALL items from cart and delete total as well
286 286
 	 *	@access public
287
-	 *	@return bool
287
+	 *	@return integer
288 288
 	 */
289 289
 	public function delete_cart() {
290 290
 		EE_Registry::instance()->load_helper( 'Line_Item' );
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	  * @save cart to session
314 314
 	  * @access public
315 315
 	  * @param bool $apply_taxes
316
-	  * @return TRUE on success, FALSE on fail
316
+	  * @return boolean on success, FALSE on fail
317 317
 	  */
318 318
 	public function save_cart( $apply_taxes = TRUE ) {
319 319
 		if ( $apply_taxes && $this->_grand_total instanceof EE_Line_Item ) {
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
-do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );/**
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
+do_action('AHEE_log', __FILE__, __FUNCTION__, ''); /**
3 3
  *
4 4
  * Event Espresso
5 5
  *
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
 	  * @param EE_Session $session
68 68
 	  * @return \EE_Cart
69 69
 	  */
70
-	 public static function instance( EE_Line_Item $grand_total = null, EE_Session $session = null ) {
71
-		if ( ! empty( $grand_total ) ){
72
-			self::$_instance = new self( $grand_total, $session );
70
+	 public static function instance(EE_Line_Item $grand_total = null, EE_Session $session = null) {
71
+		if ( ! empty($grand_total)) {
72
+			self::$_instance = new self($grand_total, $session);
73 73
 		}
74 74
 		// or maybe retrieve an existing one ?
75
-		if ( ! self::$_instance instanceof EE_Cart ) {
75
+		if ( ! self::$_instance instanceof EE_Cart) {
76 76
 			// try getting the cart out of the session
77 77
 			$saved_cart = $session instanceof EE_Session ? $session->cart() : null;
78
-			self::$_instance = $saved_cart instanceof EE_Cart ? $saved_cart : new self( $grand_total, $session );
79
-			unset( $saved_cart );
78
+			self::$_instance = $saved_cart instanceof EE_Cart ? $saved_cart : new self($grand_total, $session);
79
+			unset($saved_cart);
80 80
 		}
81 81
 		// verify that cart is ok and grand total line item exists
82
-		if ( ! self::$_instance instanceof EE_Cart || ! self::$_instance->_grand_total instanceof EE_Line_Item ) {
83
-			self::$_instance = new self( $grand_total, $session );
82
+		if ( ! self::$_instance instanceof EE_Cart || ! self::$_instance->_grand_total instanceof EE_Line_Item) {
83
+			self::$_instance = new self($grand_total, $session);
84 84
 		}
85 85
 		self::$_instance->get_grand_total();
86 86
 		 // once everything is all said and done, save the cart to the EE_Session
87
-		add_action( 'shutdown', array( self::$_instance, 'save_cart' ), 90 );
87
+		add_action('shutdown', array(self::$_instance, 'save_cart'), 90);
88 88
 		return self::$_instance;
89 89
 	}
90 90
 
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	  * @param EE_Session $session
99 99
 	  * @return \EE_Cart
100 100
 	  */
101
-	 private function __construct( EE_Line_Item $grand_total = null, EE_Session $session = null ) {
102
-		 do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
103
-		 $this->set_session( $session );
104
-		 if ( $grand_total instanceof EE_Line_Item ) {
105
-			 $this->set_grand_total_line_item( $grand_total );
101
+	 private function __construct(EE_Line_Item $grand_total = null, EE_Session $session = null) {
102
+		 do_action('AHEE_log', __FILE__, __FUNCTION__, '');
103
+		 $this->set_session($session);
104
+		 if ($grand_total instanceof EE_Line_Item) {
105
+			 $this->set_grand_total_line_item($grand_total);
106 106
 		 }
107 107
 	 }
108 108
 
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 	  * @param EE_Session $session
115 115
 	  * @return EE_Cart
116 116
 	  */
117
-	 public static function reset( EE_Line_Item $grand_total = null, EE_Session $session = null ) {
118
-		 remove_action( 'shutdown', array( self::$_instance, 'save_cart' ), 90 );
119
-		 if ( $session instanceof EE_Session ) {
117
+	 public static function reset(EE_Line_Item $grand_total = null, EE_Session $session = null) {
118
+		 remove_action('shutdown', array(self::$_instance, 'save_cart'), 90);
119
+		 if ($session instanceof EE_Session) {
120 120
 			 $session->reset_cart();
121 121
 		 }
122 122
 		 self::$_instance = null;
123
-		 return self::instance( $grand_total, $session );
123
+		 return self::instance($grand_total, $session);
124 124
 	 }
125 125
 
126 126
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 	 /**
129 129
 	  * @param EE_Session $session
130 130
 	  */
131
-	 public function set_session( EE_Session $session = null ) {
132
-		 $this->_session = $session instanceof EE_Session ? $session : EE_Registry::instance()->load_core( 'Session' );
131
+	 public function set_session(EE_Session $session = null) {
132
+		 $this->_session = $session instanceof EE_Session ? $session : EE_Registry::instance()->load_core('Session');
133 133
 	 }
134 134
 
135 135
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	  *  know the grand total line item on it
140 140
 	  * @param EE_Line_Item $line_item
141 141
 	  */
142
-	 public function set_grand_total_line_item( EE_Line_Item $line_item ) {
142
+	 public function set_grand_total_line_item(EE_Line_Item $line_item) {
143 143
 		 $this->_grand_total = $line_item;
144 144
 	 }
145 145
 
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
 	  * @param EE_Session $session
153 153
 	  * @return \EE_Cart
154 154
 	  */
155
-	public static function get_cart_from_txn( EE_Transaction $transaction, EE_Session $session = null ) {
155
+	public static function get_cart_from_txn(EE_Transaction $transaction, EE_Session $session = null) {
156 156
 		$grand_total = $transaction->total_line_item();
157 157
 		$grand_total->get_items();
158 158
 		$grand_total->tax_descendants();
159
-		return EE_Cart::instance( $grand_total, $session );
159
+		return EE_Cart::instance($grand_total, $session);
160 160
 	}
161 161
 
162 162
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * Creates the total line item, and ensures it has its 'tickets' and 'taxes' sub-items
166 166
 	 * @return EE_Line_Item
167 167
 	 */
168
-	private function _create_grand_total(){
168
+	private function _create_grand_total() {
169 169
 		$this->_grand_total = EEH_Line_Item::create_total_line_item();
170 170
 		return $this->_grand_total;
171 171
 	}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 *	@return \EE_Line_Item[]
179 179
 	 */
180 180
 	public function get_tickets() {
181
-		return EEH_Line_Item::get_ticket_line_items( $this->_grand_total );
181
+		return EEH_Line_Item::get_ticket_line_items($this->_grand_total);
182 182
 	}
183 183
 
184 184
 
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function all_ticket_quantity_count() {
193 193
 		$tickets = $this->get_tickets();
194
-		if ( empty( $tickets )) {
194
+		if (empty($tickets)) {
195 195
 			return 0;
196 196
 		}
197 197
 		$count = 0;
198
-		foreach ( $tickets as $ticket ) {
198
+		foreach ($tickets as $ticket) {
199 199
 			$count = $count + $ticket->get('LIN_quantity');
200 200
 		}
201 201
 		return $count;
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 	 *  Gets all the tax line items
208 208
 	 * @return \EE_Line_Item[]
209 209
 	 */
210
-	public function get_taxes(){
211
-		return EEH_Line_Item::get_taxes_subtotal( $this->_grand_total )->children();
210
+	public function get_taxes() {
211
+		return EEH_Line_Item::get_taxes_subtotal($this->_grand_total)->children();
212 212
 	}
213 213
 
214 214
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 * Gets the total line item (which is a parent of all other line items) on this cart
218 218
 	 * @return EE_Line_Item
219 219
 	 */
220
-	public function get_grand_total(){
220
+	public function get_grand_total() {
221 221
 		return $this->_grand_total instanceof EE_Line_Item ? $this->_grand_total : $this->_create_grand_total();
222 222
 	}
223 223
 
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 	 *	@param int $qty
231 231
 	 *	@return TRUE on success, FALSE on fail
232 232
 	 */
233
-	public function add_ticket_to_cart( EE_Ticket $ticket, $qty = 1 ) {
234
-		EEH_Line_Item::add_ticket_purchase( $this->get_grand_total(), $ticket, $qty );
233
+	public function add_ticket_to_cart(EE_Ticket $ticket, $qty = 1) {
234
+		EEH_Line_Item::add_ticket_purchase($this->get_grand_total(), $ticket, $qty);
235 235
 		return $this->save_cart() ? TRUE : FALSE;
236 236
 	}
237 237
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	 *	@return float
255 255
 	 */
256 256
 	public function get_applied_taxes() {
257
-		return EEH_Line_Item::ensure_taxes_applied( $this->_grand_total );
257
+		return EEH_Line_Item::ensure_taxes_applied($this->_grand_total);
258 258
 	}
259 259
 
260 260
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 *	@return float
266 266
 	 */
267 267
 	public function get_cart_grand_total() {
268
-		EEH_Line_Item::ensure_taxes_applied( $this->_grand_total );
268
+		EEH_Line_Item::ensure_taxes_applied($this->_grand_total);
269 269
 		return $this->get_grand_total()->total();
270 270
 	}
271 271
 
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function recalculate_all_cart_totals() {
280 280
 		$pre_tax_total = $this->get_cart_total_before_tax();
281
-		$taxes_total = EEH_Line_Item::ensure_taxes_applied( $this->_grand_total );
282
-		$this->_grand_total->set_total( $pre_tax_total + $taxes_total );
281
+		$taxes_total = EEH_Line_Item::ensure_taxes_applied($this->_grand_total);
282
+		$this->_grand_total->set_total($pre_tax_total + $taxes_total);
283 283
 		$this->_grand_total->save_this_and_descendants_to_txn();
284 284
 		return $this->get_grand_total()->total();
285 285
 	}
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	 *	@param array|bool|string $line_item_codes
293 293
 	 *	@return int on success, FALSE on fail
294 294
 	 */
295
-	public function delete_items( $line_item_codes = FALSE ) {
296
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
297
-		return EEH_Line_Item::delete_items($this->get_grand_total(), $line_item_codes );
295
+	public function delete_items($line_item_codes = FALSE) {
296
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
297
+		return EEH_Line_Item::delete_items($this->get_grand_total(), $line_item_codes);
298 298
 	}
299 299
 
300 300
 
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 	 *	@return bool
306 306
 	 */
307 307
 	public function empty_cart() {
308
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
308
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
309 309
 		$this->_grand_total = $this->_create_grand_total();
310
-		return $this->save_cart( TRUE );
310
+		return $this->save_cart(TRUE);
311 311
 	}
312 312
 
313 313
 
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
 	 *	@return bool
319 319
 	 */
320 320
 	public function delete_cart() {
321
-		$deleted = EEH_Line_Item::delete_all_child_items( $this->_grand_total );
322
-		if ( $deleted ) {
321
+		$deleted = EEH_Line_Item::delete_all_child_items($this->_grand_total);
322
+		if ($deleted) {
323 323
 			$deleted += $this->_grand_total->delete();
324 324
 			$this->_grand_total = null;
325 325
 		}
@@ -334,17 +334,17 @@  discard block
 block discarded – undo
334 334
 	  * @param bool $apply_taxes
335 335
 	  * @return TRUE on success, FALSE on fail
336 336
 	  */
337
-	public function save_cart( $apply_taxes = TRUE ) {
338
-		if ( $apply_taxes && $this->_grand_total instanceof EE_Line_Item ) {
339
-			EEH_Line_Item::ensure_taxes_applied( $this->_grand_total );
337
+	public function save_cart($apply_taxes = TRUE) {
338
+		if ($apply_taxes && $this->_grand_total instanceof EE_Line_Item) {
339
+			EEH_Line_Item::ensure_taxes_applied($this->_grand_total);
340 340
 			//make sure we don't cache the transaction because it can get stale
341
-			if( $this->_grand_total->get_one_from_cache( 'Transaction' ) instanceof EE_Transaction &&
342
-				$this->_grand_total->get_one_from_cache( 'Transaction' )->ID()) {
343
-				$this->_grand_total->clear_cache( 'Transaction', null, true );
341
+			if ($this->_grand_total->get_one_from_cache('Transaction') instanceof EE_Transaction &&
342
+				$this->_grand_total->get_one_from_cache('Transaction')->ID()) {
343
+				$this->_grand_total->clear_cache('Transaction', null, true);
344 344
 			}
345 345
 		}
346
-		if ( $this->_session instanceof EE_Session ) {
347
-			return $this->_session->set_cart( $this );
346
+		if ($this->_session instanceof EE_Session) {
347
+			return $this->_session->set_cart($this);
348 348
 		} else {
349 349
 			return false;
350 350
 		}
Please login to merge, or discard this patch.
core/helpers/EEH_Activation.helper.php 4 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 	 * @since  4.6.0
557 557
 	 * @global WPDB $wpdb
558 558
 	 *
559
-	 * @return mixed null|int WP_user ID or NULL
559
+	 * @return integer|null null|int WP_user ID or NULL
560 560
 	 */
561 561
 	public static function get_default_creator_id() {
562 562
 		global $wpdb;
@@ -701,6 +701,7 @@  discard block
 block discarded – undo
701 701
 	 * 	@access public
702 702
 	 * 	@static
703 703
 	 * 	@param string $table_name, without prefixed $wpdb->prefix
704
+	 * @param string $table_name
704 705
 	 * 	@return array of database column names
705 706
 	 */
706 707
 	public static function get_fields_on_table( $table_name = NULL ) {
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			if ( is_array( $hooks_to_fire_at_time ) ) {
208 208
 				foreach ( $hooks_to_fire_at_time as $hook_name => $hook_actions ) {
209 209
 					if ( isset( $ee_cron_tasks_to_remove[ $hook_name ] )
210
-					     && is_array( $ee_cron_tasks_to_remove[ $hook_name ] )
210
+						 && is_array( $ee_cron_tasks_to_remove[ $hook_name ] )
211 211
 					) {
212 212
 						unset( $crons[ $timestamp ][ $hook_name ] );
213 213
 					}
@@ -1124,14 +1124,14 @@  discard block
 block discarded – undo
1124 1124
 							$QSG_ID = reset( $id_col );
1125 1125
 						} else {
1126 1126
 							//ok so we didn't find it in the db either?? that's weird because we should have inserted it at the start of this method
1127
-                                                        EE_Log::instance()->log(
1128
-                                                                __FILE__,
1129
-                                                                __FUNCTION__,
1130
-                                                                sprintf(
1131
-                                                                        __( 'Could not associate question %1$s to a question group because no system question group existed', 'event_espresso'),
1132
-                                                                        $QST_ID ),
1133
-                                                                'error' );
1134
-                                                        continue;
1127
+														EE_Log::instance()->log(
1128
+																__FILE__,
1129
+																__FUNCTION__,
1130
+																sprintf(
1131
+																		__( 'Could not associate question %1$s to a question group because no system question group existed', 'event_espresso'),
1132
+																		$QST_ID ),
1133
+																'error' );
1134
+														continue;
1135 1135
 						}
1136 1136
 					}
1137 1137
 
@@ -1139,8 +1139,8 @@  discard block
 block discarded – undo
1139 1139
 					$wpdb->insert(
1140 1140
 						EEH_Activation::ensure_table_name_has_prefix( 'esp_question_group_question' ),
1141 1141
 						array( 'QSG_ID'    => $QSG_ID,
1142
-						       'QST_ID'    => $QST_ID,
1143
-						       'QGQ_order' => ( $QSG_ID === 1 ) ? $order_for_group_1++ : $order_for_group_2++
1142
+							   'QST_ID'    => $QST_ID,
1143
+							   'QGQ_order' => ( $QSG_ID === 1 ) ? $order_for_group_1++ : $order_for_group_2++
1144 1144
 						),
1145 1145
 						array( '%d', '%d', '%d' )
1146 1146
 					);
@@ -1678,8 +1678,8 @@  discard block
 block discarded – undo
1678 1678
 				}
1679 1679
 			}
1680 1680
 		}
1681
-                //also, let's make sure the "ee_config_option_names" wp option stays out by removing the action that adds it
1682
-                remove_action( 'shutdown', array( EE_Config::instance(), 'shutdown' ), 10 );
1681
+				//also, let's make sure the "ee_config_option_names" wp option stays out by removing the action that adds it
1682
+				remove_action( 'shutdown', array( EE_Config::instance(), 'shutdown' ), 10 );
1683 1683
 
1684 1684
 		if ( $remove_all && $espresso_db_update = get_option( 'espresso_db_update' )) {
1685 1685
 			$db_update_sans_ee4 = array();
Please login to merge, or discard this patch.
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		$post_id = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%$shortcode_and_opening_bracket%' LIMIT 1");
465 465
 		if($post_id){
466 466
 			return get_post($post_id);
467
-		}else{
467
+		} else{
468 468
 			return NULL;
469 469
 		}
470 470
 
@@ -836,13 +836,13 @@  discard block
 block discarded – undo
836 836
 					foreach( $current_data_migration_script->get_errors() as $error ){
837 837
 						EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__ );
838 838
 					}
839
-				}else{
839
+				} else{
840 840
 					EE_Error::add_error( __( 'There were errors creating the Event Espresso database tables and Event Espresso has been deactivated. To view the errors, please enable WP_DEBUG in your wp-config.php file.', 'event_espresso' ) );
841 841
 				}
842 842
 				return false;
843 843
 			}
844 844
 			EE_Data_Migration_Manager::instance()->update_current_database_state_to();
845
-		}else{
845
+		} else{
846 846
 			EE_Error::add_error( __( 'Could not determine most up-to-date data migration script from which to pull database schema structure. So database is probably not setup properly', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
847 847
 			return false;
848 848
 		}
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 		if( ! EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart ) ){
1173 1173
 			EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
1174 1174
 			EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( 'Invoice' );
1175
-		}else{
1175
+		} else{
1176 1176
 			EEM_Payment_Method::instance()->verify_button_urls();
1177 1177
 		}
1178 1178
 	}
@@ -1679,7 +1679,7 @@  discard block
 block discarded – undo
1679 1679
 				if( ! delete_option( $option_name ) ){
1680 1680
 					$undeleted_options[] = $option_name;
1681 1681
 				}
1682
-			}else{
1682
+			} else{
1683 1683
 				$option_names_to_delete_from_wildcard = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE '%$option_name%'" );
1684 1684
 				foreach($option_names_to_delete_from_wildcard as $option_name_from_wildcard ){
1685 1685
 					if( ! delete_option( $option_name_from_wildcard ) ){
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
 		$EZSQL_ERROR = $ezsql_error_cache;
1746 1746
 		if( empty( $new_error ) ){
1747 1747
 			return TRUE;
1748
-		}else{
1748
+		} else{
1749 1749
 			return FALSE;
1750 1750
 		}
1751 1751
 	}
Please login to merge, or discard this patch.
Spacing   +341 added lines, -341 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');}
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); }
2 2
 /**
3 3
  * EEH_Activation Helper
4 4
  *
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	 * @param $table_name
49 49
 	 * @return string
50 50
 	 */
51
-	public static function ensure_table_name_has_prefix( $table_name ) {
51
+	public static function ensure_table_name_has_prefix($table_name) {
52 52
 		global $wpdb;
53
-		return strpos( $table_name, $wpdb->prefix ) === 0 ? $table_name : $wpdb->prefix . $table_name;
53
+		return strpos($table_name, $wpdb->prefix) === 0 ? $table_name : $wpdb->prefix.$table_name;
54 54
 	}
55 55
 
56 56
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @return boolean success, whether the database and folders are setup properly
79 79
 	 * @throws \EE_Error
80 80
 	 */
81
-	public static function initialize_db_and_folders(){
81
+	public static function initialize_db_and_folders() {
82 82
 		$good_filesystem = EEH_Activation::create_upload_directories();
83 83
 		$good_db = EEH_Activation::create_database_tables();
84 84
 		return $good_filesystem && $good_db;
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
 	 *
95 95
 	 * @throws \EE_Error
96 96
 	 */
97
-	public static function initialize_db_content(){
97
+	public static function initialize_db_content() {
98 98
 		//let's avoid doing all this logic repeatedly, especially when addons are requesting it
99
-		if( EEH_Activation::$_initialized_db_content_already_in_this_request ) {
99
+		if (EEH_Activation::$_initialized_db_content_already_in_this_request) {
100 100
 			return;
101 101
 		}
102 102
 		EEH_Activation::$_initialized_db_content_already_in_this_request = true;
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 		EEH_Activation::remove_cron_tasks();
114 114
 		EEH_Activation::create_cron_tasks();
115 115
 		// remove all TXN locks since that is being done via extra meta now
116
-		delete_option( 'ee_locked_transactions' );
116
+		delete_option('ee_locked_transactions');
117 117
 		//also, check for CAF default db content
118
-		do_action( 'AHEE__EEH_Activation__initialize_db_content' );
118
+		do_action('AHEE__EEH_Activation__initialize_db_content');
119 119
 		//also: EEM_Gateways::load_all_gateways() outputs a lot of success messages
120 120
 		//which users really won't care about on initial activation
121 121
 		EE_Error::overwrite_success();
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 * @return array
136 136
 	 * @throws \EE_Error
137 137
 	 */
138
-	public static function get_cron_tasks( $which_to_include ) {
138
+	public static function get_cron_tasks($which_to_include) {
139 139
 		$cron_tasks = apply_filters(
140 140
 			'FHEE__EEH_Activation__get_cron_tasks',
141 141
 			array(
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
 				'AHEE__EE_Cron_Tasks__update_transaction_with_payment' => EEH_Activation::cron_task_no_longer_in_use, //there may have been a bug which prevented from these cron tasks from getting unscheduled, so we might want to remove these for a few updates
145 145
 			)
146 146
 		);
147
-		if ( $which_to_include === 'old' ) {
147
+		if ($which_to_include === 'old') {
148 148
 			$cron_tasks = array_filter(
149 149
 				$cron_tasks,
150
-				function ( $value ) {
150
+				function($value) {
151 151
 					return $value === EEH_Activation::cron_task_no_longer_in_use;
152 152
 				}
153 153
 			);
154
-		} elseif ( $which_to_include === 'current' ) {
155
-			$cron_tasks = array_filter( $cron_tasks );
156
-		} elseif ( WP_DEBUG && $which_to_include !== 'all' ) {
154
+		} elseif ($which_to_include === 'current') {
155
+			$cron_tasks = array_filter($cron_tasks);
156
+		} elseif (WP_DEBUG && $which_to_include !== 'all') {
157 157
 			throw new EE_Error(
158 158
 				sprintf(
159 159
 					__(
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public static function create_cron_tasks() {
178 178
 
179
-		foreach( EEH_Activation::get_cron_tasks( 'current' ) as $hook_name => $frequency ) {
180
-			if( ! wp_next_scheduled( $hook_name ) ) {
181
-				wp_schedule_event( time(), $frequency, $hook_name );
179
+		foreach (EEH_Activation::get_cron_tasks('current') as $hook_name => $frequency) {
180
+			if ( ! wp_next_scheduled($hook_name)) {
181
+				wp_schedule_event(time(), $frequency, $hook_name);
182 182
 			}
183 183
 		}
184 184
 
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
 	 * @param boolean $remove_all whether to only remove the old ones, or remove absolutely ALL the EE ones
193 193
 	 * @throws \EE_Error
194 194
 	 */
195
-	public static function remove_cron_tasks( $remove_all = true ) {
195
+	public static function remove_cron_tasks($remove_all = true) {
196 196
 		$cron_tasks_to_remove = $remove_all ? 'all' : 'old';
197 197
 		$crons = _get_cron_array();
198
-		$crons = is_array( $crons ) ? $crons : array();
198
+		$crons = is_array($crons) ? $crons : array();
199 199
 		/* reminder of what $crons look like:
200 200
 		 * Top-level keys are timestamps, and their values are arrays.
201 201
 		 * The 2nd level arrays have keys with each of the cron task hook names to run at that time
@@ -213,23 +213,23 @@  discard block
 block discarded – undo
213 213
 		 *					...
214 214
 		 *      ...
215 215
 		 */
216
-		$ee_cron_tasks_to_remove = EEH_Activation::get_cron_tasks( $cron_tasks_to_remove );
217
-		foreach ( $crons as $timestamp => $hooks_to_fire_at_time ) {
218
-			if ( is_array( $hooks_to_fire_at_time ) ) {
219
-				foreach ( $hooks_to_fire_at_time as $hook_name => $hook_actions ) {
220
-					if ( isset( $ee_cron_tasks_to_remove[ $hook_name ] )
221
-					     && is_array( $ee_cron_tasks_to_remove[ $hook_name ] )
216
+		$ee_cron_tasks_to_remove = EEH_Activation::get_cron_tasks($cron_tasks_to_remove);
217
+		foreach ($crons as $timestamp => $hooks_to_fire_at_time) {
218
+			if (is_array($hooks_to_fire_at_time)) {
219
+				foreach ($hooks_to_fire_at_time as $hook_name => $hook_actions) {
220
+					if (isset($ee_cron_tasks_to_remove[$hook_name])
221
+					     && is_array($ee_cron_tasks_to_remove[$hook_name])
222 222
 					) {
223
-						unset( $crons[ $timestamp ][ $hook_name ] );
223
+						unset($crons[$timestamp][$hook_name]);
224 224
 					}
225 225
 				}
226 226
 				//also take care of any empty cron timestamps.
227
-				if ( empty( $hooks_to_fire_at_time ) ) {
228
-					unset( $crons[ $timestamp ] );
227
+				if (empty($hooks_to_fire_at_time)) {
228
+					unset($crons[$timestamp]);
229 229
 				}
230 230
 			}
231 231
 		}
232
-		_set_cron_array( $crons );
232
+		_set_cron_array($crons);
233 233
 	}
234 234
 
235 235
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	public static function CPT_initialization() {
246 246
 		// register Custom Post Types
247
-		EE_Registry::instance()->load_core( 'Register_CPTs' );
247
+		EE_Registry::instance()->load_core('Register_CPTs');
248 248
 		flush_rewrite_rules();
249 249
 	}
250 250
 
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 	 * 	@return void
263 263
 	 */
264 264
 	public static function reset_and_update_config() {
265
-		do_action( 'AHEE__EE_Config___load_core_config__start', array( 'EEH_Activation', 'load_calendar_config' ) );
266
-		add_filter( 'FHEE__EE_Config___load_core_config__config_settings', array( 'EEH_Activation', 'migrate_old_config_data' ), 10, 3 );
265
+		do_action('AHEE__EE_Config___load_core_config__start', array('EEH_Activation', 'load_calendar_config'));
266
+		add_filter('FHEE__EE_Config___load_core_config__config_settings', array('EEH_Activation', 'migrate_old_config_data'), 10, 3);
267 267
 		//EE_Config::reset();
268 268
 	}
269 269
 
@@ -276,28 +276,28 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	public static function load_calendar_config() {
278 278
 		// grab array of all plugin folders and loop thru it
279
-		$plugins = glob( WP_PLUGIN_DIR . DS . '*', GLOB_ONLYDIR );
280
-		if ( empty( $plugins ) ) {
279
+		$plugins = glob(WP_PLUGIN_DIR.DS.'*', GLOB_ONLYDIR);
280
+		if (empty($plugins)) {
281 281
 			return;
282 282
 		}
283
-		foreach ( $plugins as $plugin_path ) {
283
+		foreach ($plugins as $plugin_path) {
284 284
 			// grab plugin folder name from path
285
-			$plugin = basename( $plugin_path );
285
+			$plugin = basename($plugin_path);
286 286
 			// drill down to Espresso plugins
287 287
 			// then to calendar related plugins
288 288
 			if (
289
-				strpos( $plugin, 'espresso' ) !== FALSE
290
-				|| strpos( $plugin, 'Espresso' ) !== FALSE
291
-				|| strpos( $plugin, 'ee4' ) !== FALSE
292
-				|| strpos( $plugin, 'EE4' ) !== FALSE
293
-				|| strpos( $plugin, 'calendar' ) !== false
289
+				strpos($plugin, 'espresso') !== FALSE
290
+				|| strpos($plugin, 'Espresso') !== FALSE
291
+				|| strpos($plugin, 'ee4') !== FALSE
292
+				|| strpos($plugin, 'EE4') !== FALSE
293
+				|| strpos($plugin, 'calendar') !== false
294 294
 			) {
295 295
 				// this is what we are looking for
296
-				$calendar_config = $plugin_path . DS . 'EE_Calendar_Config.php';
296
+				$calendar_config = $plugin_path.DS.'EE_Calendar_Config.php';
297 297
 				// does it exist in this folder ?
298
-				if ( is_readable( $calendar_config )) {
298
+				if (is_readable($calendar_config)) {
299 299
 					// YEAH! let's load it
300
-					require_once( $calendar_config );
300
+					require_once($calendar_config);
301 301
 				}
302 302
 			}
303 303
 		}
@@ -313,21 +313,21 @@  discard block
 block discarded – undo
313 313
 	 * @param \EE_Config     $EE_Config
314 314
 	 * @return \stdClass
315 315
 	 */
316
-	public static function migrate_old_config_data( $settings = array(), $config = '', EE_Config $EE_Config ) {
317
-		$convert_from_array = array( 'addons' );
316
+	public static function migrate_old_config_data($settings = array(), $config = '', EE_Config $EE_Config) {
317
+		$convert_from_array = array('addons');
318 318
 		// in case old settings were saved as an array
319
-		if ( is_array( $settings ) && in_array( $config, $convert_from_array )) {
319
+		if (is_array($settings) && in_array($config, $convert_from_array)) {
320 320
 			// convert existing settings to an object
321 321
 			$config_array = $settings;
322 322
 			$settings = new stdClass();
323
-			foreach ( $config_array as $key => $value ){
324
-				if ( $key === 'calendar' && class_exists( 'EE_Calendar_Config' )) {
325
-					$EE_Config->set_config( 'addons', 'EE_Calendar', 'EE_Calendar_Config', $value );
323
+			foreach ($config_array as $key => $value) {
324
+				if ($key === 'calendar' && class_exists('EE_Calendar_Config')) {
325
+					$EE_Config->set_config('addons', 'EE_Calendar', 'EE_Calendar_Config', $value);
326 326
 				} else {
327 327
 					$settings->{$key} = $value;
328 328
 				}
329 329
 			}
330
-			add_filter( 'FHEE__EE_Config___load_core_config__update_espresso_config', '__return_true' );
330
+			add_filter('FHEE__EE_Config___load_core_config__update_espresso_config', '__return_true');
331 331
 		}
332 332
 		return $settings;
333 333
 	}
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	public static function deactivate_event_espresso() {
345 345
 		// check permissions
346
-		if ( current_user_can( 'activate_plugins' )) {
347
-			deactivate_plugins( EE_PLUGIN_BASENAME, TRUE );
346
+		if (current_user_can('activate_plugins')) {
347
+			deactivate_plugins(EE_PLUGIN_BASENAME, TRUE);
348 348
 		}
349 349
 	}
350 350
 
@@ -366,25 +366,25 @@  discard block
 block discarded – undo
366 366
 		$critical_pages = array(
367 367
 			array(
368 368
 				'id' =>'reg_page_id',
369
-				'name' => __( 'Registration Checkout', 'event_espresso' ),
369
+				'name' => __('Registration Checkout', 'event_espresso'),
370 370
 				'post' => NULL,
371 371
 				'code' => 'ESPRESSO_CHECKOUT'
372 372
 			),
373 373
 			array(
374 374
 				'id' => 'txn_page_id',
375
-				'name' => __( 'Transactions', 'event_espresso' ),
375
+				'name' => __('Transactions', 'event_espresso'),
376 376
 				'post' => NULL,
377 377
 				'code' => 'ESPRESSO_TXN_PAGE'
378 378
 			),
379 379
 			array(
380 380
 				'id' => 'thank_you_page_id',
381
-				'name' => __( 'Thank You', 'event_espresso' ),
381
+				'name' => __('Thank You', 'event_espresso'),
382 382
 				'post' => NULL,
383 383
 				'code' => 'ESPRESSO_THANK_YOU'
384 384
 			),
385 385
 			array(
386 386
 				'id' => 'cancel_page_id',
387
-				'name' => __( 'Registration Cancelled', 'event_espresso' ),
387
+				'name' => __('Registration Cancelled', 'event_espresso'),
388 388
 				'post' => NULL,
389 389
 				'code' => 'ESPRESSO_CANCELLED'
390 390
 			),
@@ -392,62 +392,62 @@  discard block
 block discarded – undo
392 392
 
393 393
 		$EE_Core_Config = EE_Registry::instance()->CFG->core;
394 394
 
395
-		foreach ( $critical_pages as $critical_page ) {
395
+		foreach ($critical_pages as $critical_page) {
396 396
 			// is critical page ID set in config ?
397
-			if ( $EE_Core_Config->{$critical_page[ 'id' ]} !== FALSE ) {
397
+			if ($EE_Core_Config->{$critical_page['id']} !== FALSE) {
398 398
 				// attempt to find post by ID
399
-				$critical_page['post'] = get_post( $EE_Core_Config->{$critical_page[ 'id' ]} );
399
+				$critical_page['post'] = get_post($EE_Core_Config->{$critical_page['id']} );
400 400
 			}
401 401
 			// no dice?
402
-			if ( $critical_page['post'] === null ) {
402
+			if ($critical_page['post'] === null) {
403 403
 				// attempt to find post by title
404
-				$critical_page['post'] = self::get_page_by_ee_shortcode( $critical_page['code'] );
404
+				$critical_page['post'] = self::get_page_by_ee_shortcode($critical_page['code']);
405 405
 				// still nothing?
406
-				if ( $critical_page['post'] === null ) {
407
-					$critical_page = EEH_Activation::create_critical_page( $critical_page );
406
+				if ($critical_page['post'] === null) {
407
+					$critical_page = EEH_Activation::create_critical_page($critical_page);
408 408
 					// REALLY? Still nothing ??!?!?
409
-					if ( $critical_page['post'] === null ) {
410
-						$msg = __( 'The Event Espresso critical page configuration settings could not be updated.', 'event_espresso' );
411
-						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
409
+					if ($critical_page['post'] === null) {
410
+						$msg = __('The Event Espresso critical page configuration settings could not be updated.', 'event_espresso');
411
+						EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
412 412
 						break;
413 413
 					}
414 414
 				}
415 415
 			}
416 416
 			// track post_shortcodes
417
-			if ( $critical_page['post'] ) {
418
-				EEH_Activation::_track_critical_page_post_shortcodes( $critical_page );
417
+			if ($critical_page['post']) {
418
+				EEH_Activation::_track_critical_page_post_shortcodes($critical_page);
419 419
 			}
420 420
 			// check that Post ID matches critical page ID in config
421 421
 			if (
422
-				isset( $critical_page['post']->ID )
423
-				&& $critical_page['post']->ID !== $EE_Core_Config->{$critical_page[ 'id' ]}
422
+				isset($critical_page['post']->ID)
423
+				&& $critical_page['post']->ID !== $EE_Core_Config->{$critical_page['id']}
424 424
 			) {
425 425
 				//update Config with post ID
426
-				$EE_Core_Config->{$critical_page[ 'id' ]} = $critical_page['post']->ID;
427
-				if ( ! EE_Config::instance()->update_espresso_config( FALSE, FALSE ) ) {
428
-					$msg = __( 'The Event Espresso critical page configuration settings could not be updated.', 'event_espresso' );
429
-					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
426
+				$EE_Core_Config->{$critical_page['id']} = $critical_page['post']->ID;
427
+				if ( ! EE_Config::instance()->update_espresso_config(FALSE, FALSE)) {
428
+					$msg = __('The Event Espresso critical page configuration settings could not be updated.', 'event_espresso');
429
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
430 430
 				}
431 431
 			}
432 432
 
433 433
 			$critical_page_problem =
434
-				! isset( $critical_page['post']->post_status )
434
+				! isset($critical_page['post']->post_status)
435 435
 				|| $critical_page['post']->post_status !== 'publish'
436
-				|| strpos( $critical_page['post']->post_content, $critical_page['code'] ) === FALSE
436
+				|| strpos($critical_page['post']->post_content, $critical_page['code']) === FALSE
437 437
 					? TRUE
438 438
 					: $critical_page_problem;
439 439
 
440 440
 		}
441 441
 
442
-		if ( $critical_page_problem ) {
442
+		if ($critical_page_problem) {
443 443
 			$msg = sprintf(
444
-				__('A potential issue has been detected with one or more of your Event Espresso pages. Go to %s to view your Event Espresso pages.', 'event_espresso' ),
445
-				'<a href="' . admin_url('admin.php?page=espresso_general_settings&action=critical_pages') . '">' . __('Event Espresso Critical Pages Settings', 'event_espresso') . '</a>'
444
+				__('A potential issue has been detected with one or more of your Event Espresso pages. Go to %s to view your Event Espresso pages.', 'event_espresso'),
445
+				'<a href="'.admin_url('admin.php?page=espresso_general_settings&action=critical_pages').'">'.__('Event Espresso Critical Pages Settings', 'event_espresso').'</a>'
446 446
 			);
447
-			EE_Error::add_persistent_admin_notice( 'critical_page_problem', $msg );
447
+			EE_Error::add_persistent_admin_notice('critical_page_problem', $msg);
448 448
 		}
449
-		if ( EE_Error::has_notices() ) {
450
-			EE_Error::get_notices( FALSE, TRUE, TRUE );
449
+		if (EE_Error::has_notices()) {
450
+			EE_Error::get_notices(FALSE, TRUE, TRUE);
451 451
 		}
452 452
 	}
453 453
 
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
 	 * parameter to the shortcode
460 460
 	 * @return WP_Post or NULl
461 461
 	 */
462
-	public static function get_page_by_ee_shortcode($ee_shortcode){
462
+	public static function get_page_by_ee_shortcode($ee_shortcode) {
463 463
 		global $wpdb;
464 464
 		$shortcode_and_opening_bracket = '['.$ee_shortcode;
465 465
 		$post_id = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%$shortcode_and_opening_bracket%' LIMIT 1");
466
-		if($post_id){
466
+		if ($post_id) {
467 467
 			return get_post($post_id);
468
-		}else{
468
+		} else {
469 469
 			return NULL;
470 470
 		}
471 471
 
@@ -482,32 +482,32 @@  discard block
 block discarded – undo
482 482
 	 * @param array $critical_page
483 483
 	 * @return array
484 484
 	 */
485
-	public static function create_critical_page( $critical_page ) {
485
+	public static function create_critical_page($critical_page) {
486 486
 
487 487
 		$post_args = array(
488 488
 			'post_title' => $critical_page['name'],
489 489
 			'post_status' => 'publish',
490 490
 			'post_type' => 'page',
491 491
 			'comment_status' => 'closed',
492
-			'post_content' => '[' . $critical_page['code'] . ']'
492
+			'post_content' => '['.$critical_page['code'].']'
493 493
 		);
494 494
 
495
-		$post_id = wp_insert_post( $post_args );
496
-		if ( ! $post_id ) {
495
+		$post_id = wp_insert_post($post_args);
496
+		if ( ! $post_id) {
497 497
 			$msg = sprintf(
498
-				__( 'The Event Espresso  critical page entitled "%s" could not be created.', 'event_espresso' ),
498
+				__('The Event Espresso  critical page entitled "%s" could not be created.', 'event_espresso'),
499 499
 				$critical_page['name']
500 500
 			);
501
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
501
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
502 502
 			return $critical_page;
503 503
 		}
504 504
 		// get newly created post's details
505
-		if ( ! $critical_page['post'] = get_post( $post_id )) {
505
+		if ( ! $critical_page['post'] = get_post($post_id)) {
506 506
 			$msg = sprintf(
507
-				__( 'The Event Espresso critical page entitled "%s" could not be retrieved.', 'event_espresso' ),
507
+				__('The Event Espresso critical page entitled "%s" could not be retrieved.', 'event_espresso'),
508 508
 				$critical_page['name']
509 509
 			);
510
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
510
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
511 511
 		}
512 512
 
513 513
 		return $critical_page;
@@ -526,35 +526,35 @@  discard block
 block discarded – undo
526 526
 	 * @param array $critical_page
527 527
 	 * @return void
528 528
 	 */
529
-	private static function _track_critical_page_post_shortcodes( $critical_page = array() ) {
529
+	private static function _track_critical_page_post_shortcodes($critical_page = array()) {
530 530
 		// check the goods
531
-		if ( ! $critical_page['post'] instanceof WP_Post ) {
531
+		if ( ! $critical_page['post'] instanceof WP_Post) {
532 532
 			$msg = sprintf(
533
-				__( 'The Event Espresso critical page shortcode for the page %s can not be tracked because it is not a WP_Post object.', 'event_espresso' ),
533
+				__('The Event Espresso critical page shortcode for the page %s can not be tracked because it is not a WP_Post object.', 'event_espresso'),
534 534
 				$critical_page['name']
535 535
 			);
536
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
536
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
537 537
 			return;
538 538
 		}
539 539
 		$EE_Core_Config = EE_Registry::instance()->CFG->core;
540 540
 		// map shortcode to post
541
-		$EE_Core_Config->post_shortcodes[ $critical_page['post']->post_name ][ $critical_page['code'] ] = $critical_page['post']->ID;
541
+		$EE_Core_Config->post_shortcodes[$critical_page['post']->post_name][$critical_page['code']] = $critical_page['post']->ID;
542 542
 		// and make sure it's NOT added to the WP "Posts Page"
543 543
 		// name of the WP Posts Page
544 544
 		$posts_page = EE_Config::get_page_for_posts();
545
-		if ( isset( $EE_Core_Config->post_shortcodes[ $posts_page ] )) {
546
-			unset( $EE_Core_Config->post_shortcodes[ $posts_page ][ $critical_page['code'] ] );
545
+		if (isset($EE_Core_Config->post_shortcodes[$posts_page])) {
546
+			unset($EE_Core_Config->post_shortcodes[$posts_page][$critical_page['code']]);
547 547
 		}
548
-		if ( $posts_page !== 'posts' && isset( $EE_Core_Config->post_shortcodes['posts'] )) {
549
-			unset( $EE_Core_Config->post_shortcodes['posts'][ $critical_page['code'] ] );
548
+		if ($posts_page !== 'posts' && isset($EE_Core_Config->post_shortcodes['posts'])) {
549
+			unset($EE_Core_Config->post_shortcodes['posts'][$critical_page['code']]);
550 550
 		}
551 551
 		// update post_shortcode CFG
552
-		if ( ! EE_Config::instance()->update_espresso_config( FALSE, FALSE )) {
552
+		if ( ! EE_Config::instance()->update_espresso_config(FALSE, FALSE)) {
553 553
 			$msg = sprintf(
554
-				__( 'The Event Espresso critical page shortcode for the %s page could not be configured properly.', 'event_espresso' ),
554
+				__('The Event Espresso critical page shortcode for the %s page could not be configured properly.', 'event_espresso'),
555 555
 				$critical_page['name']
556 556
 			);
557
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
557
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
558 558
 		}
559 559
 	}
560 560
 
@@ -572,24 +572,24 @@  discard block
 block discarded – undo
572 572
 	public static function get_default_creator_id() {
573 573
 		global $wpdb;
574 574
 
575
-		if ( ! empty( self::$_default_creator_id ) ) {
575
+		if ( ! empty(self::$_default_creator_id)) {
576 576
 			return self::$_default_creator_id;
577 577
 		}/**/
578 578
 
579
-		$role_to_check = apply_filters( 'FHEE__EEH_Activation__get_default_creator_id__role_to_check', 'administrator' );
579
+		$role_to_check = apply_filters('FHEE__EEH_Activation__get_default_creator_id__role_to_check', 'administrator');
580 580
 
581 581
 		//let's allow pre_filtering for early exits by alternative methods for getting id.  We check for truthy result and if so then exit early.
582
-		$pre_filtered_id = apply_filters( 'FHEE__EEH_Activation__get_default_creator_id__pre_filtered_id', false, $role_to_check );
583
-		if ( $pre_filtered_id !== false ) {
582
+		$pre_filtered_id = apply_filters('FHEE__EEH_Activation__get_default_creator_id__pre_filtered_id', false, $role_to_check);
583
+		if ($pre_filtered_id !== false) {
584 584
 			return (int) $pre_filtered_id;
585 585
 		}
586 586
 
587
-		$capabilities_key = EEH_Activation::ensure_table_name_has_prefix( 'capabilities' );
588
-		$query = $wpdb->prepare( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$capabilities_key' AND meta_value LIKE %s ORDER BY user_id ASC LIMIT 0,1", '%' . $role_to_check . '%' );
589
-		$user_id = $wpdb->get_var( $query );
590
-		 $user_id = apply_filters( 'FHEE__EEH_Activation_Helper__get_default_creator_id__user_id', $user_id );
591
-		 if ( $user_id && (int)$user_id ) {
592
-		 	self::$_default_creator_id = (int)$user_id;
587
+		$capabilities_key = EEH_Activation::ensure_table_name_has_prefix('capabilities');
588
+		$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$capabilities_key' AND meta_value LIKE %s ORDER BY user_id ASC LIMIT 0,1", '%'.$role_to_check.'%');
589
+		$user_id = $wpdb->get_var($query);
590
+		 $user_id = apply_filters('FHEE__EEH_Activation_Helper__get_default_creator_id__user_id', $user_id);
591
+		 if ($user_id && (int) $user_id) {
592
+		 	self::$_default_creator_id = (int) $user_id;
593 593
 		 	return self::$_default_creator_id;
594 594
 		 } else {
595 595
 		 	return NULL;
@@ -616,29 +616,29 @@  discard block
 block discarded – undo
616 616
 	 * 	@return void
617 617
 	 * @throws EE_Error if there are database errors
618 618
 	 */
619
-	public static function create_table( $table_name, $sql, $engine = 'ENGINE=MyISAM ', $drop_pre_existing_table = false ) {
620
-		if( apply_filters( 'FHEE__EEH_Activation__create_table__short_circuit', FALSE, $table_name, $sql ) ){
619
+	public static function create_table($table_name, $sql, $engine = 'ENGINE=MyISAM ', $drop_pre_existing_table = false) {
620
+		if (apply_filters('FHEE__EEH_Activation__create_table__short_circuit', FALSE, $table_name, $sql)) {
621 621
 			return;
622 622
 		}
623
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
624
-		if ( ! function_exists( 'dbDelta' )) {
625
-			require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
623
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
624
+		if ( ! function_exists('dbDelta')) {
625
+			require_once(ABSPATH.'wp-admin/includes/upgrade.php');
626 626
 		}
627 627
 		/** @var WPDB $wpdb */
628 628
 		global $wpdb;
629
-		$wp_table_name = EEH_Activation::ensure_table_name_has_prefix( $table_name );
629
+		$wp_table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
630 630
 		// do we need to first delete an existing version of this table ?
631
-		if ( $drop_pre_existing_table && EEH_Activation::table_exists( $wp_table_name ) ){
631
+		if ($drop_pre_existing_table && EEH_Activation::table_exists($wp_table_name)) {
632 632
 			// ok, delete the table... but ONLY if it's empty
633
-			$deleted_safely = EEH_Activation::delete_db_table_if_empty( $wp_table_name );
633
+			$deleted_safely = EEH_Activation::delete_db_table_if_empty($wp_table_name);
634 634
 			// table is NOT empty, are you SURE you want to delete this table ???
635
-			if ( ! $deleted_safely && defined( 'EE_DROP_BAD_TABLES' ) && EE_DROP_BAD_TABLES ){
636
-				EEH_Activation::delete_unused_db_table( $wp_table_name );
637
-			} else if ( ! $deleted_safely ) {
635
+			if ( ! $deleted_safely && defined('EE_DROP_BAD_TABLES') && EE_DROP_BAD_TABLES) {
636
+				EEH_Activation::delete_unused_db_table($wp_table_name);
637
+			} else if ( ! $deleted_safely) {
638 638
 				// so we should be more cautious rather than just dropping tables so easily
639 639
 				EE_Error::add_persistent_admin_notice(
640
-						'bad_table_' . $wp_table_name . '_detected',
641
-						sprintf( __( 'Database table %1$s exists when it shouldn\'t, and may contain erroneous data. If you have previously restored your database from a backup that didn\'t remove the old tables, then we recommend adding %2$s to your %3$s file then restore to that backup again. This will clear out the invalid data from %1$s. Afterwards you should undo that change from your %3$s file. %4$sIf you cannot edit %3$s, you should remove the data from %1$s manually then restore to the backup again.', 'event_espresso' ),
640
+						'bad_table_'.$wp_table_name.'_detected',
641
+						sprintf(__('Database table %1$s exists when it shouldn\'t, and may contain erroneous data. If you have previously restored your database from a backup that didn\'t remove the old tables, then we recommend adding %2$s to your %3$s file then restore to that backup again. This will clear out the invalid data from %1$s. Afterwards you should undo that change from your %3$s file. %4$sIf you cannot edit %3$s, you should remove the data from %1$s manually then restore to the backup again.', 'event_espresso'),
642 642
 								$wp_table_name,
643 643
 								"<pre>define( 'EE_DROP_BAD_TABLES', TRUE );</pre>",
644 644
 								'<b>wp-config.php</b>',
@@ -647,25 +647,25 @@  discard block
 block discarded – undo
647 647
 			}
648 648
 		}
649 649
 		// does $sql contain valid column information? ( LPT: https://regex101.com/ is great for working out regex patterns )
650
-		if ( preg_match( '((((.*?))(,\s))+)', $sql, $valid_column_data ) ) {
650
+		if (preg_match('((((.*?))(,\s))+)', $sql, $valid_column_data)) {
651 651
 			$SQL = "CREATE TABLE $wp_table_name ( $sql ) $engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;";
652 652
 			//get $wpdb to echo errors, but buffer them. This way at least WE know an error
653 653
 			//happened. And then we can choose to tell the end user
654
-			$old_show_errors_policy = $wpdb->show_errors( TRUE );
655
-			$old_error_suppression_policy = $wpdb->suppress_errors( FALSE );
654
+			$old_show_errors_policy = $wpdb->show_errors(TRUE);
655
+			$old_error_suppression_policy = $wpdb->suppress_errors(FALSE);
656 656
 			ob_start();
657
-			dbDelta( $SQL );
657
+			dbDelta($SQL);
658 658
 			$output = ob_get_contents();
659 659
 			ob_end_clean();
660
-			$wpdb->show_errors( $old_show_errors_policy );
661
-			$wpdb->suppress_errors( $old_error_suppression_policy );
662
-			if( ! empty( $output ) ){
663
-				throw new EE_Error( $output	);
660
+			$wpdb->show_errors($old_show_errors_policy);
661
+			$wpdb->suppress_errors($old_error_suppression_policy);
662
+			if ( ! empty($output)) {
663
+				throw new EE_Error($output);
664 664
 			}
665 665
 		} else {
666 666
 			throw new EE_Error(
667 667
 				sprintf(
668
-					__( 'The following table creation SQL does not contain valid information about the table columns: %1$s %2$s', 'event_espresso' ),
668
+					__('The following table creation SQL does not contain valid information about the table columns: %1$s %2$s', 'event_espresso'),
669 669
 					'<br />',
670 670
 					$sql
671 671
 				)
@@ -688,15 +688,15 @@  discard block
 block discarded – undo
688 688
 	 *                            'VARCHAR(10)'
689 689
 	 * @return bool|int
690 690
 	 */
691
-	public static function add_column_if_it_doesnt_exist($table_name,$column_name,$column_info='INT UNSIGNED NOT NULL'){
692
-		if( apply_filters( 'FHEE__EEH_Activation__add_column_if_it_doesnt_exist__short_circuit', FALSE ) ){
691
+	public static function add_column_if_it_doesnt_exist($table_name, $column_name, $column_info = 'INT UNSIGNED NOT NULL') {
692
+		if (apply_filters('FHEE__EEH_Activation__add_column_if_it_doesnt_exist__short_circuit', FALSE)) {
693 693
 			return FALSE;
694 694
 		}
695 695
 		global $wpdb;
696
-		$full_table_name= EEH_Activation::ensure_table_name_has_prefix( $table_name );
696
+		$full_table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
697 697
 		$fields = self::get_fields_on_table($table_name);
698
-		if (!in_array($column_name, $fields)){
699
-			$alter_query="ALTER TABLE $full_table_name ADD $column_name $column_info";
698
+		if ( ! in_array($column_name, $fields)) {
699
+			$alter_query = "ALTER TABLE $full_table_name ADD $column_name $column_info";
700 700
 			//echo "alter query:$alter_query";
701 701
 			return $wpdb->query($alter_query);
702 702
 		}
@@ -715,14 +715,14 @@  discard block
 block discarded – undo
715 715
 	 * 	@param string $table_name, without prefixed $wpdb->prefix
716 716
 	 * 	@return array of database column names
717 717
 	 */
718
-	public static function get_fields_on_table( $table_name = NULL ) {
718
+	public static function get_fields_on_table($table_name = NULL) {
719 719
 		global $wpdb;
720
-		$table_name= EEH_Activation::ensure_table_name_has_prefix( $table_name );
721
-		if ( ! empty( $table_name )) {
720
+		$table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
721
+		if ( ! empty($table_name)) {
722 722
 			$columns = $wpdb->get_results("SHOW COLUMNS FROM $table_name ");
723 723
 			if ($columns !== FALSE) {
724 724
 				$field_array = array();
725
-				foreach($columns as $column ){
725
+				foreach ($columns as $column) {
726 726
 					$field_array[] = $column->Field;
727 727
 				}
728 728
 				return $field_array;
@@ -741,12 +741,12 @@  discard block
 block discarded – undo
741 741
 	 * @param string $table_name
742 742
 	 * @return bool
743 743
 	 */
744
-	public static function db_table_is_empty( $table_name ) {
744
+	public static function db_table_is_empty($table_name) {
745 745
 		global $wpdb;
746
-		$table_name = EEH_Activation::ensure_table_name_has_prefix( $table_name );
747
-		if ( EEH_Activation::table_exists( $table_name ) ) {
748
-			$count = $wpdb->get_var( "SELECT COUNT(*) FROM $table_name" );
749
-			return absint( $count ) === 0 ? true : false;
746
+		$table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
747
+		if (EEH_Activation::table_exists($table_name)) {
748
+			$count = $wpdb->get_var("SELECT COUNT(*) FROM $table_name");
749
+			return absint($count) === 0 ? true : false;
750 750
 		}
751 751
 		return false;
752 752
 	}
@@ -761,9 +761,9 @@  discard block
 block discarded – undo
761 761
 	 * @param string $table_name
762 762
 	 * @return bool | int
763 763
 	 */
764
-	public static function delete_db_table_if_empty( $table_name ) {
765
-		if ( EEH_Activation::db_table_is_empty( $table_name ) ) {
766
-			return EEH_Activation::delete_unused_db_table( $table_name );
764
+	public static function delete_db_table_if_empty($table_name) {
765
+		if (EEH_Activation::db_table_is_empty($table_name)) {
766
+			return EEH_Activation::delete_unused_db_table($table_name);
767 767
 		}
768 768
 		return false;
769 769
 	}
@@ -778,11 +778,11 @@  discard block
 block discarded – undo
778 778
 	 * @param string $table_name
779 779
 	 * @return bool | int
780 780
 	 */
781
-	public static function delete_unused_db_table( $table_name ) {
781
+	public static function delete_unused_db_table($table_name) {
782 782
 		global $wpdb;
783
-		if ( EEH_Activation::table_exists( $table_name ) ) {
784
-			$table_name = EEH_Activation::ensure_table_name_has_prefix( $table_name );
785
-			return $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
783
+		if (EEH_Activation::table_exists($table_name)) {
784
+			$table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
785
+			return $wpdb->query("DROP TABLE IF EXISTS $table_name");
786 786
 		}
787 787
 		return false;
788 788
 	}
@@ -798,18 +798,18 @@  discard block
 block discarded – undo
798 798
 	 * @param string $index_name
799 799
 	 * @return bool | int
800 800
 	 */
801
-	public static function drop_index( $table_name, $index_name ) {
802
-		if( apply_filters( 'FHEE__EEH_Activation__drop_index__short_circuit', FALSE ) ){
801
+	public static function drop_index($table_name, $index_name) {
802
+		if (apply_filters('FHEE__EEH_Activation__drop_index__short_circuit', FALSE)) {
803 803
 			return FALSE;
804 804
 		}
805 805
 		global $wpdb;
806
-		$table_name = EEH_Activation::ensure_table_name_has_prefix( $table_name );
806
+		$table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
807 807
 		$index_exists_query = "SHOW INDEX FROM $table_name WHERE Key_name = '$index_name'";
808 808
 		if (
809
-			$wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) === $table_name
810
-			&& $wpdb->get_var( $index_exists_query ) === $table_name //using get_var with the $index_exists_query returns the table's name
809
+			$wpdb->get_var("SHOW TABLES LIKE '$table_name'") === $table_name
810
+			&& $wpdb->get_var($index_exists_query) === $table_name //using get_var with the $index_exists_query returns the table's name
811 811
 		) {
812
-			return $wpdb->query( "ALTER TABLE $table_name DROP INDEX $index_name" );
812
+			return $wpdb->query("ALTER TABLE $table_name DROP INDEX $index_name");
813 813
 		}
814 814
 		return TRUE;
815 815
 	}
@@ -825,27 +825,27 @@  discard block
 block discarded – undo
825 825
 	 * @return boolean success (whether database is setup properly or not)
826 826
 	 */
827 827
 	public static function create_database_tables() {
828
-		EE_Registry::instance()->load_core( 'Data_Migration_Manager' );
828
+		EE_Registry::instance()->load_core('Data_Migration_Manager');
829 829
 		//find the migration script that sets the database to be compatible with the code
830 830
 		$dms_name = EE_Data_Migration_Manager::instance()->get_most_up_to_date_dms();
831
-		if( $dms_name ){
832
-			$current_data_migration_script = EE_Registry::instance()->load_dms( $dms_name );
833
-			$current_data_migration_script->set_migrating( false );
831
+		if ($dms_name) {
832
+			$current_data_migration_script = EE_Registry::instance()->load_dms($dms_name);
833
+			$current_data_migration_script->set_migrating(false);
834 834
 			$current_data_migration_script->schema_changes_before_migration();
835 835
 			$current_data_migration_script->schema_changes_after_migration();
836
-			if( $current_data_migration_script->get_errors() ){
837
-				if( WP_DEBUG ){
838
-					foreach( $current_data_migration_script->get_errors() as $error ){
839
-						EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__ );
836
+			if ($current_data_migration_script->get_errors()) {
837
+				if (WP_DEBUG) {
838
+					foreach ($current_data_migration_script->get_errors() as $error) {
839
+						EE_Error::add_error($error, __FILE__, __FUNCTION__, __LINE__);
840 840
 					}
841
-				}else{
842
-					EE_Error::add_error( __( 'There were errors creating the Event Espresso database tables and Event Espresso has been deactivated. To view the errors, please enable WP_DEBUG in your wp-config.php file.', 'event_espresso' ) );
841
+				} else {
842
+					EE_Error::add_error(__('There were errors creating the Event Espresso database tables and Event Espresso has been deactivated. To view the errors, please enable WP_DEBUG in your wp-config.php file.', 'event_espresso'));
843 843
 				}
844 844
 				return false;
845 845
 			}
846 846
 			EE_Data_Migration_Manager::instance()->update_current_database_state_to();
847
-		}else{
848
-			EE_Error::add_error( __( 'Could not determine most up-to-date data migration script from which to pull database schema structure. So database is probably not setup properly', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
847
+		} else {
848
+			EE_Error::add_error(__('Could not determine most up-to-date data migration script from which to pull database schema structure. So database is probably not setup properly', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
849 849
 			return false;
850 850
 		}
851 851
 		return true;
@@ -865,27 +865,27 @@  discard block
 block discarded – undo
865 865
 	public static function initialize_system_questions() {
866 866
 		// QUESTION GROUPS
867 867
 		global $wpdb;
868
-		$table_name = EEH_Activation::ensure_table_name_has_prefix( 'esp_question_group' );
868
+		$table_name = EEH_Activation::ensure_table_name_has_prefix('esp_question_group');
869 869
 		$SQL = "SELECT QSG_system FROM $table_name WHERE QSG_system != 0";
870 870
 		// what we have
871
-		$question_groups = $wpdb->get_col( $SQL );
871
+		$question_groups = $wpdb->get_col($SQL);
872 872
 		// check the response
873
-		$question_groups = is_array( $question_groups ) ? $question_groups : array();
873
+		$question_groups = is_array($question_groups) ? $question_groups : array();
874 874
 		// what we should have
875
-		$QSG_systems = array( 1, 2 );
875
+		$QSG_systems = array(1, 2);
876 876
 		// loop thru what we should have and compare to what we have
877
-		foreach ( $QSG_systems as $QSG_system ) {
877
+		foreach ($QSG_systems as $QSG_system) {
878 878
 			// reset values array
879 879
 			$QSG_values = array();
880 880
 			// if we don't have what we should have (but use $QST_system as as string because that's what we got from the db)
881
-			if ( ! in_array( "$QSG_system", $question_groups )) {
881
+			if ( ! in_array("$QSG_system", $question_groups)) {
882 882
 				// add it
883
-				switch ( $QSG_system ) {
883
+				switch ($QSG_system) {
884 884
 
885 885
 					case 1:
886 886
 							$QSG_values = array(
887
-									'QSG_name' => __( 'Personal Information', 'event_espresso' ),
888
-									'QSG_identifier' => 'personal-information-' . time(),
887
+									'QSG_name' => __('Personal Information', 'event_espresso'),
888
+									'QSG_identifier' => 'personal-information-'.time(),
889 889
 									'QSG_desc' => '',
890 890
 									'QSG_order' => 1,
891 891
 									'QSG_show_group_name' => 1,
@@ -897,8 +897,8 @@  discard block
 block discarded – undo
897 897
 
898 898
 					case 2:
899 899
 							$QSG_values = array(
900
-									'QSG_name' => __( 'Address Information','event_espresso' ),
901
-									'QSG_identifier' => 'address-information-' . time(),
900
+									'QSG_name' => __('Address Information', 'event_espresso'),
901
+									'QSG_identifier' => 'address-information-'.time(),
902 902
 									'QSG_desc' => '',
903 903
 									'QSG_order' => 2,
904 904
 									'QSG_show_group_name' => 1,
@@ -910,14 +910,14 @@  discard block
 block discarded – undo
910 910
 
911 911
 				}
912 912
 				// make sure we have some values before inserting them
913
-				if ( ! empty( $QSG_values )) {
913
+				if ( ! empty($QSG_values)) {
914 914
 					// insert system question
915 915
 					$wpdb->insert(
916 916
 						$table_name,
917 917
 						$QSG_values,
918
-						array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d' )
918
+						array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d')
919 919
 					);
920
-					$QSG_IDs[ $QSG_system ] = $wpdb->insert_id;
920
+					$QSG_IDs[$QSG_system] = $wpdb->insert_id;
921 921
 				}
922 922
 			}
923 923
 		}
@@ -926,10 +926,10 @@  discard block
 block discarded – undo
926 926
 
927 927
 		// QUESTIONS
928 928
 		global $wpdb;
929
-		$table_name = EEH_Activation::ensure_table_name_has_prefix( 'esp_question' );
929
+		$table_name = EEH_Activation::ensure_table_name_has_prefix('esp_question');
930 930
 		$SQL = "SELECT QST_system FROM $table_name WHERE QST_system != ''";
931 931
 		// what we have
932
-		$questions = $wpdb->get_col( $SQL );
932
+		$questions = $wpdb->get_col($SQL);
933 933
 		// what we should have
934 934
 		$QST_systems = array(
935 935
 			'fname',
@@ -946,25 +946,25 @@  discard block
 block discarded – undo
946 946
 		$order_for_group_1 = 1;
947 947
 		$order_for_group_2 = 1;
948 948
 		// loop thru what we should have and compare to what we have
949
-		foreach ( $QST_systems as $QST_system ) {
949
+		foreach ($QST_systems as $QST_system) {
950 950
 			// reset values array
951 951
 			$QST_values = array();
952 952
 			// if we don't have what we should have
953
-			if ( ! in_array( $QST_system, $questions )) {
953
+			if ( ! in_array($QST_system, $questions)) {
954 954
 				// add it
955
-				switch ( $QST_system ) {
955
+				switch ($QST_system) {
956 956
 
957 957
 					case 'fname':
958 958
 							$QST_values = array(
959
-									'QST_display_text' => __( 'First Name', 'event_espresso' ),
960
-									'QST_admin_label' => __( 'First Name - System Question', 'event_espresso' ),
959
+									'QST_display_text' => __('First Name', 'event_espresso'),
960
+									'QST_admin_label' => __('First Name - System Question', 'event_espresso'),
961 961
 									'QST_system' => 'fname',
962 962
 									'QST_type' => 'TEXT',
963 963
 									'QST_required' => 1,
964
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
964
+									'QST_required_text' => __('This field is required', 'event_espresso'),
965 965
 									'QST_order' => 1,
966 966
 									'QST_admin_only' => 0,
967
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
967
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
968 968
 									'QST_wp_user' => self::get_default_creator_id(),
969 969
 									'QST_deleted' => 0
970 970
 								);
@@ -972,15 +972,15 @@  discard block
 block discarded – undo
972 972
 
973 973
 					case 'lname':
974 974
 							$QST_values = array(
975
-									'QST_display_text' => __( 'Last Name', 'event_espresso' ),
976
-									'QST_admin_label' => __( 'Last Name - System Question', 'event_espresso' ),
975
+									'QST_display_text' => __('Last Name', 'event_espresso'),
976
+									'QST_admin_label' => __('Last Name - System Question', 'event_espresso'),
977 977
 									'QST_system' => 'lname',
978 978
 									'QST_type' => 'TEXT',
979 979
 									'QST_required' => 1,
980
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
980
+									'QST_required_text' => __('This field is required', 'event_espresso'),
981 981
 									'QST_order' => 2,
982 982
 									'QST_admin_only' => 0,
983
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
983
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
984 984
 									'QST_wp_user' => self::get_default_creator_id(),
985 985
 									'QST_deleted' => 0
986 986
 								);
@@ -988,15 +988,15 @@  discard block
 block discarded – undo
988 988
 
989 989
 					case 'email':
990 990
 							$QST_values = array(
991
-									'QST_display_text' => __( 'Email Address', 'event_espresso' ),
992
-									'QST_admin_label' => __( 'Email Address - System Question', 'event_espresso' ),
991
+									'QST_display_text' => __('Email Address', 'event_espresso'),
992
+									'QST_admin_label' => __('Email Address - System Question', 'event_espresso'),
993 993
 									'QST_system' => 'email',
994 994
 									'QST_type' => 'EMAIL',
995 995
 									'QST_required' => 1,
996
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
996
+									'QST_required_text' => __('This field is required', 'event_espresso'),
997 997
 									'QST_order' => 3,
998 998
 									'QST_admin_only' => 0,
999
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
999
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1000 1000
 									'QST_wp_user' => self::get_default_creator_id(),
1001 1001
 									'QST_deleted' => 0
1002 1002
 								);
@@ -1004,15 +1004,15 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
 					case 'address':
1006 1006
 							$QST_values = array(
1007
-									'QST_display_text' => __( 'Address', 'event_espresso' ),
1008
-									'QST_admin_label' => __( 'Address - System Question', 'event_espresso' ),
1007
+									'QST_display_text' => __('Address', 'event_espresso'),
1008
+									'QST_admin_label' => __('Address - System Question', 'event_espresso'),
1009 1009
 									'QST_system' => 'address',
1010 1010
 									'QST_type' => 'TEXT',
1011 1011
 									'QST_required' => 0,
1012
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1012
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1013 1013
 									'QST_order' => 4,
1014 1014
 									'QST_admin_only' => 0,
1015
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
1015
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1016 1016
 									'QST_wp_user' => self::get_default_creator_id(),
1017 1017
 									'QST_deleted' => 0
1018 1018
 								);
@@ -1020,15 +1020,15 @@  discard block
 block discarded – undo
1020 1020
 
1021 1021
 					case 'address2':
1022 1022
 							$QST_values = array(
1023
-									'QST_display_text' => __( 'Address2', 'event_espresso' ),
1024
-									'QST_admin_label' => __( 'Address2 - System Question', 'event_espresso' ),
1023
+									'QST_display_text' => __('Address2', 'event_espresso'),
1024
+									'QST_admin_label' => __('Address2 - System Question', 'event_espresso'),
1025 1025
 									'QST_system' => 'address2',
1026 1026
 									'QST_type' => 'TEXT',
1027 1027
 									'QST_required' => 0,
1028
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1028
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1029 1029
 									'QST_order' => 5,
1030 1030
 									'QST_admin_only' => 0,
1031
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
1031
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1032 1032
 									'QST_wp_user' => self::get_default_creator_id(),
1033 1033
 									'QST_deleted' => 0
1034 1034
 								);
@@ -1036,15 +1036,15 @@  discard block
 block discarded – undo
1036 1036
 
1037 1037
 					case 'city':
1038 1038
 							$QST_values = array(
1039
-									'QST_display_text' => __( 'City', 'event_espresso' ),
1040
-									'QST_admin_label' => __( 'City - System Question', 'event_espresso' ),
1039
+									'QST_display_text' => __('City', 'event_espresso'),
1040
+									'QST_admin_label' => __('City - System Question', 'event_espresso'),
1041 1041
 									'QST_system' => 'city',
1042 1042
 									'QST_type' => 'TEXT',
1043 1043
 									'QST_required' => 0,
1044
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1044
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1045 1045
 									'QST_order' => 6,
1046 1046
 									'QST_admin_only' => 0,
1047
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
1047
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1048 1048
 									'QST_wp_user' => self::get_default_creator_id(),
1049 1049
 									'QST_deleted' => 0
1050 1050
 								);
@@ -1052,12 +1052,12 @@  discard block
 block discarded – undo
1052 1052
 
1053 1053
 					case 'state':
1054 1054
 							$QST_values = array(
1055
-									'QST_display_text' => __( 'State/Province', 'event_espresso' ),
1056
-									'QST_admin_label' => __( 'State/Province - System Question', 'event_espresso' ),
1055
+									'QST_display_text' => __('State/Province', 'event_espresso'),
1056
+									'QST_admin_label' => __('State/Province - System Question', 'event_espresso'),
1057 1057
 									'QST_system' => 'state',
1058 1058
 									'QST_type' => 'STATE',
1059 1059
 									'QST_required' => 0,
1060
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1060
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1061 1061
 									'QST_order' => 7,
1062 1062
 									'QST_admin_only' => 0,
1063 1063
 									'QST_wp_user' => self::get_default_creator_id(),
@@ -1067,12 +1067,12 @@  discard block
 block discarded – undo
1067 1067
 
1068 1068
 					case 'country' :
1069 1069
 							$QST_values = array(
1070
-									'QST_display_text' => __( 'Country', 'event_espresso' ),
1071
-									'QST_admin_label' => __( 'Country - System Question', 'event_espresso' ),
1070
+									'QST_display_text' => __('Country', 'event_espresso'),
1071
+									'QST_admin_label' => __('Country - System Question', 'event_espresso'),
1072 1072
 									'QST_system' => 'country',
1073 1073
 									'QST_type' => 'COUNTRY',
1074 1074
 									'QST_required' => 0,
1075
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1075
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1076 1076
 									'QST_order' => 8,
1077 1077
 									'QST_admin_only' => 0,
1078 1078
 									'QST_wp_user' => self::get_default_creator_id(),
@@ -1082,15 +1082,15 @@  discard block
 block discarded – undo
1082 1082
 
1083 1083
 					case 'zip':
1084 1084
 							$QST_values = array(
1085
-									'QST_display_text' => __( 'Zip/Postal Code', 'event_espresso' ),
1086
-									'QST_admin_label' => __( 'Zip/Postal Code - System Question', 'event_espresso' ),
1085
+									'QST_display_text' => __('Zip/Postal Code', 'event_espresso'),
1086
+									'QST_admin_label' => __('Zip/Postal Code - System Question', 'event_espresso'),
1087 1087
 									'QST_system' => 'zip',
1088 1088
 									'QST_type' => 'TEXT',
1089 1089
 									'QST_required' => 0,
1090
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1090
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1091 1091
 									'QST_order' => 9,
1092 1092
 									'QST_admin_only' => 0,
1093
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
1093
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1094 1094
 									'QST_wp_user' => self::get_default_creator_id(),
1095 1095
 									'QST_deleted' => 0
1096 1096
 								);
@@ -1098,49 +1098,49 @@  discard block
 block discarded – undo
1098 1098
 
1099 1099
 					case 'phone':
1100 1100
 							$QST_values = array(
1101
-									'QST_display_text' => __( 'Phone Number', 'event_espresso' ),
1102
-									'QST_admin_label' => __( 'Phone Number - System Question', 'event_espresso' ),
1101
+									'QST_display_text' => __('Phone Number', 'event_espresso'),
1102
+									'QST_admin_label' => __('Phone Number - System Question', 'event_espresso'),
1103 1103
 									'QST_system' => 'phone',
1104 1104
 									'QST_type' => 'TEXT',
1105 1105
 									'QST_required' => 0,
1106
-									'QST_required_text' => __( 'This field is required', 'event_espresso' ),
1106
+									'QST_required_text' => __('This field is required', 'event_espresso'),
1107 1107
 									'QST_order' => 10,
1108 1108
 									'QST_admin_only' => 0,
1109
-									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question( $QST_system ),
1109
+									'QST_max' => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1110 1110
 									'QST_wp_user' => self::get_default_creator_id(),
1111 1111
 									'QST_deleted' => 0
1112 1112
 								);
1113 1113
 						break;
1114 1114
 
1115 1115
 				}
1116
-				if ( ! empty( $QST_values )) {
1116
+				if ( ! empty($QST_values)) {
1117 1117
 					// insert system question
1118 1118
 					$wpdb->insert(
1119 1119
 						$table_name,
1120 1120
 						$QST_values,
1121
-						array( '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d', '%d', '%d' )
1121
+						array('%s', '%s', '%s', '%s', '%d', '%s', '%d', '%d', '%d', '%d')
1122 1122
 					);
1123 1123
 					$QST_ID = $wpdb->insert_id;
1124 1124
 
1125 1125
 					// QUESTION GROUP QUESTIONS
1126
-					if(  in_array( $QST_system, array( 'fname', 'lname', 'email' ) ) ) {
1126
+					if (in_array($QST_system, array('fname', 'lname', 'email'))) {
1127 1127
 						$system_question_we_want = EEM_Question_Group::system_personal;
1128 1128
 					} else {
1129 1129
 						$system_question_we_want = EEM_Question_Group::system_address;
1130 1130
 					}
1131
-					if( isset( $QSG_IDs[ $system_question_we_want ] ) ) {
1132
-						$QSG_ID = $QSG_IDs[ $system_question_we_want ];
1131
+					if (isset($QSG_IDs[$system_question_we_want])) {
1132
+						$QSG_ID = $QSG_IDs[$system_question_we_want];
1133 1133
 					} else {
1134
-						$id_col = EEM_Question_Group::instance()->get_col( array( array( 'QSG_system' => $system_question_we_want ) ) );
1135
-						if( is_array( $id_col ) ) {
1136
-							$QSG_ID = reset( $id_col );
1134
+						$id_col = EEM_Question_Group::instance()->get_col(array(array('QSG_system' => $system_question_we_want)));
1135
+						if (is_array($id_col)) {
1136
+							$QSG_ID = reset($id_col);
1137 1137
 						} else {
1138 1138
 							//ok so we didn't find it in the db either?? that's weird because we should have inserted it at the start of this method
1139 1139
                                                         EE_Log::instance()->log(
1140 1140
                                                                 __FILE__,
1141 1141
                                                                 __FUNCTION__,
1142 1142
                                                                 sprintf(
1143
-                                                                        __( 'Could not associate question %1$s to a question group because no system question group existed', 'event_espresso'),
1143
+                                                                        __('Could not associate question %1$s to a question group because no system question group existed', 'event_espresso'),
1144 1144
                                                                         $QST_ID ),
1145 1145
                                                                 'error' );
1146 1146
                                                         continue;
@@ -1149,12 +1149,12 @@  discard block
 block discarded – undo
1149 1149
 
1150 1150
 					// add system questions to groups
1151 1151
 					$wpdb->insert(
1152
-						EEH_Activation::ensure_table_name_has_prefix( 'esp_question_group_question' ),
1153
-						array( 'QSG_ID'    => $QSG_ID,
1152
+						EEH_Activation::ensure_table_name_has_prefix('esp_question_group_question'),
1153
+						array('QSG_ID'    => $QSG_ID,
1154 1154
 						       'QST_ID'    => $QST_ID,
1155
-						       'QGQ_order' => ( $QSG_ID === 1 ) ? $order_for_group_1++ : $order_for_group_2++
1155
+						       'QGQ_order' => ($QSG_ID === 1) ? $order_for_group_1++ : $order_for_group_2++
1156 1156
 						),
1157
-						array( '%d', '%d', '%d' )
1157
+						array('%d', '%d', '%d')
1158 1158
 					);
1159 1159
 				}
1160 1160
 			}
@@ -1170,11 +1170,11 @@  discard block
 block discarded – undo
1170 1170
 	 *
1171 1171
 	 * @throws \EE_Error
1172 1172
 	 */
1173
-	public static function insert_default_payment_methods(){
1174
-		if( ! EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart ) ){
1175
-			EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
1176
-			EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( 'Invoice' );
1177
-		}else{
1173
+	public static function insert_default_payment_methods() {
1174
+		if ( ! EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart)) {
1175
+			EE_Registry::instance()->load_lib('Payment_Method_Manager');
1176
+			EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type('Invoice');
1177
+		} else {
1178 1178
 			EEM_Payment_Method::instance()->verify_button_urls();
1179 1179
 		}
1180 1180
 	}
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 		global $wpdb;
1192 1192
 
1193
-		if ( EEH_Activation::table_exists( EEM_Status::instance()->table() ) ) {
1193
+		if (EEH_Activation::table_exists(EEM_Status::instance()->table())) {
1194 1194
 
1195 1195
 			$table_name = EEM_Status::instance()->table();
1196 1196
 
@@ -1265,33 +1265,33 @@  discard block
 block discarded – undo
1265 1265
 		$folders = array(
1266 1266
 				EVENT_ESPRESSO_TEMPLATE_DIR,
1267 1267
 				EVENT_ESPRESSO_GATEWAY_DIR,
1268
-				EVENT_ESPRESSO_UPLOAD_DIR . 'logs/',
1269
-				EVENT_ESPRESSO_UPLOAD_DIR . 'css/',
1270
-				EVENT_ESPRESSO_UPLOAD_DIR . 'tickets/'
1268
+				EVENT_ESPRESSO_UPLOAD_DIR.'logs/',
1269
+				EVENT_ESPRESSO_UPLOAD_DIR.'css/',
1270
+				EVENT_ESPRESSO_UPLOAD_DIR.'tickets/'
1271 1271
 		);
1272
-		foreach ( $folders as $folder ) {
1272
+		foreach ($folders as $folder) {
1273 1273
 			try {
1274
-				EEH_File::ensure_folder_exists_and_is_writable( $folder );
1275
-				@ chmod( $folder, 0755 );
1276
-			} catch( EE_Error $e ){
1274
+				EEH_File::ensure_folder_exists_and_is_writable($folder);
1275
+				@ chmod($folder, 0755);
1276
+			} catch (EE_Error $e) {
1277 1277
 				EE_Error::add_error(
1278 1278
 					sprintf(
1279
-						__(  'Could not create the folder at "%1$s" because: %2$s', 'event_espresso' ),
1279
+						__('Could not create the folder at "%1$s" because: %2$s', 'event_espresso'),
1280 1280
 						$folder,
1281
-						'<br />' . $e->getMessage()
1281
+						'<br />'.$e->getMessage()
1282 1282
 					),
1283 1283
 					__FILE__, __FUNCTION__, __LINE__
1284 1284
 				);
1285 1285
 				//indicate we'll need to fix this later
1286
-				update_option( EEH_Activation::upload_directories_incomplete_option_name, true );
1286
+				update_option(EEH_Activation::upload_directories_incomplete_option_name, true);
1287 1287
 				return FALSE;
1288 1288
 			}
1289 1289
 		}
1290 1290
 		//just add the .htaccess file to the logs directory to begin with. Even if logging
1291 1291
 		//is disabled, there might be activation errors recorded in there
1292
-		EEH_File::add_htaccess_deny_from_all( EVENT_ESPRESSO_UPLOAD_DIR . 'logs/' );
1292
+		EEH_File::add_htaccess_deny_from_all(EVENT_ESPRESSO_UPLOAD_DIR.'logs/');
1293 1293
 		//remember EE's folders are all good
1294
-		delete_option( EEH_Activation::upload_directories_incomplete_option_name );
1294
+		delete_option(EEH_Activation::upload_directories_incomplete_option_name);
1295 1295
 		return TRUE;
1296 1296
 	}
1297 1297
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	 * @return boolean
1305 1305
 	 */
1306 1306
 	public static function upload_directories_incomplete() {
1307
-		return get_option( EEH_Activation::upload_directories_incomplete_option_name, false );
1307
+		return get_option(EEH_Activation::upload_directories_incomplete_option_name, false);
1308 1308
 	}
1309 1309
 
1310 1310
 
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 	 */
1322 1322
 	public static function generate_default_message_templates() {
1323 1323
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
1324
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
1324
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
1325 1325
 		/*
1326 1326
 		 * This first method is taking care of ensuring any default messengers
1327 1327
 		 * that should be made active and have templates generated are done.
@@ -1357,28 +1357,28 @@  discard block
 block discarded – undo
1357 1357
 		$active_messengers = $message_resource_manager->active_messengers();
1358 1358
 		$installed_message_types = $message_resource_manager->installed_message_types();
1359 1359
 		$templates_created = false;
1360
-		foreach ( $active_messengers as $active_messenger ) {
1360
+		foreach ($active_messengers as $active_messenger) {
1361 1361
 			$default_message_type_names_for_messenger = $active_messenger->get_default_message_types();
1362 1362
 			$default_message_type_names_to_activate = array();
1363 1363
 			// looping through each default message type reported by the messenger
1364 1364
 			// and setup the actual message types to activate.
1365
-			foreach ( $default_message_type_names_for_messenger as $default_message_type_name_for_messenger ) {
1365
+			foreach ($default_message_type_names_for_messenger as $default_message_type_name_for_messenger) {
1366 1366
 				// if already active or has already been activated before we skip
1367 1367
 				// (otherwise we might reactivate something user's intentionally deactivated.)
1368 1368
 				// we also skip if the message type is not installed.
1369 1369
 				if (
1370 1370
 					(
1371
-						isset( $has_activated[ $active_messenger->name ] )
1371
+						isset($has_activated[$active_messenger->name])
1372 1372
 						&& in_array(
1373 1373
 							$default_message_type_name_for_messenger,
1374
-							$has_activated[ $active_messenger->name ]
1374
+							$has_activated[$active_messenger->name]
1375 1375
 						)
1376 1376
 					)
1377 1377
 					|| $message_resource_manager->is_message_type_active_for_messenger(
1378 1378
 						$active_messenger->name,
1379 1379
 						$default_message_type_name_for_messenger
1380 1380
 					)
1381
-					|| ! isset( $installed_message_types[ $default_message_type_name_for_messenger ] )
1381
+					|| ! isset($installed_message_types[$default_message_type_name_for_messenger])
1382 1382
 				) {
1383 1383
 					continue;
1384 1384
 				}
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 				false
1392 1392
 			);
1393 1393
 			//activate the templates for these message types
1394
-			if ( ! empty( $default_message_type_names_to_activate ) ) {
1394
+			if ( ! empty($default_message_type_names_to_activate)) {
1395 1395
 				$templates_created = EEH_MSG_Template::generate_new_templates(
1396 1396
 					$active_messenger->name,
1397 1397
 					$default_message_type_names_for_messenger,
@@ -1418,15 +1418,15 @@  discard block
 block discarded – undo
1418 1418
 		EE_message_Resource_Manager $message_resource_manager
1419 1419
 	) {
1420 1420
 		/** @type EE_messenger[] $messengers_to_generate */
1421
-		$messengers_to_generate = self::_get_default_messengers_to_generate_on_activation( $message_resource_manager );
1421
+		$messengers_to_generate = self::_get_default_messengers_to_generate_on_activation($message_resource_manager);
1422 1422
 		$installed_message_types = $message_resource_manager->installed_message_types();
1423 1423
 		$templates_generated = false;
1424
-		foreach ( $messengers_to_generate as $messenger_to_generate ) {
1424
+		foreach ($messengers_to_generate as $messenger_to_generate) {
1425 1425
 			$default_message_type_names_for_messenger = $messenger_to_generate->get_default_message_types();
1426 1426
 			//verify the default message types match an installed message type.
1427
-			foreach ( $default_message_type_names_for_messenger as $key => $name ) {
1428
-				if ( ! isset( $installed_message_types[ $name ] ) ) {
1429
-					unset( $default_message_type_names_for_messenger[ $key ] );
1427
+			foreach ($default_message_type_names_for_messenger as $key => $name) {
1428
+				if ( ! isset($installed_message_types[$name])) {
1429
+					unset($default_message_type_names_for_messenger[$key]);
1430 1430
 				}
1431 1431
 			}
1432 1432
 			// in previous iterations, the active_messengers option in the db
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 				false
1441 1441
 			);
1442 1442
 			//create any templates needing created (or will reactivate templates already generated as necessary).
1443
-			if ( ! empty( $default_message_type_names_for_messenger ) ) {
1443
+			if ( ! empty($default_message_type_names_for_messenger)) {
1444 1444
 				$templates_generated = EEH_MSG_Template::generate_new_templates(
1445 1445
 					$messenger_to_generate->name,
1446 1446
 					$default_message_type_names_for_messenger,
@@ -1471,18 +1471,18 @@  discard block
 block discarded – undo
1471 1471
 		$installed_messengers = $message_resource_manager->installed_messengers();
1472 1472
 		$has_activated = $message_resource_manager->get_has_activated_messengers_option();
1473 1473
 		$messengers_to_generate = array();
1474
-		foreach ( $installed_messengers as $installed_messenger ) {
1474
+		foreach ($installed_messengers as $installed_messenger) {
1475 1475
 			//if installed messenger is a messenger that should be activated on install
1476 1476
 			//and is not already active
1477 1477
 			//and has never been activated
1478 1478
 			if (
1479 1479
 				! $installed_messenger->activate_on_install
1480
-				|| isset( $active_messengers[ $installed_messenger->name ] )
1481
-				|| isset( $has_activated[ $installed_messenger->name ] )
1480
+				|| isset($active_messengers[$installed_messenger->name])
1481
+				|| isset($has_activated[$installed_messenger->name])
1482 1482
 			) {
1483 1483
 				continue;
1484 1484
 			}
1485
-			$messengers_to_generate[ $installed_messenger->name ] = $installed_messenger;
1485
+			$messengers_to_generate[$installed_messenger->name] = $installed_messenger;
1486 1486
 		}
1487 1487
 		return $messengers_to_generate;
1488 1488
 	}
@@ -1507,9 +1507,9 @@  discard block
 block discarded – undo
1507 1507
 	 */
1508 1508
 	public static function validate_messages_system() {
1509 1509
 		/** @type EE_Message_Resource_Manager $message_resource_manager */
1510
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
1510
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
1511 1511
 		$message_resource_manager->validate_active_message_types_are_installed();
1512
-		do_action( 'AHEE__EEH_Activation__validate_messages_system' );
1512
+		do_action('AHEE__EEH_Activation__validate_messages_system');
1513 1513
 	}
1514 1514
 
1515 1515
 
@@ -1522,12 +1522,12 @@  discard block
 block discarded – undo
1522 1522
 	 * 	@static
1523 1523
 	 * 	@return void
1524 1524
 	 */
1525
-	public static function create_no_ticket_prices_array(){
1525
+	public static function create_no_ticket_prices_array() {
1526 1526
 		// this creates an array for tracking events that have no active ticket prices created
1527 1527
 		// this allows us to warn admins of the situation so that it can be corrected
1528
-		$espresso_no_ticket_prices = get_option( 'ee_no_ticket_prices', FALSE );
1529
-		if ( ! $espresso_no_ticket_prices ) {
1530
-			add_option( 'ee_no_ticket_prices', array(), '', FALSE );
1528
+		$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', FALSE);
1529
+		if ( ! $espresso_no_ticket_prices) {
1530
+			add_option('ee_no_ticket_prices', array(), '', FALSE);
1531 1531
 		}
1532 1532
 	}
1533 1533
 
@@ -1552,24 +1552,24 @@  discard block
 block discarded – undo
1552 1552
 	 * @global wpdb $wpdb
1553 1553
 	 * @throws \EE_Error
1554 1554
 	 */
1555
-	public static function delete_all_espresso_cpt_data(){
1555
+	public static function delete_all_espresso_cpt_data() {
1556 1556
 		global $wpdb;
1557 1557
 		//get all the CPT post_types
1558 1558
 		$ee_post_types = array();
1559
-		foreach(EE_Registry::instance()->non_abstract_db_models as $model_name){
1560
-			if ( method_exists( $model_name, 'instance' )) {
1561
-				$model_obj = call_user_func( array( $model_name, 'instance' ));
1562
-				if ( $model_obj instanceof EEM_CPT_Base ) {
1563
-					$ee_post_types[] = $wpdb->prepare("%s",$model_obj->post_type());
1559
+		foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) {
1560
+			if (method_exists($model_name, 'instance')) {
1561
+				$model_obj = call_user_func(array($model_name, 'instance'));
1562
+				if ($model_obj instanceof EEM_CPT_Base) {
1563
+					$ee_post_types[] = $wpdb->prepare("%s", $model_obj->post_type());
1564 1564
 				}
1565 1565
 			}
1566 1566
 		}
1567 1567
 		//get all our CPTs
1568
-		$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type IN (".implode(",",$ee_post_types).")";
1568
+		$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type IN (".implode(",", $ee_post_types).")";
1569 1569
 		$cpt_ids = $wpdb->get_col($query);
1570 1570
 		//delete each post meta and term relations too
1571
-		foreach($cpt_ids as $post_id){
1572
-			wp_delete_post($post_id,true);
1571
+		foreach ($cpt_ids as $post_id) {
1572
+			wp_delete_post($post_id, true);
1573 1573
 		}
1574 1574
 	}
1575 1575
 
@@ -1583,18 +1583,18 @@  discard block
 block discarded – undo
1583 1583
 	 * @param bool $remove_all
1584 1584
 	 * @return void
1585 1585
 	 */
1586
-	public static function delete_all_espresso_tables_and_data( $remove_all = true ) {
1586
+	public static function delete_all_espresso_tables_and_data($remove_all = true) {
1587 1587
 		global $wpdb;
1588 1588
 		$undeleted_tables = array();
1589 1589
 
1590 1590
 		// load registry
1591
-		foreach( EE_Registry::instance()->non_abstract_db_models as $model_name ){
1592
-			if ( method_exists( $model_name, 'instance' )) {
1593
-				$model_obj = call_user_func( array( $model_name, 'instance' ));
1594
-				if ( $model_obj instanceof EEM_Base ) {
1595
-					foreach ( $model_obj->get_tables() as $table ) {
1596
-						if ( strpos( $table->get_table_name(), 'esp_' )) {
1597
-							switch ( EEH_Activation::delete_unused_db_table( $table->get_table_name() )) {
1591
+		foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) {
1592
+			if (method_exists($model_name, 'instance')) {
1593
+				$model_obj = call_user_func(array($model_name, 'instance'));
1594
+				if ($model_obj instanceof EEM_Base) {
1595
+					foreach ($model_obj->get_tables() as $table) {
1596
+						if (strpos($table->get_table_name(), 'esp_')) {
1597
+							switch (EEH_Activation::delete_unused_db_table($table->get_table_name())) {
1598 1598
 								case false :
1599 1599
 									$undeleted_tables[] = $table->get_table_name();
1600 1600
 								break;
@@ -1619,8 +1619,8 @@  discard block
 block discarded – undo
1619 1619
 			'esp_promotion_rule',
1620 1620
 			'esp_rule'
1621 1621
 		);
1622
-		foreach( $tables_without_models as $table ){
1623
-			EEH_Activation::delete_db_table_if_empty( $table );
1622
+		foreach ($tables_without_models as $table) {
1623
+			EEH_Activation::delete_db_table_if_empty($table);
1624 1624
 		}
1625 1625
 
1626 1626
 
@@ -1658,58 +1658,58 @@  discard block
 block discarded – undo
1658 1658
 			'ee_job_parameters_' => false,
1659 1659
 			'ee_upload_directories_incomplete' => true,
1660 1660
 		);
1661
-		if( is_main_site() ) {
1662
-			$wp_options_to_delete[ 'ee_network_config' ] = true;
1661
+		if (is_main_site()) {
1662
+			$wp_options_to_delete['ee_network_config'] = true;
1663 1663
 		}
1664 1664
 
1665 1665
 		$undeleted_options = array();
1666
-		foreach ( $wp_options_to_delete as $option_name => $no_wildcard ) {
1666
+		foreach ($wp_options_to_delete as $option_name => $no_wildcard) {
1667 1667
 
1668
-			if( $no_wildcard ){
1669
-				if( ! delete_option( $option_name ) ){
1668
+			if ($no_wildcard) {
1669
+				if ( ! delete_option($option_name)) {
1670 1670
 					$undeleted_options[] = $option_name;
1671 1671
 				}
1672
-			}else{
1673
-				$option_names_to_delete_from_wildcard = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE '%$option_name%'" );
1674
-				foreach($option_names_to_delete_from_wildcard as $option_name_from_wildcard ){
1675
-					if( ! delete_option( $option_name_from_wildcard ) ){
1672
+			} else {
1673
+				$option_names_to_delete_from_wildcard = $wpdb->get_col("SELECT option_name FROM $wpdb->options WHERE option_name LIKE '%$option_name%'");
1674
+				foreach ($option_names_to_delete_from_wildcard as $option_name_from_wildcard) {
1675
+					if ( ! delete_option($option_name_from_wildcard)) {
1676 1676
 						$undeleted_options[] = $option_name_from_wildcard;
1677 1677
 					}
1678 1678
 				}
1679 1679
 			}
1680 1680
 		}
1681 1681
                 //also, let's make sure the "ee_config_option_names" wp option stays out by removing the action that adds it
1682
-                remove_action( 'shutdown', array( EE_Config::instance(), 'shutdown' ), 10 );
1682
+                remove_action('shutdown', array(EE_Config::instance(), 'shutdown'), 10);
1683 1683
 
1684
-		if ( $remove_all && $espresso_db_update = get_option( 'espresso_db_update' )) {
1684
+		if ($remove_all && $espresso_db_update = get_option('espresso_db_update')) {
1685 1685
 			$db_update_sans_ee4 = array();
1686
-			foreach($espresso_db_update as $version => $times_activated){
1687
-				if( (string)$version[0] === '3'){//if its NON EE4
1686
+			foreach ($espresso_db_update as $version => $times_activated) {
1687
+				if ((string) $version[0] === '3') {//if its NON EE4
1688 1688
 					$db_update_sans_ee4[$version] = $times_activated;
1689 1689
 				}
1690 1690
 			}
1691
-			update_option( 'espresso_db_update', $db_update_sans_ee4 );
1691
+			update_option('espresso_db_update', $db_update_sans_ee4);
1692 1692
 		}
1693 1693
 
1694 1694
 		$errors = '';
1695
-		if ( ! empty( $undeleted_tables )) {
1695
+		if ( ! empty($undeleted_tables)) {
1696 1696
 			$errors .= sprintf(
1697
-				__( 'The following tables could not be deleted: %s%s', 'event_espresso' ),
1697
+				__('The following tables could not be deleted: %s%s', 'event_espresso'),
1698 1698
 				'<br/>',
1699
-				implode( ',<br/>', $undeleted_tables )
1699
+				implode(',<br/>', $undeleted_tables)
1700 1700
 			);
1701 1701
 		}
1702
-		if ( ! empty( $undeleted_options )) {
1703
-			$errors .= ! empty( $undeleted_tables ) ? '<br/>' : '';
1702
+		if ( ! empty($undeleted_options)) {
1703
+			$errors .= ! empty($undeleted_tables) ? '<br/>' : '';
1704 1704
 			$errors .= sprintf(
1705
-				__( 'The following wp-options could not be deleted: %s%s', 'event_espresso' ),
1705
+				__('The following wp-options could not be deleted: %s%s', 'event_espresso'),
1706 1706
 				'<br/>',
1707
-				implode( ',<br/>', $undeleted_options )
1707
+				implode(',<br/>', $undeleted_options)
1708 1708
 			);
1709 1709
 
1710 1710
 		}
1711
-		if ( ! empty( $errors ) ) {
1712
-			EE_Error::add_attention( $errors, __FILE__, __FUNCTION__, __LINE__ );
1711
+		if ( ! empty($errors)) {
1712
+			EE_Error::add_attention($errors, __FILE__, __FUNCTION__, __LINE__);
1713 1713
 		}
1714 1714
 	}
1715 1715
 
@@ -1719,23 +1719,23 @@  discard block
 block discarded – undo
1719 1719
 	 * @param string $table_name with or without $wpdb->prefix
1720 1720
 	 * @return boolean
1721 1721
 	 */
1722
-	public static function table_exists( $table_name ){
1722
+	public static function table_exists($table_name) {
1723 1723
 		global $wpdb, $EZSQL_ERROR;
1724
-		$table_name = EEH_Activation::ensure_table_name_has_prefix( $table_name );
1724
+		$table_name = EEH_Activation::ensure_table_name_has_prefix($table_name);
1725 1725
 		//ignore if this causes an sql error
1726 1726
 		$old_error = $wpdb->last_error;
1727 1727
 		$old_suppress_errors = $wpdb->suppress_errors();
1728
-		$old_show_errors_value = $wpdb->show_errors( FALSE );
1728
+		$old_show_errors_value = $wpdb->show_errors(FALSE);
1729 1729
 		$ezsql_error_cache = $EZSQL_ERROR;
1730
-		$wpdb->get_results( "SELECT * from $table_name LIMIT 1");
1731
-		$wpdb->show_errors( $old_show_errors_value );
1732
-		$wpdb->suppress_errors( $old_suppress_errors );
1730
+		$wpdb->get_results("SELECT * from $table_name LIMIT 1");
1731
+		$wpdb->show_errors($old_show_errors_value);
1732
+		$wpdb->suppress_errors($old_suppress_errors);
1733 1733
 		$new_error = $wpdb->last_error;
1734 1734
 		$wpdb->last_error = $old_error;
1735 1735
 		$EZSQL_ERROR = $ezsql_error_cache;
1736
-		if( empty( $new_error ) ){
1736
+		if (empty($new_error)) {
1737 1737
 			return TRUE;
1738
-		}else{
1738
+		} else {
1739 1739
 			return FALSE;
1740 1740
 		}
1741 1741
 	}
@@ -1743,7 +1743,7 @@  discard block
 block discarded – undo
1743 1743
 	/**
1744 1744
 	 * Resets the cache on EEH_Activation
1745 1745
 	 */
1746
-	public static function reset(){
1746
+	public static function reset() {
1747 1747
 		self::$_default_creator_id = NULL;
1748 1748
 		self::$_initialized_db_content_already_in_this_request = false;
1749 1749
 	}
Please login to merge, or discard this patch.
reg_steps/payment_options/EE_SPCO_Reg_Step_Payment_Options.class.php 3 patches
Doc Comments   +14 added lines, -13 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
 
140 140
 	/**
141
-	 * @return null
141
+	 * @return EE_Line_Item_Display
142 142
 	 */
143 143
 	public function line_item_display() {
144 144
 		return $this->line_item_display;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
 
149 149
 	/**
150
-	 * @param null $line_item_display
150
+	 * @param EE_Line_Item_Display $line_item_display
151 151
 	 */
152 152
 	public function set_line_item_display( $line_item_display ) {
153 153
 		$this->line_item_display = $line_item_display;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 
230 230
 	/**
231
-	 * @return bool
231
+	 * @return EE_Form_Section_Proper
232 232
 	 * @throws \EE_Error
233 233
 	 */
234 234
 	public function generate_reg_form() {
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	 *    _apply_registration_payments_to_amount_owing
625 625
 	 *
626 626
 	 * @access protected
627
-	 * @param array $registrations
627
+	 * @param EE_Base_Class[] $registrations
628 628
 	 */
629 629
 	protected function _apply_registration_payments_to_amount_owing( array $registrations ) {
630 630
 		$payments = array();
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 	 * get_billing_form_html_for_payment_method
898 898
 	 *
899 899
 	 * @access public
900
-	 * @return string
900
+	 * @return boolean
901 901
 	 * @throws \EE_Error
902 902
 	 */
903 903
 	public function get_billing_form_html_for_payment_method() {
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 	 * switch_payment_method
1066 1066
 	 *
1067 1067
 	 * @access public
1068
-	 * @return string
1068
+	 * @return boolean
1069 1069
 	 * @throws \EE_Error
1070 1070
 	 */
1071 1071
 	public function switch_payment_method() {
@@ -1271,7 +1271,7 @@  discard block
 block discarded – undo
1271 1271
 	/**
1272 1272
 	 * process_reg_step
1273 1273
 	 *
1274
-	 * @return boolean
1274
+	 * @return null|boolean
1275 1275
 	 * @throws \EE_Error
1276 1276
 	 */
1277 1277
 	public function process_reg_step() {
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 	 *    update_reg_step
1367 1367
 	 *    this is the final step after a user  revisits the site to retry a payment
1368 1368
 	 *
1369
-	 * @return boolean
1369
+	 * @return null|boolean
1370 1370
 	 * @throws \EE_Error
1371 1371
 	 */
1372 1372
 	public function update_reg_step() {
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 	 *
1731 1731
 	 * @access    private
1732 1732
 	 * @type    EE_Payment_Method $payment_method
1733
-	 * @return    mixed    EE_Payment | boolean
1733
+	 * @return    EE_Payment|null    EE_Payment | boolean
1734 1734
 	 * @throws \EE_Error
1735 1735
 	 */
1736 1736
 	private function _attempt_payment( EE_Payment_Method $payment_method ) {
@@ -1940,6 +1940,7 @@  discard block
 block discarded – undo
1940 1940
 	 * @access private
1941 1941
 	 * @type    EE_Payment $payment
1942 1942
 	 * @param string       $payment_occurs
1943
+	 * @param EE_Payment|null $payment
1943 1944
 	 * @return bool
1944 1945
 	 * @throws \EE_Error
1945 1946
 	 */
@@ -2050,7 +2051,7 @@  discard block
 block discarded – undo
2050 2051
 	 *        or present the payment options again
2051 2052
 	 *
2052 2053
 	 * @access private
2053
-	 * @return EE_Payment | FALSE
2054
+	 * @return boolean | FALSE
2054 2055
 	 * @throws \EE_Error
2055 2056
 	 */
2056 2057
 	public function process_gateway_response() {
@@ -2112,7 +2113,7 @@  discard block
 block discarded – undo
2112 2113
 	 * _validate_return
2113 2114
 	 *
2114 2115
 	 * @access private
2115
-	 * @return bool
2116
+	 * @return boolean|null
2116 2117
 	 * @throws \EE_Error
2117 2118
 	 */
2118 2119
 	private function _validate_offsite_return() {
@@ -2183,8 +2184,8 @@  discard block
 block discarded – undo
2183 2184
 	 * _redirect_wayward_request
2184 2185
 	 *
2185 2186
 	 * @access private
2186
-	 * @param \EE_Registration|null $primary_registrant
2187
-	 * @return bool
2187
+	 * @param EE_Registration $primary_registrant
2188
+	 * @return false|null
2188 2189
 	 * @throws \EE_Error
2189 2190
 	 */
2190 2191
 	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
 				'layout_strategy' => new EE_Template_Layout(
412 412
 					array(
413 413
 						'layout_template_file' => SPCO_REG_STEPS_PATH
414
-						                          . $this->_slug
415
-						                          . DS
416
-						                          . 'sold_out_events.template.php',
414
+												  . $this->_slug
415
+												  . DS
416
+												  . 'sold_out_events.template.php',
417 417
 						'template_args'        => apply_filters(
418 418
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
419 419
 							array(
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
 				'layout_strategy' => new EE_Template_Layout(
466 466
 					array(
467 467
 						'layout_template_file' => SPCO_REG_STEPS_PATH
468
-						                          . $this->_slug
469
-						                          . DS
470
-						                          . 'events_requiring_pre_approval.template.php', // layout_template
468
+												  . $this->_slug
469
+												  . DS
470
+												  . 'events_requiring_pre_approval.template.php', // layout_template
471 471
 						'template_args'        => apply_filters(
472 472
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
473 473
 							array(
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
 				'layout_strategy' => new EE_Template_Layout(
510 510
 					array(
511 511
 						'layout_template_file' => SPCO_REG_STEPS_PATH
512
-						                          . $this->_slug
513
-						                          . DS
514
-						                          . 'no_payment_required.template.php', // layout_template
512
+												  . $this->_slug
513
+												  . DS
514
+												  . 'no_payment_required.template.php', // layout_template
515 515
 						'template_args'        => apply_filters(
516 516
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___no_payment_required__template_args',
517 517
 							array(
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 					$available_payment_method_options[ $payment_method->slug() ] = $payment_method_button;
742 742
 				}
743 743
 				$payment_methods_billing_info[ $payment_method->slug()
744
-				                               . '-info' ] = $this->_payment_method_billing_info(
744
+											   . '-info' ] = $this->_payment_method_billing_info(
745 745
 					$payment_method
746 746
 				);
747 747
 			}
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 		// fill form with attendee info if applicable
930 930
 		if (
931 931
 			$payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form
932
-		    && $this->checkout->transaction_has_primary_registrant()
932
+			&& $this->checkout->transaction_has_primary_registrant()
933 933
 		) {
934 934
 			$payment_method_billing_form->populate_from_attendee(
935 935
 				$this->checkout->transaction->primary_registration()->attendee()
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 		// and debug content
939 939
 		if (
940 940
 			$payment_method_billing_form instanceof EE_Billing_Info_Form
941
-		    && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
941
+			&& $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
942 942
 		) {
943 943
 			$payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings(
944 944
 				$payment_method_billing_form
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 		}
1098 1098
 		// fill form with attendee info if applicable
1099 1099
 		if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form
1100
-		     && $this->checkout->transaction_has_primary_registrant()
1100
+			 && $this->checkout->transaction_has_primary_registrant()
1101 1101
 		) {
1102 1102
 			$this->checkout->billing_form->populate_from_attendee(
1103 1103
 				$this->checkout->transaction->primary_registration()->attendee()
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 		}
1106 1106
 		// and debug content
1107 1107
 		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form
1108
-		     && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
1108
+			 && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
1109 1109
 		) {
1110 1110
 			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings(
1111 1111
 				$this->checkout->billing_form
@@ -1238,8 +1238,8 @@  discard block
 block discarded – undo
1238 1238
 		}
1239 1239
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1240 1240
 		if ( ! empty( $attendee_data['ATT_fname'] )
1241
-		     && ! empty( $attendee_data['ATT_lname'] )
1242
-		     && ! empty( $attendee_data['ATT_email'] )
1241
+			 && ! empty( $attendee_data['ATT_lname'] )
1242
+			 && ! empty( $attendee_data['ATT_email'] )
1243 1243
 		) {
1244 1244
 			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(
1245 1245
 				array(
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
 			$payment_status = $payment->status();
1451 1451
 			if (
1452 1452
 				$payment_status === EEM_Payment::status_id_approved
1453
-			    || $payment_status === EEM_Payment::status_id_pending
1453
+				|| $payment_status === EEM_Payment::status_id_pending
1454 1454
 			) {
1455 1455
 				return true;
1456 1456
 			} else {
@@ -1638,8 +1638,8 @@  discard block
 block discarded – undo
1638 1638
 			return false;
1639 1639
 		}
1640 1640
 		if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' )
1641
-		       instanceof
1642
-		       EE_Attendee
1641
+			   instanceof
1642
+			   EE_Attendee
1643 1643
 		) {
1644 1644
 			EE_Error::add_error(
1645 1645
 				sprintf(
Please login to merge, or discard this patch.
Spacing   +326 added lines, -326 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 
@@ -38,32 +38,32 @@  discard block
 block discarded – undo
38 38
 	public static function set_hooks() {
39 39
 		add_filter(
40 40
 			'FHEE__SPCO__EE_Line_Item_Filter_Collection',
41
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters' )
41
+			array('EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters')
42 42
 		);
43 43
 		add_action(
44 44
 			'wp_ajax_switch_spco_billing_form',
45
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' )
45
+			array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form')
46 46
 		);
47 47
 		add_action(
48 48
 			'wp_ajax_nopriv_switch_spco_billing_form',
49
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' )
49
+			array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form')
50 50
 		);
51
-		add_action( 'wp_ajax_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ) );
51
+		add_action('wp_ajax_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
52 52
 		add_action(
53 53
 			'wp_ajax_nopriv_save_payer_details',
54
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' )
54
+			array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details')
55 55
 		);
56 56
 		add_action(
57 57
 			'wp_ajax_get_transaction_details_for_gateways',
58
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
58
+			array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
59 59
 		);
60 60
 		add_action(
61 61
 			'wp_ajax_nopriv_get_transaction_details_for_gateways',
62
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
62
+			array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
63 63
 		);
64 64
 		add_filter(
65 65
 			'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array',
66
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ),
66
+			array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'),
67 67
 			10,
68 68
 			1
69 69
 		);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @throws \EE_Error
78 78
 	 */
79 79
 	public static function switch_spco_billing_form() {
80
-		EED_Single_Page_Checkout::process_ajax_request( 'switch_payment_method' );
80
+		EED_Single_Page_Checkout::process_ajax_request('switch_payment_method');
81 81
 	}
82 82
 
83 83
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @throws \EE_Error
89 89
 	 */
90 90
 	public static function save_payer_details() {
91
-		EED_Single_Page_Checkout::process_ajax_request( 'save_payer_details_via_ajax' );
91
+		EED_Single_Page_Checkout::process_ajax_request('save_payer_details_via_ajax');
92 92
 	}
93 93
 
94 94
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @throws \EE_Error
100 100
 	 */
101 101
 	public static function get_transaction_details() {
102
-		EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' );
102
+		EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways');
103 103
 	}
104 104
 
105 105
 
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 	 * @param    EE_Checkout $checkout
128 128
 	 * @return    \EE_SPCO_Reg_Step_Payment_Options
129 129
 	 */
130
-	public function __construct( EE_Checkout $checkout ) {
130
+	public function __construct(EE_Checkout $checkout) {
131 131
 		$this->_slug = 'payment_options';
132
-		$this->_name = __( 'Payment Options', 'event_espresso' );
133
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'payment_options_main.template.php';
132
+		$this->_name = __('Payment Options', 'event_espresso');
133
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'payment_options_main.template.php';
134 134
 		$this->checkout = $checkout;
135 135
 		$this->_reset_success_message();
136 136
 		$this->set_instructions(
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	/**
156 156
 	 * @param null $line_item_display
157 157
 	 */
158
-	public function set_line_item_display( $line_item_display ) {
158
+	public function set_line_item_display($line_item_display) {
159 159
 		$this->line_item_display = $line_item_display;
160 160
 	}
161 161
 
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	/**
174 174
 	 * @param boolean $handle_IPN_in_this_request
175 175
 	 */
176
-	public function set_handle_IPN_in_this_request( $handle_IPN_in_this_request ) {
177
-		$this->handle_IPN_in_this_request = filter_var( $handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN );
176
+	public function set_handle_IPN_in_this_request($handle_IPN_in_this_request) {
177
+		$this->handle_IPN_in_this_request = filter_var($handle_IPN_in_this_request, FILTER_VALIDATE_BOOLEAN);
178 178
 	}
179 179
 
180 180
 
@@ -227,20 +227,20 @@  discard block
 block discarded – undo
227 227
 			// 	$ 0.00 transactions (no payment required)
228 228
 			! $this->checkout->payment_required()
229 229
 			// but do NOT remove if current action being called belongs to this reg step
230
-			&& ! is_callable( array( $this, $this->checkout->action ) )
230
+			&& ! is_callable(array($this, $this->checkout->action))
231 231
 			&& ! $this->completed()
232 232
 		) {
233 233
 			// and if so, then we no longer need the Payment Options step
234
-			if ( $this->is_current_step() ) {
234
+			if ($this->is_current_step()) {
235 235
 				$this->checkout->generate_reg_form = false;
236 236
 			}
237
-			$this->checkout->remove_reg_step( $this->_slug );
237
+			$this->checkout->remove_reg_step($this->_slug);
238 238
 			// DEBUG LOG
239 239
 			//$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ );
240 240
 			return false;
241 241
 		}
242 242
 		// load EEM_Payment_Method
243
-		EE_Registry::instance()->load_model( 'Payment_Method' );
243
+		EE_Registry::instance()->load_model('Payment_Method');
244 244
 		// get all active payment methods
245 245
 		$this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction(
246 246
 			$this->checkout->transaction,
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
 		$sold_out_events = array();
267 267
 		$reg_count = 0;
268 268
 		// loop thru registrations to gather info
269
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
270
-		foreach ( $registrations as $registration ) {
269
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
270
+		foreach ($registrations as $registration) {
271 271
 			/** @var $registration EE_Registration */
272 272
 			$reg_count++;
273 273
 			// if returning registrant is Approved then do NOT do this
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
 				&& $registration->status_ID() === EEM_Registration::status_id_approved
278 278
 			)
279 279
 			) {
280
-				if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true ) ) {
280
+				if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) {
281 281
 					// add event to list of events that are sold out
282
-					$sold_out_events[ $registration->event()->ID() ] = $registration->event();
282
+					$sold_out_events[$registration->event()->ID()] = $registration->event();
283 283
 					do_action(
284 284
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event',
285 285
 						$registration->event(),
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
 					);
288 288
 				}
289 289
 				// event requires admin approval
290
-				if ( $registration->status_ID() === EEM_Registration::status_id_not_approved ) {
290
+				if ($registration->status_ID() === EEM_Registration::status_id_not_approved) {
291 291
 					// add event to list of events with pre-approval reg status
292
-					$registrations_requiring_pre_approval[ $registration->ID() ] = $registration;
292
+					$registrations_requiring_pre_approval[$registration->ID()] = $registration;
293 293
 					do_action(
294 294
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval',
295 295
 						$registration->event(),
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
 				}
299 299
 			}
300 300
 			// are they allowed to pay now and is there monies owing?
301
-			if ( $registration->owes_monies_and_can_pay() ) {
302
-				$registrations_requiring_payment[ $registration->ID() ] = $registration;
301
+			if ($registration->owes_monies_and_can_pay()) {
302
+				$registrations_requiring_payment[$registration->ID()] = $registration;
303 303
 				do_action(
304 304
 					'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment',
305 305
 					$registration->event(),
@@ -310,23 +310,23 @@  discard block
 block discarded – undo
310 310
 				&& $registration->status_ID() !== EEM_Registration::status_id_not_approved
311 311
 				&& $registration->ticket()->is_free()
312 312
 			) {
313
-				$registrations_for_free_events[ $registration->event()->ID() ] = $registration;
313
+				$registrations_for_free_events[$registration->event()->ID()] = $registration;
314 314
 			}
315 315
 		}
316 316
 		$subsections = array();
317 317
 		// now decide which template to load
318
-		if ( ! empty( $sold_out_events ) ) {
319
-			$subsections['sold_out_events'] = $this->_sold_out_events( $sold_out_events );
318
+		if ( ! empty($sold_out_events)) {
319
+			$subsections['sold_out_events'] = $this->_sold_out_events($sold_out_events);
320 320
 		}
321
-		if ( ! empty( $registrations_requiring_pre_approval ) ) {
321
+		if ( ! empty($registrations_requiring_pre_approval)) {
322 322
 			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval(
323 323
 				$registrations_requiring_pre_approval
324 324
 			);
325 325
 		}
326
-		if ( ! empty( $registrations_for_free_events ) ) {
327
-			$subsections['no_payment_required'] = $this->_no_payment_required( $registrations_for_free_events );
326
+		if ( ! empty($registrations_for_free_events)) {
327
+			$subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events);
328 328
 		}
329
-		if ( ! empty( $registrations_requiring_payment ) ) {
329
+		if ( ! empty($registrations_requiring_payment)) {
330 330
 			// autoload Line_Item_Display classes
331 331
 			EEH_Autoloader::register_line_item_filter_autoloaders();
332 332
 			$line_item_filter_processor = new EE_Line_Item_Filter_Processor(
@@ -338,17 +338,17 @@  discard block
 block discarded – undo
338 338
 			);
339 339
 			/** @var EE_Line_Item $filtered_line_item_tree */
340 340
 			$filtered_line_item_tree = $line_item_filter_processor->process();
341
-			if ( $this->checkout->amount_owing > 0 ) {
341
+			if ($this->checkout->amount_owing > 0) {
342 342
 				EEH_Autoloader::register_line_item_display_autoloaders();
343
-				$this->set_line_item_display( new EE_Line_Item_Display( 'spco' ) );
343
+				$this->set_line_item_display(new EE_Line_Item_Display('spco'));
344 344
 				$subsections['payment_options'] = $this->_display_payment_options(
345 345
 					$this->line_item_display->display_line_item(
346 346
 						$filtered_line_item_tree,
347
-						array( 'registrations' => $registrations )
347
+						array('registrations' => $registrations)
348 348
 					)
349 349
 				);
350 350
 				$this->checkout->amount_owing = $filtered_line_item_tree->total();
351
-				$this->_apply_registration_payments_to_amount_owing( $registrations );
351
+				$this->_apply_registration_payments_to_amount_owing($registrations);
352 352
 			}
353 353
 		} else {
354 354
 			$this->_hide_reg_step_submit_button_if_revisit();
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 	 * @param \EE_Line_Item_Filter_Collection $line_item_filter_collection
379 379
 	 * @return \EE_Line_Item_Filter_Collection
380 380
 	 */
381
-	public static function add_spco_line_item_filters( EE_Line_Item_Filter_Collection $line_item_filter_collection ) {
381
+	public static function add_spco_line_item_filters(EE_Line_Item_Filter_Collection $line_item_filter_collection) {
382 382
 		$line_item_filter_collection->add(
383 383
 			new EE_Billable_Line_Item_Filter(
384 384
 				EE_Registry::instance()->SSN->checkout()->transaction->registrations(
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 				)
387 387
 			)
388 388
 		);
389
-		$line_item_filter_collection->add( new EE_Non_Zero_Line_Item_Filter() );
389
+		$line_item_filter_collection->add(new EE_Non_Zero_Line_Item_Filter());
390 390
 		return $line_item_filter_collection;
391 391
 	}
392 392
 
@@ -400,8 +400,8 @@  discard block
 block discarded – undo
400 400
 	 * @return void
401 401
 	 */
402 402
 	protected function _hide_reg_step_submit_button_if_revisit() {
403
-		if ( $this->checkout->revisit ) {
404
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string' );
403
+		if ($this->checkout->revisit) {
404
+			add_filter('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string');
405 405
 		}
406 406
 	}
407 407
 
@@ -414,13 +414,13 @@  discard block
 block discarded – undo
414 414
 	 * @return \EE_Form_Section_Proper
415 415
 	 * @throws \EE_Error
416 416
 	 */
417
-	private function _sold_out_events( $sold_out_events_array = array() ) {
417
+	private function _sold_out_events($sold_out_events_array = array()) {
418 418
 		// set some defaults
419 419
 		$this->checkout->selected_method_of_payment = 'events_sold_out';
420 420
 		$sold_out_events = '';
421
-		foreach ( $sold_out_events_array as $sold_out_event ) {
421
+		foreach ($sold_out_events_array as $sold_out_event) {
422 422
 			$sold_out_events .= EEH_HTML::li(
423
-				EEH_HTML::span( $sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' )
423
+				EEH_HTML::span($sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text')
424 424
 			);
425 425
 		}
426 426
 		return new EE_Form_Section_Proper(
@@ -465,17 +465,17 @@  discard block
 block discarded – undo
465 465
 	 * @return \EE_Form_Section_Proper
466 466
 	 * @throws \EE_Error
467 467
 	 */
468
-	private function _registrations_requiring_pre_approval( $registrations_requiring_pre_approval = array() ) {
468
+	private function _registrations_requiring_pre_approval($registrations_requiring_pre_approval = array()) {
469 469
 		$events_requiring_pre_approval = '';
470
-		foreach ( $registrations_requiring_pre_approval as $registration ) {
471
-			if ( $registration instanceof EE_Registration && $registration->event() instanceof EE_Event ) {
472
-				$events_requiring_pre_approval[ $registration->event()->ID() ] = EEH_HTML::li(
470
+		foreach ($registrations_requiring_pre_approval as $registration) {
471
+			if ($registration instanceof EE_Registration && $registration->event() instanceof EE_Event) {
472
+				$events_requiring_pre_approval[$registration->event()->ID()] = EEH_HTML::li(
473 473
 					EEH_HTML::span(
474 474
 						'',
475 475
 						'',
476 476
 						'dashicons dashicons-marker ee-icon-size-16 orange-text'
477 477
 					)
478
-					. EEH_HTML::span( $registration->event()->name(), '', 'orange-text' )
478
+					. EEH_HTML::span($registration->event()->name(), '', 'orange-text')
479 479
 				);
480 480
 			}
481 481
 		}
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 						'template_args'        => apply_filters(
495 495
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
496 496
 							array(
497
-								'events_requiring_pre_approval'     => implode( '', $events_requiring_pre_approval ),
497
+								'events_requiring_pre_approval'     => implode('', $events_requiring_pre_approval),
498 498
 								'events_requiring_pre_approval_msg' => apply_filters(
499 499
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg',
500 500
 									__(
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	 * @return \EE_Form_Section_Proper
520 520
 	 * @throws \EE_Error
521 521
 	 */
522
-	private function _no_payment_required( $registrations_for_free_events = array() ) {
522
+	private function _no_payment_required($registrations_for_free_events = array()) {
523 523
 		// set some defaults
524 524
 		$this->checkout->selected_method_of_payment = 'no_payment_required';
525 525
 		// generate no_payment_required form
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 								'ticket_count'                  => array(),
544 544
 								'registrations_for_free_events' => $registrations_for_free_events,
545 545
 								'no_payment_required_msg'       => EEH_HTML::p(
546
-									__( 'This is a free event, so no billing will occur.', 'event_espresso' )
546
+									__('This is a free event, so no billing will occur.', 'event_espresso')
547 547
 								)
548 548
 							)
549 549
 						),
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 	 * @return \EE_Form_Section_Proper
563 563
 	 * @throws \EE_Error
564 564
 	 */
565
-	private function _display_payment_options( $transaction_details = '' ) {
565
+	private function _display_payment_options($transaction_details = '') {
566 566
 		// has method_of_payment been set by no-js user?
567 567
 		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment();
568 568
 		// build payment options form
@@ -574,18 +574,18 @@  discard block
 block discarded – undo
574 574
 						'before_payment_options' => apply_filters(
575 575
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options',
576 576
 							new EE_Form_Section_Proper(
577
-								array( 'layout_strategy' => new EE_Div_Per_Section_Layout() )
577
+								array('layout_strategy' => new EE_Div_Per_Section_Layout())
578 578
 							)
579 579
 						),
580 580
 						'payment_options'        => $this->_setup_payment_options(),
581 581
 						'after_payment_options'  => apply_filters(
582 582
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__after_payment_options',
583 583
 							new EE_Form_Section_Proper(
584
-								array( 'layout_strategy' => new EE_Div_Per_Section_Layout() )
584
+								array('layout_strategy' => new EE_Div_Per_Section_Layout())
585 585
 							)
586 586
 						),
587 587
 						'default_hidden_inputs'  => $this->reg_step_hidden_inputs(),
588
-						'extra_hidden_inputs'    => $this->_extra_hidden_inputs( false )
588
+						'extra_hidden_inputs'    => $this->_extra_hidden_inputs(false)
589 589
 					),
590 590
 					'layout_strategy' => new EE_Template_Layout(
591 591
 						array(
@@ -614,10 +614,10 @@  discard block
 block discarded – undo
614 614
 	 * @return \EE_Form_Section_Proper
615 615
 	 * @throws \EE_Error
616 616
 	 */
617
-	private function _extra_hidden_inputs( $no_payment_required = true ) {
617
+	private function _extra_hidden_inputs($no_payment_required = true) {
618 618
 		return new EE_Form_Section_Proper(
619 619
 			array(
620
-				'html_id'         => 'ee-' . $this->slug() . '-extra-hidden-inputs',
620
+				'html_id'         => 'ee-'.$this->slug().'-extra-hidden-inputs',
621 621
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
622 622
 				'subsections'     => array(
623 623
 					'spco_no_payment_required' => new EE_Hidden_Input(
@@ -649,16 +649,16 @@  discard block
 block discarded – undo
649 649
 	 * @access protected
650 650
 	 * @param array $registrations
651 651
 	 */
652
-	protected function _apply_registration_payments_to_amount_owing( array $registrations ) {
652
+	protected function _apply_registration_payments_to_amount_owing(array $registrations) {
653 653
 		$payments = array();
654
-		foreach ( $registrations as $registration ) {
655
-			if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) {
654
+		foreach ($registrations as $registration) {
655
+			if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
656 656
 				$payments += $registration->registration_payments();
657 657
 			}
658 658
 		}
659
-		if ( ! empty( $payments ) ) {
660
-			foreach ( $payments as $payment ) {
661
-				if ( $payment instanceof EE_Registration_Payment ) {
659
+		if ( ! empty($payments)) {
660
+			foreach ($payments as $payment) {
661
+				if ($payment instanceof EE_Registration_Payment) {
662 662
 					$this->checkout->amount_owing -= $payment->amount();
663 663
 				}
664 664
 			}
@@ -674,11 +674,11 @@  discard block
 block discarded – undo
674 674
 	 * @param    bool $force_reset
675 675
 	 * @return    void
676 676
 	 */
677
-	private function _reset_selected_method_of_payment( $force_reset = false ) {
677
+	private function _reset_selected_method_of_payment($force_reset = false) {
678 678
 		$reset_payment_method = $force_reset
679 679
 			? true
680
-			: sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', false ) );
681
-		if ( $reset_payment_method ) {
680
+			: sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', false));
681
+		if ($reset_payment_method) {
682 682
 			$this->checkout->selected_method_of_payment = null;
683 683
 			$this->checkout->payment_method = null;
684 684
 			$this->checkout->billing_form = null;
@@ -697,12 +697,12 @@  discard block
 block discarded – undo
697 697
 	 * @param string $selected_method_of_payment
698 698
 	 * @return        EE_Billing_Info_Form
699 699
 	 */
700
-	private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) {
701
-		$selected_method_of_payment = ! empty( $selected_method_of_payment )
700
+	private function _save_selected_method_of_payment($selected_method_of_payment = '') {
701
+		$selected_method_of_payment = ! empty($selected_method_of_payment)
702 702
 			? $selected_method_of_payment
703 703
 			: $this->checkout->selected_method_of_payment;
704 704
 		EE_Registry::instance()->SSN->set_session_data(
705
-			array( 'selected_method_of_payment' => $selected_method_of_payment )
705
+			array('selected_method_of_payment' => $selected_method_of_payment)
706 706
 		);
707 707
 	}
708 708
 
@@ -718,19 +718,19 @@  discard block
 block discarded – undo
718 718
 		// load payment method classes
719 719
 		$this->checkout->available_payment_methods = $this->_get_available_payment_methods();
720 720
 		// switch up header depending on number of available payment methods
721
-		$payment_method_header = count( $this->checkout->available_payment_methods ) > 1
721
+		$payment_method_header = count($this->checkout->available_payment_methods) > 1
722 722
 			? apply_filters(
723 723
 				'FHEE__registration_page_payment_options__method_of_payment_hdr',
724
-				__( 'Please Select Your Method of Payment', 'event_espresso' )
724
+				__('Please Select Your Method of Payment', 'event_espresso')
725 725
 			)
726 726
 			: apply_filters(
727 727
 				'FHEE__registration_page_payment_options__method_of_payment_hdr',
728
-				__( 'Method of Payment', 'event_espresso' )
728
+				__('Method of Payment', 'event_espresso')
729 729
 			);
730 730
 		$available_payment_methods = array(
731 731
 			// display the "Payment Method" header
732 732
 			'payment_method_header' => new EE_Form_Section_HTML(
733
-				EEH_HTML::h4( $payment_method_header, 'method-of-payment-hdr' )
733
+				EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr')
734 734
 			)
735 735
 		);
736 736
 		// the list of actual payment methods ( invoice, paypal, etc ) in a  ( slug => HTML )  format
@@ -739,32 +739,32 @@  discard block
 block discarded – undo
739 739
 		// additional instructions to be displayed and hidden below payment methods (adding a clearing div to start)
740 740
 		$payment_methods_billing_info = array(
741 741
 			new EE_Form_Section_HTML(
742
-				EEH_HTML::div( '<br />', '', '', 'clear:both;' )
742
+				EEH_HTML::div('<br />', '', '', 'clear:both;')
743 743
 			)
744 744
 		);
745 745
 		// loop through payment methods
746
-		foreach ( $this->checkout->available_payment_methods as $payment_method ) {
747
-			if ( $payment_method instanceof EE_Payment_Method ) {
746
+		foreach ($this->checkout->available_payment_methods as $payment_method) {
747
+			if ($payment_method instanceof EE_Payment_Method) {
748 748
 				$payment_method_button = EEH_HTML::img(
749 749
 					$payment_method->button_url(),
750 750
 					$payment_method->name(),
751
-					'spco-payment-method-' . $payment_method->slug() . '-btn-img',
751
+					'spco-payment-method-'.$payment_method->slug().'-btn-img',
752 752
 					'spco-payment-method-btn-img'
753 753
 				);
754 754
 				// check if any payment methods are set as default
755 755
 				// if payment method is already selected OR nothing is selected and this payment method should be open_by_default
756 756
 				if (
757
-					( $this->checkout->selected_method_of_payment === $payment_method->slug() )
758
-					|| ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() )
757
+					($this->checkout->selected_method_of_payment === $payment_method->slug())
758
+					|| ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default())
759 759
 				) {
760 760
 					$this->checkout->selected_method_of_payment = $payment_method->slug();
761 761
 					$this->_save_selected_method_of_payment();
762
-					$default_payment_method_option[ $payment_method->slug() ] = $payment_method_button;
762
+					$default_payment_method_option[$payment_method->slug()] = $payment_method_button;
763 763
 				} else {
764
-					$available_payment_method_options[ $payment_method->slug() ] = $payment_method_button;
764
+					$available_payment_method_options[$payment_method->slug()] = $payment_method_button;
765 765
 				}
766
-				$payment_methods_billing_info[ $payment_method->slug()
767
-				                               . '-info' ] = $this->_payment_method_billing_info(
766
+				$payment_methods_billing_info[$payment_method->slug()
767
+				                               . '-info'] = $this->_payment_method_billing_info(
768 768
 					$payment_method
769 769
 				);
770 770
 			}
@@ -794,12 +794,12 @@  discard block
 block discarded – undo
794 794
 	 * @return EE_Payment_Method[]
795 795
 	 */
796 796
 	protected function _get_available_payment_methods() {
797
-		if ( ! empty( $this->checkout->available_payment_methods ) ) {
797
+		if ( ! empty($this->checkout->available_payment_methods)) {
798 798
 			return $this->checkout->available_payment_methods;
799 799
 		}
800 800
 		$available_payment_methods = array();
801 801
 		// load EEM_Payment_Method
802
-		EE_Registry::instance()->load_model( 'Payment_Method' );
802
+		EE_Registry::instance()->load_model('Payment_Method');
803 803
 		/** @type EEM_Payment_Method $EEM_Payment_Method */
804 804
 		$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
805 805
 		// get all active payment methods
@@ -807,9 +807,9 @@  discard block
 block discarded – undo
807 807
 			$this->checkout->transaction,
808 808
 			EEM_Payment_Method::scope_cart
809 809
 		);
810
-		foreach ( $payment_methods as $payment_method ) {
811
-			if ( $payment_method instanceof EE_Payment_Method ) {
812
-				$available_payment_methods[ $payment_method->slug() ] = $payment_method;
810
+		foreach ($payment_methods as $payment_method) {
811
+			if ($payment_method instanceof EE_Payment_Method) {
812
+				$available_payment_methods[$payment_method->slug()] = $payment_method;
813 813
 			}
814 814
 		}
815 815
 		return $available_payment_methods;
@@ -824,14 +824,14 @@  discard block
 block discarded – undo
824 824
 	 * @param    array $available_payment_method_options
825 825
 	 * @return    \EE_Form_Section_Proper
826 826
 	 */
827
-	private function _available_payment_method_inputs( $available_payment_method_options = array() ) {
827
+	private function _available_payment_method_inputs($available_payment_method_options = array()) {
828 828
 		// generate inputs
829 829
 		return new EE_Form_Section_Proper(
830 830
 			array(
831 831
 				'html_id'         => 'ee-available-payment-method-inputs',
832 832
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
833 833
 				'subsections'     => array(
834
-					'' => new EE_Radio_Button_Input (
834
+					'' => new EE_Radio_Button_Input(
835 835
 						$available_payment_method_options,
836 836
 						array(
837 837
 							'html_name'          => 'selected_method_of_payment',
@@ -856,28 +856,28 @@  discard block
 block discarded – undo
856 856
 	 * @return    \EE_Form_Section_Proper
857 857
 	 * @throws \EE_Error
858 858
 	 */
859
-	private function _payment_method_billing_info( EE_Payment_Method $payment_method ) {
859
+	private function _payment_method_billing_info(EE_Payment_Method $payment_method) {
860 860
 		$currently_selected = $this->checkout->selected_method_of_payment === $payment_method->slug()
861 861
 			? true
862 862
 			: false;
863 863
 		// generate the billing form for payment method
864 864
 		$billing_form = $currently_selected
865
-			? $this->_get_billing_form_for_payment_method( $payment_method )
865
+			? $this->_get_billing_form_for_payment_method($payment_method)
866 866
 			: new EE_Form_Section_HTML();
867 867
 		$this->checkout->billing_form = $currently_selected
868 868
 			? $billing_form
869 869
 			: $this->checkout->billing_form;
870 870
 		// it's all in the details
871 871
 		$info_html = EEH_HTML::h3(
872
-			__( 'Important information regarding your payment', 'event_espresso' ),
872
+			__('Important information regarding your payment', 'event_espresso'),
873 873
 			'',
874 874
 			'spco-payment-method-hdr'
875 875
 		);
876 876
 		// add some info regarding the step, either from what's saved in the admin,
877 877
 		// or a default string depending on whether the PM has a billing form or not
878
-		if ( $payment_method->description() ) {
878
+		if ($payment_method->description()) {
879 879
 			$payment_method_info = $payment_method->description();
880
-		} elseif ( $billing_form instanceof EE_Billing_Info_Form ) {
880
+		} elseif ($billing_form instanceof EE_Billing_Info_Form) {
881 881
 			$payment_method_info = sprintf(
882 882
 				__(
883 883
 					'Please provide the following billing information, then click the "%1$s" button below in order to proceed.',
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 			);
888 888
 		} else {
889 889
 			$payment_method_info = sprintf(
890
-				__( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ),
890
+				__('Please click the "%1$s" button below in order to proceed.', 'event_espresso'),
891 891
 				$this->submit_button_text()
892 892
 			);
893 893
 		}
@@ -901,13 +901,13 @@  discard block
 block discarded – undo
901 901
 		);
902 902
 		return new EE_Form_Section_Proper(
903 903
 			array(
904
-				'html_id'         => 'spco-payment-method-info-' . $payment_method->slug(),
904
+				'html_id'         => 'spco-payment-method-info-'.$payment_method->slug(),
905 905
 				'html_class'      => 'spco-payment-method-info-dv',
906 906
 				// only display the selected or default PM
907 907
 				'html_style'      => $currently_selected ? '' : 'display:none;',
908 908
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
909 909
 				'subsections'     => array(
910
-					'info'         => new EE_Form_Section_HTML( $info_html ),
910
+					'info'         => new EE_Form_Section_HTML($info_html),
911 911
 					'billing_form' => $currently_selected ? $billing_form : new EE_Form_Section_HTML()
912 912
 				)
913 913
 			)
@@ -925,15 +925,15 @@  discard block
 block discarded – undo
925 925
 	 */
926 926
 	public function get_billing_form_html_for_payment_method() {
927 927
 		// how have they chosen to pay?
928
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
928
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
929 929
 		$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
930
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
930
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
931 931
 			return false;
932 932
 		}
933
-		if ( apply_filters(
933
+		if (apply_filters(
934 934
 			'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
935 935
 			false
936
-		) ) {
936
+		)) {
937 937
 			EE_Error::add_success(
938 938
 				apply_filters(
939 939
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
 			);
949 949
 		}
950 950
 		// now generate billing form for selected method of payment
951
-		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
951
+		$payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
952 952
 		// fill form with attendee info if applicable
953 953
 		if (
954 954
 			$payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form
@@ -970,10 +970,10 @@  discard block
 block discarded – undo
970 970
 		$billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper
971 971
 			? $payment_method_billing_form->get_html()
972 972
 			: '';
973
-		$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info ) );
973
+		$this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info));
974 974
 		// localize validation rules for main form
975 975
 		$this->checkout->current_step->reg_form->localize_validation_rules();
976
-		$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
976
+		$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
977 977
 		return true;
978 978
 	}
979 979
 
@@ -987,18 +987,18 @@  discard block
 block discarded – undo
987 987
 	 * @return \EE_Billing_Info_Form
988 988
 	 * @throws \EE_Error
989 989
 	 */
990
-	private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) {
990
+	private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) {
991 991
 		$billing_form = $payment_method->type_obj()->billing_form(
992 992
 			$this->checkout->transaction,
993
-			array( 'amount_owing' => $this->checkout->amount_owing )
993
+			array('amount_owing' => $this->checkout->amount_owing)
994 994
 		);
995
-		if ( $billing_form instanceof EE_Billing_Info_Form ) {
995
+		if ($billing_form instanceof EE_Billing_Info_Form) {
996 996
 			if (
997 997
 				apply_filters(
998 998
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
999 999
 					false
1000 1000
 				)
1001
-				&& EE_Registry::instance()->REQ->is_set( 'payment_method' )
1001
+				&& EE_Registry::instance()->REQ->is_set('payment_method')
1002 1002
 			) {
1003 1003
 				EE_Error::add_success(
1004 1004
 					apply_filters(
@@ -1040,15 +1040,15 @@  discard block
 block discarded – undo
1040 1040
 		$request_param = 'selected_method_of_payment'
1041 1041
 	) {
1042 1042
 		// is selected_method_of_payment set in the request ?
1043
-		$selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, false );
1044
-		if ( $selected_method_of_payment ) {
1043
+		$selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, false);
1044
+		if ($selected_method_of_payment) {
1045 1045
 			// sanitize it
1046
-			$selected_method_of_payment = is_array( $selected_method_of_payment )
1047
-				? array_shift( $selected_method_of_payment )
1046
+			$selected_method_of_payment = is_array($selected_method_of_payment)
1047
+				? array_shift($selected_method_of_payment)
1048 1048
 				: $selected_method_of_payment;
1049
-			$selected_method_of_payment = sanitize_text_field( $selected_method_of_payment );
1049
+			$selected_method_of_payment = sanitize_text_field($selected_method_of_payment);
1050 1050
 			// store it in the session so that it's available for all subsequent requests including AJAX
1051
-			$this->_save_selected_method_of_payment( $selected_method_of_payment );
1051
+			$this->_save_selected_method_of_payment($selected_method_of_payment);
1052 1052
 		} else {
1053 1053
 			// or is is set in the session ?
1054 1054
 			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data(
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
 			);
1057 1057
 		}
1058 1058
 		// do ya really really gotta have it?
1059
-		if ( empty( $selected_method_of_payment ) && $required ) {
1059
+		if (empty($selected_method_of_payment) && $required) {
1060 1060
 			EE_Error::add_error(
1061 1061
 				sprintf(
1062 1062
 					__(
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 					),
1066 1066
 					'<br/>',
1067 1067
 					'<br/>',
1068
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1068
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1069 1069
 				),
1070 1070
 				__FILE__,
1071 1071
 				__FUNCTION__,
@@ -1092,13 +1092,13 @@  discard block
 block discarded – undo
1092 1092
 	 * @throws \EE_Error
1093 1093
 	 */
1094 1094
 	public function switch_payment_method() {
1095
-		if ( ! $this->_verify_payment_method_is_set() ) {
1095
+		if ( ! $this->_verify_payment_method_is_set()) {
1096 1096
 			return false;
1097 1097
 		}
1098
-		if ( apply_filters(
1098
+		if (apply_filters(
1099 1099
 			'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
1100 1100
 			false
1101
-		) ) {
1101
+		)) {
1102 1102
 			EE_Error::add_success(
1103 1103
 				apply_filters(
1104 1104
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -1113,13 +1113,13 @@  discard block
 block discarded – undo
1113 1113
 			);
1114 1114
 		}
1115 1115
 		// generate billing form for selected method of payment if it hasn't been done already
1116
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1116
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
1117 1117
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1118 1118
 				$this->checkout->payment_method
1119 1119
 			);
1120 1120
 		}
1121 1121
 		// fill form with attendee info if applicable
1122
-		if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form
1122
+		if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form
1123 1123
 		     && $this->checkout->transaction_has_primary_registrant()
1124 1124
 		) {
1125 1125
 			$this->checkout->billing_form->populate_from_attendee(
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
 			);
1128 1128
 		}
1129 1129
 		// and debug content
1130
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form
1130
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form
1131 1131
 		     && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
1132 1132
 		) {
1133 1133
 			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings(
@@ -1135,15 +1135,15 @@  discard block
 block discarded – undo
1135 1135
 			);
1136 1136
 		}
1137 1137
 		// get html and validation rules for form
1138
-		if ( $this->checkout->billing_form instanceof EE_Form_Section_Proper ) {
1138
+		if ($this->checkout->billing_form instanceof EE_Form_Section_Proper) {
1139 1139
 			$this->checkout->json_response->set_return_data(
1140
-				array( 'payment_method_info' => $this->checkout->billing_form->get_html() )
1140
+				array('payment_method_info' => $this->checkout->billing_form->get_html())
1141 1141
 			);
1142 1142
 			// localize validation rules for main form
1143
-			$this->checkout->billing_form->localize_validation_rules( true );
1144
-			$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
1143
+			$this->checkout->billing_form->localize_validation_rules(true);
1144
+			$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
1145 1145
 		} else {
1146
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => '' ) );
1146
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => ''));
1147 1147
 		}
1148 1148
 		//prevents advancement to next step
1149 1149
 		$this->checkout->continue_reg = false;
@@ -1160,12 +1160,12 @@  discard block
 block discarded – undo
1160 1160
 	 */
1161 1161
 	protected function _verify_payment_method_is_set() {
1162 1162
 		// generate billing form for selected method of payment if it hasn't been done already
1163
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1163
+		if (empty($this->checkout->selected_method_of_payment)) {
1164 1164
 			// how have they chosen to pay?
1165
-			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
1165
+			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
1166 1166
 		}
1167 1167
 		// verify payment method
1168
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
1168
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
1169 1169
 			// get payment method for selected method of payment
1170 1170
 			$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
1171 1171
 		}
@@ -1184,25 +1184,25 @@  discard block
 block discarded – undo
1184 1184
 	 * @throws \EE_Error
1185 1185
 	 */
1186 1186
 	public function save_payer_details_via_ajax() {
1187
-		if ( ! $this->_verify_payment_method_is_set() ) {
1187
+		if ( ! $this->_verify_payment_method_is_set()) {
1188 1188
 			return;
1189 1189
 		}
1190 1190
 		// generate billing form for selected method of payment if it hasn't been done already
1191
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1191
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
1192 1192
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1193 1193
 				$this->checkout->payment_method
1194 1194
 			);
1195 1195
 		}
1196 1196
 		// generate primary attendee from payer info if applicable
1197
-		if ( ! $this->checkout->transaction_has_primary_registrant() ) {
1197
+		if ( ! $this->checkout->transaction_has_primary_registrant()) {
1198 1198
 			$attendee = $this->_create_attendee_from_request_data();
1199
-			if ( $attendee instanceof EE_Attendee ) {
1200
-				foreach ( $this->checkout->transaction->registrations() as $registration ) {
1201
-					if ( $registration->is_primary_registrant() ) {
1199
+			if ($attendee instanceof EE_Attendee) {
1200
+				foreach ($this->checkout->transaction->registrations() as $registration) {
1201
+					if ($registration->is_primary_registrant()) {
1202 1202
 						$this->checkout->primary_attendee_obj = $attendee;
1203
-						$registration->_add_relation_to( $attendee, 'Attendee' );
1204
-						$registration->set_attendee_id( $attendee->ID() );
1205
-						$registration->update_cache_after_object_save( 'Attendee', $attendee );
1203
+						$registration->_add_relation_to($attendee, 'Attendee');
1204
+						$registration->set_attendee_id($attendee->ID());
1205
+						$registration->update_cache_after_object_save('Attendee', $attendee);
1206 1206
 					}
1207 1207
 				}
1208 1208
 			}
@@ -1219,50 +1219,50 @@  discard block
 block discarded – undo
1219 1219
 	 */
1220 1220
 	protected function _create_attendee_from_request_data() {
1221 1221
 		// get State ID
1222
-		$STA_ID = ! empty( $_REQUEST['state'] ) ? sanitize_text_field( $_REQUEST['state'] ) : '';
1223
-		if ( ! empty( $STA_ID ) ) {
1222
+		$STA_ID = ! empty($_REQUEST['state']) ? sanitize_text_field($_REQUEST['state']) : '';
1223
+		if ( ! empty($STA_ID)) {
1224 1224
 			// can we get state object from name ?
1225
-			EE_Registry::instance()->load_model( 'State' );
1226
-			$state = EEM_State::instance()->get_col( array( array( 'STA_name' => $STA_ID ), 'limit' => 1 ), 'STA_ID' );
1227
-			$STA_ID = is_array( $state ) && ! empty( $state ) ? reset( $state ) : $STA_ID;
1225
+			EE_Registry::instance()->load_model('State');
1226
+			$state = EEM_State::instance()->get_col(array(array('STA_name' => $STA_ID), 'limit' => 1), 'STA_ID');
1227
+			$STA_ID = is_array($state) && ! empty($state) ? reset($state) : $STA_ID;
1228 1228
 		}
1229 1229
 		// get Country ISO
1230
-		$CNT_ISO = ! empty( $_REQUEST['country'] ) ? sanitize_text_field( $_REQUEST['country'] ) : '';
1231
-		if ( ! empty( $CNT_ISO ) ) {
1230
+		$CNT_ISO = ! empty($_REQUEST['country']) ? sanitize_text_field($_REQUEST['country']) : '';
1231
+		if ( ! empty($CNT_ISO)) {
1232 1232
 			// can we get country object from name ?
1233
-			EE_Registry::instance()->load_model( 'Country' );
1233
+			EE_Registry::instance()->load_model('Country');
1234 1234
 			$country = EEM_Country::instance()->get_col(
1235
-				array( array( 'CNT_name' => $CNT_ISO ), 'limit' => 1 ),
1235
+				array(array('CNT_name' => $CNT_ISO), 'limit' => 1),
1236 1236
 				'CNT_ISO'
1237 1237
 			);
1238
-			$CNT_ISO = is_array( $country ) && ! empty( $country ) ? reset( $country ) : $CNT_ISO;
1238
+			$CNT_ISO = is_array($country) && ! empty($country) ? reset($country) : $CNT_ISO;
1239 1239
 		}
1240 1240
 		// grab attendee data
1241 1241
 		$attendee_data = array(
1242
-			'ATT_fname'    => ! empty( $_REQUEST['first_name'] ) ? sanitize_text_field( $_REQUEST['first_name'] ) : '',
1243
-			'ATT_lname'    => ! empty( $_REQUEST['last_name'] ) ? sanitize_text_field( $_REQUEST['last_name'] ) : '',
1244
-			'ATT_email'    => ! empty( $_REQUEST['email'] ) ? sanitize_email( $_REQUEST['email'] ) : '',
1245
-			'ATT_address'  => ! empty( $_REQUEST['address'] ) ? sanitize_text_field( $_REQUEST['address'] ) : '',
1246
-			'ATT_address2' => ! empty( $_REQUEST['address2'] ) ? sanitize_text_field( $_REQUEST['address2'] ) : '',
1247
-			'ATT_city'     => ! empty( $_REQUEST['city'] ) ? sanitize_text_field( $_REQUEST['city'] ) : '',
1242
+			'ATT_fname'    => ! empty($_REQUEST['first_name']) ? sanitize_text_field($_REQUEST['first_name']) : '',
1243
+			'ATT_lname'    => ! empty($_REQUEST['last_name']) ? sanitize_text_field($_REQUEST['last_name']) : '',
1244
+			'ATT_email'    => ! empty($_REQUEST['email']) ? sanitize_email($_REQUEST['email']) : '',
1245
+			'ATT_address'  => ! empty($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '',
1246
+			'ATT_address2' => ! empty($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '',
1247
+			'ATT_city'     => ! empty($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '',
1248 1248
 			'STA_ID'       => $STA_ID,
1249 1249
 			'CNT_ISO'      => $CNT_ISO,
1250
-			'ATT_zip'      => ! empty( $_REQUEST['zip'] ) ? sanitize_text_field( $_REQUEST['zip'] ) : '',
1251
-			'ATT_phone'    => ! empty( $_REQUEST['phone'] ) ? sanitize_text_field( $_REQUEST['phone'] ) : '',
1250
+			'ATT_zip'      => ! empty($_REQUEST['zip']) ? sanitize_text_field($_REQUEST['zip']) : '',
1251
+			'ATT_phone'    => ! empty($_REQUEST['phone']) ? sanitize_text_field($_REQUEST['phone']) : '',
1252 1252
 		);
1253 1253
 		// validate the email address since it is the most important piece of info
1254
-		if ( empty( $attendee_data['ATT_email'] ) || $attendee_data['ATT_email'] !== $_REQUEST['email'] ) {
1254
+		if (empty($attendee_data['ATT_email']) || $attendee_data['ATT_email'] !== $_REQUEST['email']) {
1255 1255
 			EE_Error::add_error(
1256
-				__( 'An invalid email address was submitted.', 'event_espresso' ),
1256
+				__('An invalid email address was submitted.', 'event_espresso'),
1257 1257
 				__FILE__,
1258 1258
 				__FUNCTION__,
1259 1259
 				__LINE__
1260 1260
 			);
1261 1261
 		}
1262 1262
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1263
-		if ( ! empty( $attendee_data['ATT_fname'] )
1264
-		     && ! empty( $attendee_data['ATT_lname'] )
1265
-		     && ! empty( $attendee_data['ATT_email'] )
1263
+		if ( ! empty($attendee_data['ATT_fname'])
1264
+		     && ! empty($attendee_data['ATT_lname'])
1265
+		     && ! empty($attendee_data['ATT_email'])
1266 1266
 		) {
1267 1267
 			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(
1268 1268
 				array(
@@ -1271,19 +1271,19 @@  discard block
 block discarded – undo
1271 1271
 					'ATT_email' => $attendee_data['ATT_email']
1272 1272
 				)
1273 1273
 			);
1274
-			if ( $existing_attendee instanceof EE_Attendee ) {
1274
+			if ($existing_attendee instanceof EE_Attendee) {
1275 1275
 				return $existing_attendee;
1276 1276
 			}
1277 1277
 		}
1278 1278
 		// no existing attendee? kk let's create a new one
1279 1279
 		// kinda lame, but we need a first and last name to create an attendee, so use the email address if those don't exist
1280
-		$attendee_data['ATT_fname'] = ! empty( $attendee_data['ATT_fname'] )
1280
+		$attendee_data['ATT_fname'] = ! empty($attendee_data['ATT_fname'])
1281 1281
 			? $attendee_data['ATT_fname']
1282 1282
 			: $attendee_data['ATT_email'];
1283
-		$attendee_data['ATT_lname'] = ! empty( $attendee_data['ATT_lname'] )
1283
+		$attendee_data['ATT_lname'] = ! empty($attendee_data['ATT_lname'])
1284 1284
 			? $attendee_data['ATT_lname']
1285 1285
 			: $attendee_data['ATT_email'];
1286
-		return EE_Attendee::new_instance( $attendee_data );
1286
+		return EE_Attendee::new_instance($attendee_data);
1287 1287
 	}
1288 1288
 
1289 1289
 
@@ -1301,26 +1301,26 @@  discard block
 block discarded – undo
1301 1301
 		// how have they chosen to pay?
1302 1302
 		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free()
1303 1303
 			? 'no_payment_required'
1304
-			: $this->_get_selected_method_of_payment( true );
1304
+			: $this->_get_selected_method_of_payment(true);
1305 1305
 		// choose your own adventure based on method_of_payment
1306
-		switch ( $this->checkout->selected_method_of_payment ) {
1306
+		switch ($this->checkout->selected_method_of_payment) {
1307 1307
 
1308 1308
 			case 'events_sold_out' :
1309 1309
 				$this->checkout->redirect = true;
1310 1310
 				$this->checkout->redirect_url = $this->checkout->cancel_page_url;
1311
-				$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1311
+				$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1312 1312
 				// mark this reg step as completed
1313 1313
 				$this->set_completed();
1314 1314
 				return false;
1315 1315
 				break;
1316 1316
 
1317 1317
 			case 'payments_closed' :
1318
-				if ( apply_filters(
1318
+				if (apply_filters(
1319 1319
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success',
1320 1320
 					false
1321
-				) ) {
1321
+				)) {
1322 1322
 					EE_Error::add_success(
1323
-						__( 'no payment required at this time.', 'event_espresso' ),
1323
+						__('no payment required at this time.', 'event_espresso'),
1324 1324
 						__FILE__,
1325 1325
 						__FUNCTION__,
1326 1326
 						__LINE__
@@ -1332,12 +1332,12 @@  discard block
 block discarded – undo
1332 1332
 				break;
1333 1333
 
1334 1334
 			case 'no_payment_required' :
1335
-				if ( apply_filters(
1335
+				if (apply_filters(
1336 1336
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success',
1337 1337
 					false
1338
-				) ) {
1338
+				)) {
1339 1339
 					EE_Error::add_success(
1340
-						__( 'no payment required.', 'event_espresso' ),
1340
+						__('no payment required.', 'event_espresso'),
1341 1341
 						__FILE__,
1342 1342
 						__FUNCTION__,
1343 1343
 						__LINE__
@@ -1350,9 +1350,9 @@  discard block
 block discarded – undo
1350 1350
 
1351 1351
 			default:
1352 1352
 				$payment_successful = $this->_process_payment();
1353
-				if ( $payment_successful ) {
1353
+				if ($payment_successful) {
1354 1354
 					$this->checkout->continue_reg = true;
1355
-					$this->_maybe_set_completed( $this->checkout->payment_method );
1355
+					$this->_maybe_set_completed($this->checkout->payment_method);
1356 1356
 				} else {
1357 1357
 					$this->checkout->continue_reg = false;
1358 1358
 				}
@@ -1371,8 +1371,8 @@  discard block
 block discarded – undo
1371 1371
 	 * @return void
1372 1372
 	 * @throws \EE_Error
1373 1373
 	 */
1374
-	protected function _maybe_set_completed( EE_Payment_Method $payment_method ) {
1375
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1374
+	protected function _maybe_set_completed(EE_Payment_Method $payment_method) {
1375
+		switch ($payment_method->type_obj()->payment_occurs()) {
1376 1376
 			case EE_PMT_Base::offsite :
1377 1377
 				break;
1378 1378
 			case EE_PMT_Base::onsite :
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 	public function update_reg_step() {
1396 1396
 		$success = true;
1397 1397
 		// if payment required
1398
-		if ( $this->checkout->transaction->total() > 0 ) {
1398
+		if ($this->checkout->transaction->total() > 0) {
1399 1399
 			do_action(
1400 1400
 				'AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway',
1401 1401
 				$this->checkout->transaction
@@ -1403,13 +1403,13 @@  discard block
 block discarded – undo
1403 1403
 			// attempt payment via payment method
1404 1404
 			$success = $this->process_reg_step();
1405 1405
 		}
1406
-		if ( $success && ! $this->checkout->redirect ) {
1406
+		if ($success && ! $this->checkout->redirect) {
1407 1407
 			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn(
1408 1408
 				$this->checkout->transaction->ID()
1409 1409
 			);
1410 1410
 			// set return URL
1411 1411
 			$this->checkout->redirect_url = add_query_arg(
1412
-				array( 'e_reg_url_link' => $this->checkout->reg_url_link ),
1412
+				array('e_reg_url_link' => $this->checkout->reg_url_link),
1413 1413
 				$this->checkout->thank_you_page_url
1414 1414
 			);
1415 1415
 		}
@@ -1429,28 +1429,28 @@  discard block
 block discarded – undo
1429 1429
 		// clear any previous errors related to not selecting a payment method
1430 1430
 //		EE_Error::overwrite_errors();
1431 1431
 		// ya gotta make a choice man
1432
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1432
+		if (empty($this->checkout->selected_method_of_payment)) {
1433 1433
 			$this->checkout->json_response->set_plz_select_method_of_payment(
1434
-				__( 'Please select a method of payment before proceeding.', 'event_espresso' )
1434
+				__('Please select a method of payment before proceeding.', 'event_espresso')
1435 1435
 			);
1436 1436
 			return false;
1437 1437
 		}
1438 1438
 		// get EE_Payment_Method object
1439
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1439
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1440 1440
 			return false;
1441 1441
 		}
1442 1442
 		// setup billing form
1443
-		if ( $this->checkout->payment_method->is_on_site() ) {
1443
+		if ($this->checkout->payment_method->is_on_site()) {
1444 1444
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1445 1445
 				$this->checkout->payment_method
1446 1446
 			);
1447 1447
 			// bad billing form ?
1448
-			if ( ! $this->_billing_form_is_valid() ) {
1448
+			if ( ! $this->_billing_form_is_valid()) {
1449 1449
 				return false;
1450 1450
 			}
1451 1451
 		}
1452 1452
 		// ensure primary registrant has been fully processed
1453
-		if ( ! $this->_setup_primary_registrant_prior_to_payment() ) {
1453
+		if ( ! $this->_setup_primary_registrant_prior_to_payment()) {
1454 1454
 			return false;
1455 1455
 		}
1456 1456
 		/** @type EE_Transaction_Processor $transaction_processor */
@@ -1458,18 +1458,18 @@  discard block
 block discarded – undo
1458 1458
 		// in case a registrant leaves to an Off-Site Gateway and never returns, we want to approve any registrations for events with a default reg status of Approved
1459 1459
 		//$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params );
1460 1460
 		// attempt payment
1461
-		$payment = $this->_attempt_payment( $this->checkout->payment_method );
1461
+		$payment = $this->_attempt_payment($this->checkout->payment_method);
1462 1462
 		// process results
1463
-		$payment = $this->_validate_payment( $payment );
1464
-		$payment = $this->_post_payment_processing( $payment );
1463
+		$payment = $this->_validate_payment($payment);
1464
+		$payment = $this->_post_payment_processing($payment);
1465 1465
 		// verify payment
1466
-		if ( $payment instanceof EE_Payment ) {
1466
+		if ($payment instanceof EE_Payment) {
1467 1467
 			// store that for later
1468 1468
 			$this->checkout->payment = $payment;
1469 1469
 			/** @type EE_Transaction_Processor $transaction_processor */
1470
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1470
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1471 1471
 			// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1472
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1472
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1473 1473
 			$payment_status = $payment->status();
1474 1474
 			if (
1475 1475
 				$payment_status === EEM_Payment::status_id_approved
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
 			} else {
1480 1480
 				return false;
1481 1481
 			}
1482
-		} else if ( $payment === true ) {
1482
+		} else if ($payment === true) {
1483 1483
 			// please note that offline payment methods will NOT make a payment,
1484 1484
 			// but instead just mark themselves as the PMD_ID on the transaction, and return true
1485 1485
 			$this->checkout->payment = $payment;
@@ -1504,7 +1504,7 @@  discard block
 block discarded – undo
1504 1504
 		);
1505 1505
 		$html = $payment_method_billing_info->get_html_and_js();
1506 1506
 		$html .= $this->checkout->redirect_form;
1507
-		EE_Registry::instance()->REQ->add_output( $html );
1507
+		EE_Registry::instance()->REQ->add_output($html);
1508 1508
 		return true;
1509 1509
 	}
1510 1510
 
@@ -1518,28 +1518,28 @@  discard block
 block discarded – undo
1518 1518
 	 * @throws \EE_Error
1519 1519
 	 */
1520 1520
 	private function _billing_form_is_valid() {
1521
-		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1521
+		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form()) {
1522 1522
 			return true;
1523 1523
 		}
1524
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) {
1525
-			if ( $this->checkout->billing_form->was_submitted() ) {
1524
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) {
1525
+			if ($this->checkout->billing_form->was_submitted()) {
1526 1526
 				$this->checkout->billing_form->receive_form_submission();
1527
-				if ( $this->checkout->billing_form->is_valid() ) {
1527
+				if ($this->checkout->billing_form->is_valid()) {
1528 1528
 					return true;
1529 1529
 				}
1530 1530
 				$validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated();
1531 1531
 				$error_strings = array();
1532
-				foreach ( $validation_errors as $validation_error ) {
1533
-					if ( $validation_error instanceof EE_Validation_Error ) {
1532
+				foreach ($validation_errors as $validation_error) {
1533
+					if ($validation_error instanceof EE_Validation_Error) {
1534 1534
 						$form_section = $validation_error->get_form_section();
1535
-						if ( $form_section instanceof EE_Form_Input_Base ) {
1535
+						if ($form_section instanceof EE_Form_Input_Base) {
1536 1536
 							$label = $form_section->html_label_text();
1537
-						} elseif ( $form_section instanceof EE_Form_Section_Base ) {
1537
+						} elseif ($form_section instanceof EE_Form_Section_Base) {
1538 1538
 							$label = $form_section->name();
1539 1539
 						} else {
1540
-							$label = __( 'Validation Error', 'event_espresso' );
1540
+							$label = __('Validation Error', 'event_espresso');
1541 1541
 						}
1542
-						$error_strings[] = sprintf( '%1$s: %2$s', $label, $validation_error->getMessage() );
1542
+						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage());
1543 1543
 					}
1544 1544
 				}
1545 1545
 				EE_Error::add_error(
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
 							'event_espresso'
1550 1550
 						),
1551 1551
 						'<br/>',
1552
-						implode( '<br/>', $error_strings )
1552
+						implode('<br/>', $error_strings)
1553 1553
 					),
1554 1554
 					__FILE__,
1555 1555
 					__FUNCTION__,
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 			}
1569 1569
 		} else {
1570 1570
 			EE_Error::add_error(
1571
-				__( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ),
1571
+				__('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'),
1572 1572
 				__FILE__,
1573 1573
 				__FUNCTION__,
1574 1574
 				__LINE__
@@ -1603,13 +1603,13 @@  discard block
 block discarded – undo
1603 1603
 		// grab the primary_registration object
1604 1604
 		$primary_registration = $this->checkout->transaction->primary_registration();
1605 1605
 		/** @type EE_Transaction_Processor $transaction_processor */
1606
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1606
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1607 1607
 		// at this point we'll consider a TXN to not have been failed
1608
-		$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1608
+		$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1609 1609
 		// save the TXN ( which clears cached copy of primary_registration)
1610 1610
 		$this->checkout->transaction->save();
1611 1611
 		// grab TXN ID and save it to the primary_registration
1612
-		$primary_registration->set_transaction_id( $this->checkout->transaction->ID() );
1612
+		$primary_registration->set_transaction_id($this->checkout->transaction->ID());
1613 1613
 		// save what we have so far
1614 1614
 		$primary_registration->save();
1615 1615
 		return true;
@@ -1627,7 +1627,7 @@  discard block
 block discarded – undo
1627 1627
 	private function _capture_primary_registration_data_from_billing_form() {
1628 1628
 		// convert billing form data into an attendee
1629 1629
 		$this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data();
1630
-		if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) {
1630
+		if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) {
1631 1631
 			EE_Error::add_error(
1632 1632
 				sprintf(
1633 1633
 					__(
@@ -1635,7 +1635,7 @@  discard block
 block discarded – undo
1635 1635
 						'event_espresso'
1636 1636
 					),
1637 1637
 					'<br/>',
1638
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1638
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1639 1639
 				),
1640 1640
 				__FILE__,
1641 1641
 				__FUNCTION__,
@@ -1644,7 +1644,7 @@  discard block
 block discarded – undo
1644 1644
 			return false;
1645 1645
 		}
1646 1646
 		$primary_registration = $this->checkout->transaction->primary_registration();
1647
-		if ( ! $primary_registration instanceof EE_Registration ) {
1647
+		if ( ! $primary_registration instanceof EE_Registration) {
1648 1648
 			EE_Error::add_error(
1649 1649
 				sprintf(
1650 1650
 					__(
@@ -1652,7 +1652,7 @@  discard block
 block discarded – undo
1652 1652
 						'event_espresso'
1653 1653
 					),
1654 1654
 					'<br/>',
1655
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1655
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1656 1656
 				),
1657 1657
 				__FILE__,
1658 1658
 				__FUNCTION__,
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 			);
1661 1661
 			return false;
1662 1662
 		}
1663
-		if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' )
1663
+		if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee')
1664 1664
 		       instanceof
1665 1665
 		       EE_Attendee
1666 1666
 		) {
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 						'event_espresso'
1672 1672
 					),
1673 1673
 					'<br/>',
1674
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1674
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1675 1675
 				),
1676 1676
 				__FILE__,
1677 1677
 				__FUNCTION__,
@@ -1680,9 +1680,9 @@  discard block
 block discarded – undo
1680 1680
 			return false;
1681 1681
 		}
1682 1682
 		/** @type EE_Registration_Processor $registration_processor */
1683
-		$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1683
+		$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1684 1684
 		// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1685
-		$registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration );
1685
+		$registration_processor->toggle_incomplete_registration_status_to_default($primary_registration);
1686 1686
 		return true;
1687 1687
 	}
1688 1688
 
@@ -1698,17 +1698,17 @@  discard block
 block discarded – undo
1698 1698
 	 */
1699 1699
 	private function _get_payment_method_for_selected_method_of_payment() {
1700 1700
 		// get EE_Payment_Method object
1701
-		if ( isset( $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ] ) ) {
1702
-			$payment_method = $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ];
1701
+		if (isset($this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment])) {
1702
+			$payment_method = $this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment];
1703 1703
 		} else {
1704 1704
 			// load EEM_Payment_Method
1705
-			EE_Registry::instance()->load_model( 'Payment_Method' );
1705
+			EE_Registry::instance()->load_model('Payment_Method');
1706 1706
 			/** @type EEM_Payment_Method $EEM_Payment_Method */
1707 1707
 			$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
1708
-			$payment_method = $EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment );
1708
+			$payment_method = $EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment);
1709 1709
 		}
1710 1710
 		// verify $payment_method
1711
-		if ( ! $payment_method instanceof EE_Payment_Method ) {
1711
+		if ( ! $payment_method instanceof EE_Payment_Method) {
1712 1712
 			// not a payment
1713 1713
 			EE_Error::add_error(
1714 1714
 				sprintf(
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
 						'event_espresso'
1718 1718
 					),
1719 1719
 					'<br/>',
1720
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1720
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1721 1721
 				),
1722 1722
 				__FILE__,
1723 1723
 				__FUNCTION__,
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 			return null;
1727 1727
 		}
1728 1728
 		// and verify it has a valid Payment_Method Type object
1729
-		if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) {
1729
+		if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) {
1730 1730
 			// not a payment
1731 1731
 			EE_Error::add_error(
1732 1732
 				sprintf(
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
 						'event_espresso'
1736 1736
 					),
1737 1737
 					'<br/>',
1738
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1738
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1739 1739
 				),
1740 1740
 				__FILE__,
1741 1741
 				__FUNCTION__,
@@ -1756,29 +1756,29 @@  discard block
 block discarded – undo
1756 1756
 	 * @return    mixed    EE_Payment | boolean
1757 1757
 	 * @throws \EE_Error
1758 1758
 	 */
1759
-	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1759
+	private function _attempt_payment(EE_Payment_Method $payment_method) {
1760 1760
 		$payment = null;
1761 1761
 		$this->checkout->transaction->save();
1762
-		$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1763
-		if ( ! $payment_processor instanceof EE_Payment_Processor ) {
1762
+		$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1763
+		if ( ! $payment_processor instanceof EE_Payment_Processor) {
1764 1764
 			return false;
1765 1765
 		}
1766 1766
 		try {
1767
-			$payment_processor->set_revisit( $this->checkout->revisit );
1767
+			$payment_processor->set_revisit($this->checkout->revisit);
1768 1768
 			// generate payment object
1769 1769
 			$payment = $payment_processor->process_payment(
1770 1770
 				$payment_method,
1771 1771
 				$this->checkout->transaction,
1772 1772
 				$this->checkout->amount_owing,
1773 1773
 				$this->checkout->billing_form,
1774
-				$this->_get_return_url( $payment_method ),
1774
+				$this->_get_return_url($payment_method),
1775 1775
 				'CART',
1776 1776
 				$this->checkout->admin_request,
1777 1777
 				true,
1778 1778
 				$this->reg_step_url()
1779 1779
 			);
1780
-		} catch ( Exception $e ) {
1781
-			$this->_handle_payment_processor_exception( $e );
1780
+		} catch (Exception $e) {
1781
+			$this->_handle_payment_processor_exception($e);
1782 1782
 		}
1783 1783
 		return $payment;
1784 1784
 	}
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
 	 * @return void
1794 1794
 	 * @throws \EE_Error
1795 1795
 	 */
1796
-	protected function _handle_payment_processor_exception( Exception $e ) {
1796
+	protected function _handle_payment_processor_exception(Exception $e) {
1797 1797
 		EE_Error::add_error(
1798 1798
 			sprintf(
1799 1799
 				__(
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 					'event_espresso'
1802 1802
 				),
1803 1803
 				'<br/>',
1804
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' ),
1804
+				EE_Registry::instance()->CFG->organization->get_pretty('email'),
1805 1805
 				$e->getMessage(),
1806 1806
 				$e->getFile(),
1807 1807
 				$e->getLine()
@@ -1822,9 +1822,9 @@  discard block
 block discarded – undo
1822 1822
 	 * @return string
1823 1823
 	 * @throws \EE_Error
1824 1824
 	 */
1825
-	protected function _get_return_url( EE_Payment_Method $payment_method ) {
1825
+	protected function _get_return_url(EE_Payment_Method $payment_method) {
1826 1826
 		$return_url = '';
1827
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1827
+		switch ($payment_method->type_obj()->payment_occurs()) {
1828 1828
 			case EE_PMT_Base::offsite :
1829 1829
 				$return_url = add_query_arg(
1830 1830
 					array(
@@ -1853,12 +1853,12 @@  discard block
 block discarded – undo
1853 1853
 	 * @return EE_Payment | FALSE
1854 1854
 	 * @throws \EE_Error
1855 1855
 	 */
1856
-	private function _validate_payment( $payment = null ) {
1857
-		if ( $this->checkout->payment_method->is_off_line() ) {
1856
+	private function _validate_payment($payment = null) {
1857
+		if ($this->checkout->payment_method->is_off_line()) {
1858 1858
 			return true;
1859 1859
 		}
1860 1860
 		// verify payment object
1861
-		if ( ! $payment instanceof EE_Payment ) {
1861
+		if ( ! $payment instanceof EE_Payment) {
1862 1862
 			// not a payment
1863 1863
 			EE_Error::add_error(
1864 1864
 				sprintf(
@@ -1867,7 +1867,7 @@  discard block
 block discarded – undo
1867 1867
 						'event_espresso'
1868 1868
 					),
1869 1869
 					'<br/>',
1870
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1870
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1871 1871
 				),
1872 1872
 				__FILE__,
1873 1873
 				__FUNCTION__,
@@ -1888,27 +1888,27 @@  discard block
 block discarded – undo
1888 1888
 	 * @return bool
1889 1889
 	 * @throws \EE_Error
1890 1890
 	 */
1891
-	private function _post_payment_processing( $payment = null ) {
1891
+	private function _post_payment_processing($payment = null) {
1892 1892
 		// Off-Line payment?
1893
-		if ( $payment === true ) {
1893
+		if ($payment === true) {
1894 1894
 			//$this->_setup_redirect_for_next_step();
1895 1895
 			return true;
1896 1896
 		// On-Site payment?
1897
-		} else if ( $this->checkout->payment_method->is_on_site() ) {
1898
-			if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite ) ) {
1897
+		} else if ($this->checkout->payment_method->is_on_site()) {
1898
+			if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) {
1899 1899
 				//$this->_setup_redirect_for_next_step();
1900 1900
 				$this->checkout->continue_reg = false;
1901 1901
 			}
1902 1902
 		// Off-Site payment?
1903
-		} else if ( $this->checkout->payment_method->is_off_site() ) {
1903
+		} else if ($this->checkout->payment_method->is_off_site()) {
1904 1904
 			// if a payment object was made and it specifies a redirect url, then we'll setup that redirect info
1905
-			if ( $payment instanceof EE_Payment && $payment->redirect_url() ) {
1906
-				do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()' );
1905
+			if ($payment instanceof EE_Payment && $payment->redirect_url()) {
1906
+				do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()');
1907 1907
 				$this->checkout->redirect = true;
1908 1908
 				$this->checkout->redirect_form = $payment->redirect_form();
1909
-				$this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' );
1909
+				$this->checkout->redirect_url = $this->reg_step_url('redirect_form');
1910 1910
 				// set JSON response
1911
-				$this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form );
1911
+				$this->checkout->json_response->set_redirect_form($this->checkout->redirect_form);
1912 1912
 				// set cron job for finalizing the TXN
1913 1913
 				// in case the user does not return from the off-site gateway
1914 1914
 				EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check(
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
 					$this->checkout->transaction->ID()
1917 1917
 				);
1918 1918
 				// and lastly, let's bump the payment status to pending
1919
-				$payment->set_status( EEM_Payment::status_id_pending );
1919
+				$payment->set_status(EEM_Payment::status_id_pending);
1920 1920
 				$payment->save();
1921 1921
 			} else {
1922 1922
 				// not a payment
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
 							'event_espresso'
1929 1929
 						),
1930 1930
 						'<br/>',
1931
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1931
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1932 1932
 					),
1933 1933
 					__FILE__,
1934 1934
 					__FUNCTION__,
@@ -1966,21 +1966,21 @@  discard block
 block discarded – undo
1966 1966
 	 * @return bool
1967 1967
 	 * @throws \EE_Error
1968 1968
 	 */
1969
-	private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) {
1969
+	private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) {
1970 1970
 		// off-line payment? carry on
1971
-		if ( $payment_occurs === EE_PMT_Base::offline ) {
1971
+		if ($payment_occurs === EE_PMT_Base::offline) {
1972 1972
 			return true;
1973 1973
 		}
1974 1974
 		// verify payment validity
1975
-		if ( $payment instanceof EE_Payment ) {
1976
-			do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()' );
1975
+		if ($payment instanceof EE_Payment) {
1976
+			do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()');
1977 1977
 			$msg = $payment->gateway_response();
1978 1978
 			// check results
1979
-			switch ( $payment->status() ) {
1979
+			switch ($payment->status()) {
1980 1980
 				// good payment
1981 1981
 				case EEM_Payment::status_id_approved :
1982 1982
 					EE_Error::add_success(
1983
-						__( 'Your payment was processed successfully.', 'event_espresso' ),
1983
+						__('Your payment was processed successfully.', 'event_espresso'),
1984 1984
 						__FILE__,
1985 1985
 						__FUNCTION__,
1986 1986
 						__LINE__
@@ -1989,45 +1989,45 @@  discard block
 block discarded – undo
1989 1989
 					break;
1990 1990
 				// slow payment
1991 1991
 				case EEM_Payment::status_id_pending :
1992
-					if ( empty( $msg ) ) {
1992
+					if (empty($msg)) {
1993 1993
 						$msg = __(
1994 1994
 							'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.',
1995 1995
 							'event_espresso'
1996 1996
 						);
1997 1997
 					}
1998
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
1998
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
1999 1999
 					return true;
2000 2000
 					break;
2001 2001
 				// don't wanna payment
2002 2002
 				case EEM_Payment::status_id_cancelled :
2003
-					if ( empty( $msg ) ) {
2003
+					if (empty($msg)) {
2004 2004
 						$msg = _n(
2005 2005
 							'Payment cancelled. Please try again.',
2006 2006
 							'Payment cancelled. Please try again or select another method of payment.',
2007
-							count( $this->checkout->available_payment_methods ),
2007
+							count($this->checkout->available_payment_methods),
2008 2008
 							'event_espresso'
2009 2009
 						);
2010 2010
 					}
2011
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
2011
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
2012 2012
 					return false;
2013 2013
 					break;
2014 2014
 				// not enough payment
2015 2015
 				case EEM_Payment::status_id_declined :
2016
-					if ( empty( $msg ) ) {
2016
+					if (empty($msg)) {
2017 2017
 						$msg = _n(
2018 2018
 							'We\'re sorry but your payment was declined. Please try again.',
2019 2019
 							'We\'re sorry but your payment was declined. Please try again or select another method of payment.',
2020
-							count( $this->checkout->available_payment_methods ),
2020
+							count($this->checkout->available_payment_methods),
2021 2021
 							'event_espresso'
2022 2022
 						);
2023 2023
 					}
2024
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
2024
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
2025 2025
 					return false;
2026 2026
 					break;
2027 2027
 				// bad payment
2028 2028
 				case EEM_Payment::status_id_failed :
2029
-					if ( ! empty( $msg ) ) {
2030
-						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2029
+					if ( ! empty($msg)) {
2030
+						EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2031 2031
 						return false;
2032 2032
 					}
2033 2033
 					// default to error below
@@ -2036,7 +2036,7 @@  discard block
 block discarded – undo
2036 2036
 		}
2037 2037
 		// off-site payment gateway responses are too unreliable, so let's just assume that
2038 2038
 		// the payment processing is just running slower than the registrant's request
2039
-		if ( $payment_occurs === EE_PMT_Base::offsite ) {
2039
+		if ($payment_occurs === EE_PMT_Base::offsite) {
2040 2040
 			return true;
2041 2041
 		}
2042 2042
 		EE_Error::add_error(
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 					'event_espresso'
2047 2047
 				),
2048 2048
 				'<br/>',
2049
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
2049
+				EE_Registry::instance()->CFG->organization->get_pretty('email')
2050 2050
 			),
2051 2051
 			__FILE__,
2052 2052
 			__FUNCTION__,
@@ -2079,13 +2079,13 @@  discard block
 block discarded – undo
2079 2079
 	public function process_gateway_response() {
2080 2080
 		$payment = null;
2081 2081
 		// how have they chosen to pay?
2082
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
2082
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
2083 2083
 		// get EE_Payment_Method object
2084
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
2084
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
2085 2085
 			$this->checkout->continue_reg = false;
2086 2086
 			return false;
2087 2087
 		}
2088
-		if ( ! $this->checkout->payment_method->is_off_site() ) {
2088
+		if ( ! $this->checkout->payment_method->is_off_site()) {
2089 2089
 			return false;
2090 2090
 		}
2091 2091
 		$this->_validate_offsite_return();
@@ -2099,23 +2099,23 @@  discard block
 block discarded – undo
2099 2099
 		//	true
2100 2100
 		//);
2101 2101
 		// verify TXN
2102
-		if ( $this->checkout->transaction instanceof EE_Transaction ) {
2102
+		if ($this->checkout->transaction instanceof EE_Transaction) {
2103 2103
 			$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
2104
-			if ( ! $gateway instanceof EE_Offsite_Gateway ) {
2104
+			if ( ! $gateway instanceof EE_Offsite_Gateway) {
2105 2105
 				$this->checkout->continue_reg = false;
2106 2106
 				return false;
2107 2107
 			}
2108
-			$payment = $this->_process_off_site_payment( $gateway );
2109
-			$payment = $this->_process_cancelled_payments( $payment );
2110
-			$payment = $this->_validate_payment( $payment );
2108
+			$payment = $this->_process_off_site_payment($gateway);
2109
+			$payment = $this->_process_cancelled_payments($payment);
2110
+			$payment = $this->_validate_payment($payment);
2111 2111
 			// if payment was not declined by the payment gateway or cancelled by the registrant
2112
-			if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) {
2112
+			if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) {
2113 2113
 				//$this->_setup_redirect_for_next_step();
2114 2114
 				// store that for later
2115 2115
 				$this->checkout->payment = $payment;
2116 2116
 				// mark this reg step as completed, as long as gateway doesn't use a separate IPN request,
2117 2117
 				// because we will complete this step during the IPN processing then
2118
-				if ( $gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request() ) {
2118
+				if ($gateway instanceof EE_Offsite_Gateway && ! $this->handle_IPN_in_this_request()) {
2119 2119
 					$this->set_completed();
2120 2120
 				}
2121 2121
 				return true;
@@ -2139,21 +2139,21 @@  discard block
 block discarded – undo
2139 2139
 	 * @throws \EE_Error
2140 2140
 	 */
2141 2141
 	private function _validate_offsite_return() {
2142
-		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
2143
-		if ( $TXN_ID !== $this->checkout->transaction->ID() ) {
2142
+		$TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0);
2143
+		if ($TXN_ID !== $this->checkout->transaction->ID()) {
2144 2144
 			// Houston... we might have a problem
2145 2145
 			$invalid_TXN = false;
2146 2146
 			// first gather some info
2147
-			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
2147
+			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
2148 2148
 			$primary_registrant = $valid_TXN instanceof EE_Transaction
2149 2149
 				? $valid_TXN->primary_registration()
2150 2150
 				: null;
2151 2151
 			// let's start by retrieving the cart for this TXN
2152
-			$cart = $this->checkout->get_cart_for_transaction( $this->checkout->transaction );
2153
-			if ( $cart instanceof EE_Cart ) {
2152
+			$cart = $this->checkout->get_cart_for_transaction($this->checkout->transaction);
2153
+			if ($cart instanceof EE_Cart) {
2154 2154
 				// verify that the current cart has tickets
2155 2155
 				$tickets = $cart->get_tickets();
2156
-				if ( empty( $tickets ) ) {
2156
+				if (empty($tickets)) {
2157 2157
 					$invalid_TXN = true;
2158 2158
 				}
2159 2159
 			} else {
@@ -2163,39 +2163,39 @@  discard block
 block discarded – undo
2163 2163
 				? $primary_registrant->session_ID()
2164 2164
 				: null;
2165 2165
 			// validate current Session ID and compare against valid TXN session ID
2166
-			if ( EE_Session::instance()->id() === null ) {
2166
+			if (EE_Session::instance()->id() === null) {
2167 2167
 				$invalid_TXN = true;
2168
-			} else if ( EE_Session::instance()->id() === $valid_TXN_SID ) {
2168
+			} else if (EE_Session::instance()->id() === $valid_TXN_SID) {
2169 2169
 				// WARNING !!!
2170 2170
 				// this could be PayPal sending back duplicate requests (ya they do that)
2171 2171
 				// or it **could** mean someone is simply registering AGAIN after having just done so
2172 2172
 				// so now we need to determine if this current TXN looks valid or not
2173 2173
 				/** @type EE_Transaction_Processor $transaction_processor */
2174
-				$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
2174
+				$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
2175 2175
 				// has this step even been started ?
2176
-				if ( $transaction_processor->reg_step_completed( $this->checkout->transaction, $this->slug() === false )
2176
+				if ($transaction_processor->reg_step_completed($this->checkout->transaction, $this->slug() === false)
2177 2177
 				) {
2178 2178
 					// really? you're half way through this reg step, but you never started it ?
2179 2179
 					$invalid_TXN = true;
2180 2180
 				}
2181 2181
 			}
2182
-			if ( $invalid_TXN ) {
2182
+			if ($invalid_TXN) {
2183 2183
 				// is the valid TXN completed ?
2184
-				if ( $valid_TXN instanceof EE_Transaction ) {
2184
+				if ($valid_TXN instanceof EE_Transaction) {
2185 2185
 					/** @type EE_Transaction_Processor $transaction_processor */
2186
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
2186
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
2187 2187
 					// has this step even been started ?
2188
-					$reg_step_completed = $transaction_processor->reg_step_completed( $valid_TXN, $this->slug() );
2189
-					if ( $reg_step_completed !== false && $reg_step_completed !== true ) {
2188
+					$reg_step_completed = $transaction_processor->reg_step_completed($valid_TXN, $this->slug());
2189
+					if ($reg_step_completed !== false && $reg_step_completed !== true) {
2190 2190
 						// so it **looks** like this is a double request from PayPal
2191 2191
 						// so let's try to pick up where we left off
2192 2192
 						$this->checkout->transaction = $valid_TXN;
2193
-						$this->checkout->refresh_all_entities( true );
2193
+						$this->checkout->refresh_all_entities(true);
2194 2194
 						return;
2195 2195
 					}
2196 2196
 				}
2197 2197
 				// you appear to be lost?
2198
-				$this->_redirect_wayward_request( $primary_registrant );
2198
+				$this->_redirect_wayward_request($primary_registrant);
2199 2199
 			}
2200 2200
 		}
2201 2201
 	}
@@ -2210,14 +2210,14 @@  discard block
 block discarded – undo
2210 2210
 	 * @return bool
2211 2211
 	 * @throws \EE_Error
2212 2212
 	 */
2213
-	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
2214
-		if ( ! $primary_registrant instanceof EE_Registration ) {
2213
+	private function _redirect_wayward_request(EE_Registration $primary_registrant) {
2214
+		if ( ! $primary_registrant instanceof EE_Registration) {
2215 2215
 			// try redirecting based on the current TXN
2216 2216
 			$primary_registrant = $this->checkout->transaction instanceof EE_Transaction
2217 2217
 				? $this->checkout->transaction->primary_registration()
2218 2218
 				: null;
2219 2219
 		}
2220
-		if ( ! $primary_registrant instanceof EE_Registration ) {
2220
+		if ( ! $primary_registrant instanceof EE_Registration) {
2221 2221
 			EE_Error::add_error(
2222 2222
 				sprintf(
2223 2223
 					__(
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
 						'event_espresso'
2226 2226
 					),
2227 2227
 					'<br/>',
2228
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
2228
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
2229 2229
 				),
2230 2230
 				__FILE__,
2231 2231
 				__FUNCTION__,
@@ -2256,17 +2256,17 @@  discard block
 block discarded – undo
2256 2256
 	 * @return \EE_Payment
2257 2257
 	 * @throws \EE_Error
2258 2258
 	 */
2259
-	private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) {
2259
+	private function _process_off_site_payment(EE_Offsite_Gateway $gateway) {
2260 2260
 		try {
2261 2261
 			$request_data = \EE_Registry::instance()->REQ->params();
2262 2262
 			// if gateway uses_separate_IPN_request, then we don't have to process the IPN manually
2263 2263
 			$this->set_handle_IPN_in_this_request(
2264
-				$gateway->handle_IPN_in_this_request( $request_data, false )
2264
+				$gateway->handle_IPN_in_this_request($request_data, false)
2265 2265
 			);
2266
-			if ( $this->handle_IPN_in_this_request() ) {
2266
+			if ($this->handle_IPN_in_this_request()) {
2267 2267
 				// get payment details and process results
2268 2268
 				/** @type EE_Payment_Processor $payment_processor */
2269
-				$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
2269
+				$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
2270 2270
 				$payment = $payment_processor->process_ipn(
2271 2271
 					$request_data,
2272 2272
 					$this->checkout->transaction,
@@ -2279,14 +2279,14 @@  discard block
 block discarded – undo
2279 2279
 				$payment = $this->checkout->transaction->last_payment();
2280 2280
 				//$payment_source = 'last_payment';
2281 2281
 			}
2282
-		} catch ( Exception $e ) {
2282
+		} catch (Exception $e) {
2283 2283
 			// let's just eat the exception and try to move on using any previously set payment info
2284 2284
 			$payment = $this->checkout->transaction->last_payment();
2285 2285
 			//$payment_source = 'last_payment after Exception';
2286 2286
 			// but if we STILL don't have a payment object
2287
-			if ( ! $payment instanceof EE_Payment ) {
2287
+			if ( ! $payment instanceof EE_Payment) {
2288 2288
 				// then we'll object ! ( not object like a thing... but object like what a lawyer says ! )
2289
-				$this->_handle_payment_processor_exception( $e );
2289
+				$this->_handle_payment_processor_exception($e);
2290 2290
 			}
2291 2291
 		}
2292 2292
 		// DEBUG LOG
@@ -2311,13 +2311,13 @@  discard block
 block discarded – undo
2311 2311
 	 * @return EE_Payment | FALSE
2312 2312
 	 * @throws \EE_Error
2313 2313
 	 */
2314
-	private function _process_cancelled_payments( $payment = null ) {
2314
+	private function _process_cancelled_payments($payment = null) {
2315 2315
 		if (
2316 2316
 			$payment instanceof EE_Payment
2317
-			&& isset( $_REQUEST['ee_cancel_payment'] )
2317
+			&& isset($_REQUEST['ee_cancel_payment'])
2318 2318
 			&& $payment->status() === EEM_Payment::status_id_failed
2319 2319
 		) {
2320
-			$payment->set_status( EEM_Payment::status_id_cancelled );
2320
+			$payment->set_status(EEM_Payment::status_id_cancelled);
2321 2321
 		}
2322 2322
 		return $payment;
2323 2323
 	}
@@ -2334,14 +2334,14 @@  discard block
 block discarded – undo
2334 2334
 	public function get_transaction_details_for_gateways() {
2335 2335
 		$txn_details = array();
2336 2336
 		// ya gotta make a choice man
2337
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
2337
+		if (empty($this->checkout->selected_method_of_payment)) {
2338 2338
 			$txn_details = array(
2339
-				'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' )
2339
+				'error' => __('Please select a method of payment before proceeding.', 'event_espresso')
2340 2340
 			);
2341 2341
 		}
2342 2342
 		// get EE_Payment_Method object
2343 2343
 		if (
2344
-			empty( $txn_details )
2344
+			empty($txn_details)
2345 2345
 			&&
2346 2346
 			! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()
2347 2347
 		) {
@@ -2353,8 +2353,8 @@  discard block
 block discarded – undo
2353 2353
 				)
2354 2354
 			);
2355 2355
 		}
2356
-		if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) {
2357
-			$return_url = $this->_get_return_url( $this->checkout->payment_method );
2356
+		if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) {
2357
+			$return_url = $this->_get_return_url($this->checkout->payment_method);
2358 2358
 			$txn_details = array(
2359 2359
 				'TXN_ID'         => $this->checkout->transaction->ID(),
2360 2360
 				'TXN_timestamp'  => $this->checkout->transaction->datetime(),
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
 				'PMD_ID'         => $this->checkout->transaction->payment_method_ID(),
2366 2366
 				'payment_amount' => $this->checkout->amount_owing,
2367 2367
 				'return_url'     => $return_url,
2368
-				'cancel_url'     => add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ),
2368
+				'cancel_url'     => add_query_arg(array('ee_cancel_payment' => true), $return_url),
2369 2369
 				'notify_url'     => EE_Config::instance()->core->txn_page_url(
2370 2370
 					array(
2371 2371
 						'e_reg_url_link'    => $this->checkout->transaction->primary_registration()->reg_url_link(),
@@ -2374,7 +2374,7 @@  discard block
 block discarded – undo
2374 2374
 				)
2375 2375
 			);
2376 2376
 		}
2377
-		echo json_encode( $txn_details );
2377
+		echo json_encode($txn_details);
2378 2378
 		exit();
2379 2379
 	}
2380 2380
 
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_Checkout.class.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_Checkout
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_Checkout
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_Checkout {
15 15
 
16 16
 	/**
@@ -792,10 +792,10 @@  discard block
 block discarded – undo
792 792
 	 */
793 793
 	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
794 794
 		return ! $this->revisit
795
-		       || $this->primary_revisit
796
-		       || (
797
-			       $this->revisit && $this->reg_url_link === $registration->reg_url_link()
798
-		       )
795
+			   || $this->primary_revisit
796
+			   || (
797
+				   $this->revisit && $this->reg_url_link === $registration->reg_url_link()
798
+			   )
799 799
 			? true
800 800
 			: false;
801 801
 	}
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 	/**
253 253
 	 * returns true if ANY reg status was updated during checkout
254
-	 * @return array
254
+	 * @return boolean
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257 257
 		foreach ( $this->reg_status_updated as $reg_status ) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 	/**
278 278
 	 * @param $REG_ID
279
-	 * @param $reg_status
279
+	 * @param boolean $reg_status
280 280
 	 */
281 281
 	public function set_reg_status_updated( $REG_ID, $reg_status ) {
282 282
 		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 	 * 	reset_reg_steps
634 634
 	 *
635 635
 	 * 	@access public
636
-	 * 	@return 	bool
636
+	 * 	@return 	boolean|null
637 637
 	 */
638 638
 	public function reset_reg_steps() {
639 639
 		$this->sort_reg_steps();
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 	 *    stores whether any updates were made to the TXN or it's related registrations
749 749
 	 *
750 750
 	 * @access public
751
-	 * @return    bool
751
+	 * @return    boolean|null
752 752
 	 * @throws \EE_Error
753 753
 	 */
754 754
 	public function track_transaction_and_registration_status_updates() {
@@ -1110,6 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 	 *
1111 1111
 	 * @param    string | int    $reg_cache_ID
1112 1112
 	 * @param    EE_Registration $registration
1113
+	 * @param integer $reg_cache_ID
1113 1114
 	 * @return void
1114 1115
 	 * @throws \EE_Error
1115 1116
 	 */
Please login to merge, or discard this patch.
Spacing   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		$this->reg_page_base_url = EE_Registry::instance()->CFG->core->reg_page_url();
243 243
 		$this->thank_you_page_url = EE_Registry::instance()->CFG->core->thank_you_page_url();
244 244
 		$this->cancel_page_url = EE_Registry::instance()->CFG->core->cancel_page_url();
245
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', TRUE );
245
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', TRUE);
246 246
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->ajax;
247
-		$this->reg_cache_where_params = array( 'order_by' => array( 'REG_count' => 'ASC' ));
247
+		$this->reg_cache_where_params = array('order_by' => array('REG_count' => 'ASC'));
248 248
 	}
249 249
 
250 250
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 * @return array
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257
-		foreach ( $this->reg_status_updated as $reg_status ) {
258
-			if ( $reg_status ) {
257
+		foreach ($this->reg_status_updated as $reg_status) {
258
+			if ($reg_status) {
259 259
 				return true;
260 260
 			}
261 261
 		}
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
 	 * @param $REG_ID
269 269
 	 * @return array
270 270
 	 */
271
-	public function reg_status_updated( $REG_ID ) {
272
-		return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false;
271
+	public function reg_status_updated($REG_ID) {
272
+		return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false;
273 273
 	}
274 274
 
275 275
 
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	 * @param $REG_ID
279 279
 	 * @param $reg_status
280 280
 	 */
281
-	public function set_reg_status_updated( $REG_ID, $reg_status ) {
282
-		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
281
+	public function set_reg_status_updated($REG_ID, $reg_status) {
282
+		$this->reg_status_updated[$REG_ID] = filter_var($reg_status, FILTER_VALIDATE_BOOLEAN);
283 283
 	}
284 284
 
285 285
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	 * can ONLY be set by the  Finalize_Registration reg step
301 301
 	 */
302 302
 	public function set_exit_spco() {
303
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
303
+		if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
304 304
 			$this->exit_spco = true;
305 305
 		}
306 306
 	}
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
 	 */
318 318
 	public function reset_for_current_request() {
319 319
 		$this->process_form_submission = FALSE;
320
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true );
320
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true);
321 321
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax;
322 322
 		$this->continue_reg = true;
323 323
 		$this->redirect = false;
324 324
 		// don't reset the cached redirect form if we're about to be asked to display it !!!
325
-		if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) {
325
+		if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') {
326 326
 			$this->redirect_form = '';
327 327
 		}
328 328
 		$this->redirect_url = '';
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
 	 * @param EE_SPCO_Reg_Step $reg_step_obj
340 340
 	 * @return    void
341 341
 	 */
342
-	public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) {
343
-		$this->reg_steps[ $reg_step_obj->slug()  ] = $reg_step_obj;
342
+	public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) {
343
+		$this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj;
344 344
 	}
345 345
 
346 346
 
@@ -356,22 +356,22 @@  discard block
 block discarded – undo
356 356
 	 * @return    void
357 357
 	 * @throws \EE_Error
358 358
 	 */
359
-	public function skip_reg_step( $reg_step_slug = '' ) {
360
-		$step_to_skip = $this->find_reg_step( $reg_step_slug );
361
-		if ( $step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step() ) {
362
-			$step_to_skip->set_is_current_step( false );
359
+	public function skip_reg_step($reg_step_slug = '') {
360
+		$step_to_skip = $this->find_reg_step($reg_step_slug);
361
+		if ($step_to_skip instanceof EE_SPCO_Reg_Step && $step_to_skip->is_current_step()) {
362
+			$step_to_skip->set_is_current_step(false);
363 363
 			$step_to_skip->set_completed();
364 364
 			// advance to the next step
365
-			$this->set_current_step( $this->next_step->slug() );
365
+			$this->set_current_step($this->next_step->slug());
366 366
 			// also reset the step param in the request in case any other code references that directly
367
-			EE_Registry::instance()->REQ->set( 'step', $this->current_step->slug() );
367
+			EE_Registry::instance()->REQ->set('step', $this->current_step->slug());
368 368
 			// since we are skipping a step and setting the current step to be what was previously the next step,
369 369
 			// we need to check that the next step is now correct, and not still set to the current step.
370
-			if ( $this->current_step->slug() === $this->next_step->slug() ) {
370
+			if ($this->current_step->slug() === $this->next_step->slug()) {
371 371
 				// correctly setup the next step
372 372
 				$this->set_next_step();
373 373
 			}
374
-			$this->set_reg_step_initiated( $this->current_step );
374
+			$this->set_reg_step_initiated($this->current_step);
375 375
 		}
376 376
 	}
377 377
 
@@ -385,16 +385,16 @@  discard block
 block discarded – undo
385 385
 	 * @param bool   $reset whether to reset reg steps after removal
386 386
 	 * @throws EE_Error
387 387
 	 */
388
-	public function remove_reg_step( $reg_step_slug = '', $reset = true ) {
389
-		unset( $this->reg_steps[ $reg_step_slug  ] );
390
-		if ( $this->transaction instanceof EE_Transaction ) {
388
+	public function remove_reg_step($reg_step_slug = '', $reset = true) {
389
+		unset($this->reg_steps[$reg_step_slug]);
390
+		if ($this->transaction instanceof EE_Transaction) {
391 391
 			/** @type EE_Transaction_Processor $transaction_processor */
392
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
392
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
393 393
 			// now remove reg step from TXN and save
394
-			$transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug );
394
+			$transaction_processor->remove_reg_step($this->transaction, $reg_step_slug);
395 395
 			$this->transaction->save();
396 396
 		}
397
-		if ( $reset ) {
397
+		if ($reset) {
398 398
 			$this->reset_reg_steps();
399 399
 		}
400 400
 	}
@@ -409,9 +409,9 @@  discard block
 block discarded – undo
409 409
 	 * @param int    $order
410 410
 	 * @return    void
411 411
 	 */
412
-	public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) {
413
-		if ( isset( $this->reg_steps[ $reg_step_slug  ] )) {
414
-			$this->reg_steps[ $reg_step_slug ]->set_order( $order );
412
+	public function set_reg_step_order($reg_step_slug = '', $order = 100) {
413
+		if (isset($this->reg_steps[$reg_step_slug])) {
414
+			$this->reg_steps[$reg_step_slug]->set_order($order);
415 415
 		}
416 416
 	}
417 417
 
@@ -424,25 +424,25 @@  discard block
 block discarded – undo
424 424
 	 * @param string $current_step
425 425
 	 * @return    void
426 426
 	 */
427
-	public function set_current_step( $current_step ) {
427
+	public function set_current_step($current_step) {
428 428
 		// grab what step we're on
429
-		$this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps );
429
+		$this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps);
430 430
 		// verify instance
431
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step ) {
431
+		if ($this->current_step instanceof EE_SPCO_Reg_Step) {
432 432
 			// we don't want to repeat completed steps if this is the first time through SPCO
433
-			if ( $this->continue_reg && ! $this->revisit && $this->current_step->completed() ) {
433
+			if ($this->continue_reg && ! $this->revisit && $this->current_step->completed()) {
434 434
 				// so advance to the next step
435 435
 				$this->set_next_step();
436
-				if ( $this->next_step instanceof EE_SPCO_Reg_Step ) {
436
+				if ($this->next_step instanceof EE_SPCO_Reg_Step) {
437 437
 					// and attempt to set it as the current step
438
-					$this->set_current_step( $this->next_step->slug() );
438
+					$this->set_current_step($this->next_step->slug());
439 439
 				}
440 440
 				return;
441 441
 			}
442
-			$this->current_step->set_is_current_step( TRUE );
442
+			$this->current_step->set_is_current_step(TRUE);
443 443
 		} else {
444 444
 			EE_Error::add_error(
445
-				__( 'The current step could not be set.', 'event_espresso' ),
445
+				__('The current step could not be set.', 'event_espresso'),
446 446
 				__FILE__, __FUNCTION__, __LINE__
447 447
 			);
448 448
 		}
@@ -459,20 +459,20 @@  discard block
 block discarded – undo
459 459
 	 */
460 460
 	public function set_next_step() {
461 461
 		// set pointer to start of array
462
-		reset( $this->reg_steps );
462
+		reset($this->reg_steps);
463 463
 		// if there is more than one step
464
-		if ( count( $this->reg_steps ) > 1 ) {
464
+		if (count($this->reg_steps) > 1) {
465 465
 			// advance to the current step and set pointer
466
-			while ( key( $this->reg_steps ) !== $this->current_step->slug() && key( $this->reg_steps ) !== '' ) {
467
-				next( $this->reg_steps );
466
+			while (key($this->reg_steps) !== $this->current_step->slug() && key($this->reg_steps) !== '') {
467
+				next($this->reg_steps);
468 468
 			}
469 469
 		}
470 470
 		// advance one more spot ( if it exists )
471
-		$this->next_step = next( $this->reg_steps );
471
+		$this->next_step = next($this->reg_steps);
472 472
 		// verify instance
473
-		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step  : NULL;
473
+		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL;
474 474
 		// then back to current step to reset
475
-		prev( $this->reg_steps );
475
+		prev($this->reg_steps);
476 476
 	}
477 477
 
478 478
 
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 	 *  @return 	EE_SPCO_Reg_Step | null
487 487
 	 */
488 488
 	public function get_next_reg_step() {
489
-		$next = next( $this->reg_steps );
490
-		prev( $this->reg_steps );
489
+		$next = next($this->reg_steps);
490
+		prev($this->reg_steps);
491 491
 		return $next instanceof EE_SPCO_Reg_Step ? $next : null;
492 492
 	}
493 493
 
@@ -502,8 +502,8 @@  discard block
 block discarded – undo
502 502
 	 *  @return 	EE_SPCO_Reg_Step | null
503 503
 	 */
504 504
 	public function get_prev_reg_step() {
505
-		$prev = prev( $this->reg_steps );
506
-		next( $this->reg_steps );
505
+		$prev = prev($this->reg_steps);
506
+		next($this->reg_steps);
507 507
 		return $prev instanceof EE_SPCO_Reg_Step ? $prev : null;
508 508
 	}
509 509
 
@@ -516,8 +516,8 @@  discard block
 block discarded – undo
516 516
 	 * @return void
517 517
 	 */
518 518
 	public function sort_reg_steps() {
519
-		$reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' );
520
-		uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback ));
519
+		$reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback');
520
+		uasort($this->reg_steps, array($this, $reg_step_sorting_callback));
521 521
 	}
522 522
 
523 523
 
@@ -530,19 +530,19 @@  discard block
 block discarded – undo
530 530
 	 * @param string $reg_step_slug
531 531
 	 * @return EE_SPCO_Reg_Step|null
532 532
 	 */
533
-	public function find_reg_step( $reg_step_slug = '' ) {
534
-		if ( ! empty( $reg_step_slug ) ) {
533
+	public function find_reg_step($reg_step_slug = '') {
534
+		if ( ! empty($reg_step_slug)) {
535 535
 			// copy reg step array
536 536
 			$reg_steps = $this->reg_steps;
537 537
 			// set pointer to start of array
538
-			reset( $reg_steps );
538
+			reset($reg_steps);
539 539
 			// if there is more than one step
540
-			if ( count( $reg_steps ) > 1 ) {
540
+			if (count($reg_steps) > 1) {
541 541
 				// advance to the current step and set pointer
542
-				while ( key( $reg_steps ) !== $reg_step_slug && key( $reg_steps ) !== '' ) {
543
-					next( $reg_steps );
542
+				while (key($reg_steps) !== $reg_step_slug && key($reg_steps) !== '') {
543
+					next($reg_steps);
544 544
 				}
545
-				return current( $reg_steps );
545
+				return current($reg_steps);
546 546
 			}
547 547
 		}
548 548
 		return null;
@@ -558,17 +558,17 @@  discard block
 block discarded – undo
558 558
 	 * @param EE_SPCO_Reg_Step $reg_step_B
559 559
 	 * @return array()
560 560
 	 */
561
-	public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) {
561
+	public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) {
562 562
 		// send finalize_registration step to the end of the array
563
-		if ( $reg_step_A->slug() === 'finalize_registration' ) {
563
+		if ($reg_step_A->slug() === 'finalize_registration') {
564 564
 			return 1;
565
-		} else if ( $reg_step_B->slug() === 'finalize_registration' ) {
565
+		} else if ($reg_step_B->slug() === 'finalize_registration') {
566 566
 			return -1;
567 567
 		}
568
-		if ( $reg_step_A->order() === $reg_step_B->order() ) {
568
+		if ($reg_step_A->order() === $reg_step_B->order()) {
569 569
 			return 0;
570 570
 		}
571
-		return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1;
571
+		return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1;
572 572
 	}
573 573
 
574 574
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 	 * @param    EE_SPCO_Reg_Step $reg_step
581 581
 	 * @throws \EE_Error
582 582
 	 */
583
-	public function set_reg_step_initiated( EE_SPCO_Reg_Step $reg_step ) {
583
+	public function set_reg_step_initiated(EE_SPCO_Reg_Step $reg_step) {
584 584
 		// call set_reg_step_initiated ???
585 585
 		if (
586 586
 			// first time visiting SPCO ?
@@ -593,13 +593,13 @@  discard block
 block discarded – undo
593 593
 			)
594 594
 		) {
595 595
 			/** @type EE_Transaction_Processor $transaction_processor */
596
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
596
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
597 597
 			// set the start time for this reg step
598
-			if ( ! $transaction_processor->set_reg_step_initiated( $this->transaction, $reg_step->slug() ) ) {
599
-				if ( WP_DEBUG ) {
598
+			if ( ! $transaction_processor->set_reg_step_initiated($this->transaction, $reg_step->slug())) {
599
+				if (WP_DEBUG) {
600 600
 					EE_Error::add_error(
601 601
 						sprintf(
602
-							__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ),
602
+							__('The "%1$s" registration step was not initialized properly.', 'event_espresso'),
603 603
 							$reg_step->name()
604 604
 						),
605 605
 						__FILE__, __FUNCTION__, __LINE__
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
 	 * 	@return 	void
619 619
 	 */
620 620
 	public function set_reg_step_JSON_info() {
621
-		EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array();
621
+		EE_Registry::$i18n_js_strings['reg_steps'] = array();
622 622
 		// pass basic reg step data to JS
623
-		foreach ( $this->reg_steps as $reg_step ) {
624
-			EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug();
623
+		foreach ($this->reg_steps as $reg_step) {
624
+			EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug();
625 625
 		}
626 626
 		// reset reg step html
627 627
 //		$this->json_response->set_reg_step_html( '' );
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 	 */
638 638
 	public function reset_reg_steps() {
639 639
 		$this->sort_reg_steps();
640
-		$this->set_current_step( EE_Registry::instance()->REQ->get( 'step' ));
640
+		$this->set_current_step(EE_Registry::instance()->REQ->get('step'));
641 641
 		$this->set_next_step();
642 642
 		// the text that appears on the reg step form submit button
643 643
 		$this->current_step->set_submit_button_text();
@@ -654,9 +654,9 @@  discard block
 block discarded – undo
654 654
 	 */
655 655
 	public function get_registration_time_limit() {
656 656
 
657
-		$registration_time_limit = (float)( EE_Registry::instance()	->SSN->expiration() - time() );
657
+		$registration_time_limit = (float) (EE_Registry::instance()	->SSN->expiration() - time());
658 658
 		$time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s';
659
-		$registration_time_limit = gmdate( $time_limit_format, $registration_time_limit );
659
+		$registration_time_limit = gmdate($time_limit_format, $registration_time_limit);
660 660
 		return apply_filters(
661 661
 			'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit',
662 662
 			$registration_time_limit
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 		//		overpaid TXN
677 677
 		//		free TXN ( total = 0.00 )
678 678
 		// then payment required is TRUE
679
-		return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE;
679
+		return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
680 680
 	}
681 681
 
682 682
 
@@ -688,12 +688,12 @@  discard block
 block discarded – undo
688 688
 	 * @param EE_Transaction $transaction
689 689
 	 * @return EE_Cart
690 690
 	 */
691
-	public function get_cart_for_transaction( $transaction ) {
692
-		$session = EE_Registry::instance()->load_core( 'Session' );
693
-		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction, $session ) : null;
691
+	public function get_cart_for_transaction($transaction) {
692
+		$session = EE_Registry::instance()->load_core('Session');
693
+		$cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction, $session) : null;
694 694
 		// verify cart
695
-		if ( ! $cart instanceof EE_Cart ) {
696
-			$cart = EE_Registry::instance()->load_core( 'Cart' );
695
+		if ( ! $cart instanceof EE_Cart) {
696
+			$cart = EE_Registry::instance()->load_core('Cart');
697 697
 		}
698 698
 
699 699
 		return $cart;
@@ -709,8 +709,8 @@  discard block
 block discarded – undo
709 709
 	 */
710 710
 	public function initialize_txn_reg_steps_array() {
711 711
 		$txn_reg_steps_array = array();
712
-		foreach ( $this->reg_steps as $reg_step ) {
713
-			$txn_reg_steps_array[ $reg_step->slug() ] = FALSE;
712
+		foreach ($this->reg_steps as $reg_step) {
713
+			$txn_reg_steps_array[$reg_step->slug()] = FALSE;
714 714
 		}
715 715
 		return $txn_reg_steps_array;
716 716
 	}
@@ -727,15 +727,15 @@  discard block
 block discarded – undo
727 727
 	public function update_txn_reg_steps_array() {
728 728
 		$updated = false;
729 729
 		/** @type EE_Transaction_Processor $transaction_processor */
730
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
731
-		foreach ( $this->reg_steps as $reg_step ) {
732
-			if ( $reg_step->completed() ) {
733
-				$updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() )
730
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
731
+		foreach ($this->reg_steps as $reg_step) {
732
+			if ($reg_step->completed()) {
733
+				$updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug())
734 734
 					? true
735 735
 					: $updated;
736 736
 			}
737 737
 		}
738
-		if ( $updated ) {
738
+		if ($updated) {
739 739
 			$this->transaction->save();
740 740
 		}
741 741
 		return $updated;
@@ -751,14 +751,14 @@  discard block
 block discarded – undo
751 751
 	 * @throws \EE_Error
752 752
 	 */
753 753
 	public function stash_transaction_and_checkout() {
754
-		if ( ! $this->revisit ) {
754
+		if ( ! $this->revisit) {
755 755
 			$this->update_txn_reg_steps_array();
756 756
 		}
757 757
 		$this->track_transaction_and_registration_status_updates();
758 758
 		// save all data to the db, but suppress errors
759 759
 		//$this->save_all_data( FALSE );
760 760
 		// cache the checkout in the session
761
-		EE_Registry::instance()->SSN->set_checkout( $this );
761
+		EE_Registry::instance()->SSN->set_checkout($this);
762 762
 	}
763 763
 
764 764
 
@@ -773,21 +773,21 @@  discard block
 block discarded – undo
773 773
 	 */
774 774
 	public function track_transaction_and_registration_status_updates() {
775 775
 		// verify the transaction
776
-		if ( $this->transaction instanceof EE_Transaction ) {
776
+		if ($this->transaction instanceof EE_Transaction) {
777 777
 			/** @type EE_Transaction_Payments $transaction_payments */
778
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
778
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
779 779
 			/** @type EE_Transaction_Processor $transaction_processor */
780
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
780
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
781 781
 			// has there been a TXN status change during this checkout?
782
-			if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) {
782
+			if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) {
783 783
 				$this->txn_status_updated = true;
784 784
 			}
785 785
 			/** @type EE_Registration_Processor $registration_processor */
786
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
786
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
787 787
 			// grab the saved registrations from the transaction
788
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) {
789
-				if ( $registration_processor->reg_status_updated( $registration->ID() ) ) {
790
-					$this->set_reg_status_updated( $registration->ID(), true );
788
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) {
789
+				if ($registration_processor->reg_status_updated($registration->ID())) {
790
+					$this->set_reg_status_updated($registration->ID(), true);
791 791
 				}
792 792
 			}
793 793
 		}
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 	 * @return    bool
809 809
 	 * @throws \EE_Error
810 810
 	 */
811
-	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
811
+	public function visit_allows_processing_of_this_registration(EE_Registration $registration) {
812 812
 		return ! $this->revisit
813 813
 		       || $this->primary_revisit
814 814
 		       || (
@@ -841,18 +841,18 @@  discard block
 block discarded – undo
841 841
 	 * @return bool
842 842
 	 * @throws \EE_Error
843 843
 	 */
844
-	public function save_all_data( $show_errors = TRUE ) {
844
+	public function save_all_data($show_errors = TRUE) {
845 845
 		// verify the transaction
846
-		if ( $this->transaction instanceof EE_Transaction ) {
846
+		if ($this->transaction instanceof EE_Transaction) {
847 847
 			// save to ensure that TXN has ID
848 848
 			$this->transaction->save();
849 849
 			// grab the saved registrations from the transaction
850
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as  $registration ) {
851
-				$this->_save_registration( $registration, $show_errors );
850
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as  $registration) {
851
+				$this->_save_registration($registration, $show_errors);
852 852
 			}
853 853
 		} else {
854
-			if ( $show_errors ) {
855
-				EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
854
+			if ($show_errors) {
855
+				EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
856 856
 			}
857 857
 			return FALSE;
858 858
 		}
@@ -869,32 +869,32 @@  discard block
 block discarded – undo
869 869
 	 * @return void
870 870
 	 * @throws \EE_Error
871 871
 	 */
872
-	private function _save_registration( $registration, $show_errors = TRUE  ) {
872
+	private function _save_registration($registration, $show_errors = TRUE) {
873 873
 		// verify object
874
-		if ( $registration instanceof EE_Registration ) {
874
+		if ($registration instanceof EE_Registration) {
875 875
 			// should this registration be processed during this visit ?
876
-			if ( $this->visit_allows_processing_of_this_registration( $registration ) ) {
876
+			if ($this->visit_allows_processing_of_this_registration($registration)) {
877 877
 				//set TXN ID
878
-				if ( ! $registration->transaction_ID() ) {
879
-					$registration->set_transaction_id( $this->transaction->ID() );
878
+				if ( ! $registration->transaction_ID()) {
879
+					$registration->set_transaction_id($this->transaction->ID());
880 880
 				}
881 881
 				// verify and save the attendee
882
-				$this->_save_registration_attendee( $registration, $show_errors );
882
+				$this->_save_registration_attendee($registration, $show_errors);
883 883
 				// save answers to reg form questions
884
-				$this->_save_registration_answers( $registration, $show_errors );
884
+				$this->_save_registration_answers($registration, $show_errors);
885 885
 				// save changes
886 886
 				$registration->save();
887 887
 				// update txn cache
888
-				if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) {
889
-					if ( $show_errors ) {
890
-						EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
888
+				if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) {
889
+					if ($show_errors) {
890
+						EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
891 891
 					}
892 892
 				}
893 893
 			}
894 894
 		} else {
895
-			if ( $show_errors ) {
895
+			if ($show_errors) {
896 896
 				EE_Error::add_error(
897
-					__( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ),
897
+					__('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'),
898 898
 					__FILE__, __FUNCTION__, __LINE__
899 899
 				);
900 900
 			}
@@ -911,25 +911,25 @@  discard block
 block discarded – undo
911 911
 	 * @return void
912 912
 	 * @throws \EE_Error
913 913
 	 */
914
-	private function _save_registration_attendee( $registration, $show_errors = TRUE ) {
915
-		if ( $registration->attendee() instanceof EE_Attendee ) {
914
+	private function _save_registration_attendee($registration, $show_errors = TRUE) {
915
+		if ($registration->attendee() instanceof EE_Attendee) {
916 916
 			// save so that ATT has ID
917 917
 			$registration->attendee()->save();
918
-			if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() ) ) {
919
-				if ( $show_errors ) {
918
+			if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) {
919
+				if ($show_errors) {
920 920
 					EE_Error::add_error(
921
-						__( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ),
921
+						__('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'),
922 922
 						__FILE__, __FUNCTION__, __LINE__
923 923
 					);
924 924
 				}
925 925
 			}
926 926
 		} else {
927
-			if ( $show_errors ) {
927
+			if ($show_errors) {
928 928
 				EE_Error::add_error(
929 929
 					sprintf(
930 930
 						'%1$s||%1$s $attendee = %2$s',
931
-						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
932
-						var_export( $registration->attendee(), true )
931
+						__('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'),
932
+						var_export($registration->attendee(), true)
933 933
 					),
934 934
 					__FILE__, __FUNCTION__, __LINE__
935 935
 				);
@@ -947,25 +947,25 @@  discard block
 block discarded – undo
947 947
 	 * @return void
948 948
 	 * @throws \EE_Error
949 949
 	 */
950
-	private function _save_registration_answers( $registration, $show_errors = TRUE ) {
950
+	private function _save_registration_answers($registration, $show_errors = TRUE) {
951 951
 		// now save the answers
952
-		foreach ( $registration->answers() as $cache_key => $answer ) {
952
+		foreach ($registration->answers() as $cache_key => $answer) {
953 953
 			// verify object
954
-			if ( $answer instanceof EE_Answer ) {
955
-				$answer->set_registration( $registration->ID() );
954
+			if ($answer instanceof EE_Answer) {
955
+				$answer->set_registration($registration->ID());
956 956
 				$answer->save();
957
-				if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) {
958
-					if ( $show_errors ) {
957
+				if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) {
958
+					if ($show_errors) {
959 959
 						EE_Error::add_error(
960
-							__( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ),
960
+							__('The newly saved Answer object could not be cached on the registration.', 'event_espresso'),
961 961
 							__FILE__, __FUNCTION__, __LINE__
962 962
 						);
963 963
 					}
964 964
 				}
965 965
 			} else {
966
-				if ( $show_errors ) {
966
+				if ($show_errors) {
967 967
 					EE_Error::add_error(
968
-						__( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ),
968
+						__('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'),
969 969
 						__FILE__, __FUNCTION__, __LINE__
970 970
 					);
971 971
 				}
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
 	 * @return bool
985 985
 	 * @throws \EE_Error
986 986
 	 */
987
-	public function refresh_all_entities( $from_db = false ) {
987
+	public function refresh_all_entities($from_db = false) {
988 988
 		$from_db = $this->current_step->is_final_step() || $this->action === 'process_gateway_response'
989 989
 			? true
990 990
 			: $from_db;
@@ -1008,11 +1008,11 @@  discard block
 block discarded – undo
1008 1008
 	 */
1009 1009
 	protected function refresh_from_db() {
1010 1010
 		// verify the transaction
1011
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
1011
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
1012 1012
 			// pull fresh TXN data from the db
1013
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() );
1013
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID());
1014 1014
 			// update EE_Checkout's cached primary_attendee object
1015
-			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction );
1015
+			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction);
1016 1016
 			// update EE_Checkout's cached payment object
1017 1017
 			$payment = $this->transaction->last_payment();
1018 1018
 			$this->payment = $payment instanceof EE_Payment ? $payment : $this->payment;
@@ -1020,9 +1020,9 @@  discard block
 block discarded – undo
1020 1020
 			$payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null;
1021 1021
 			$this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method;
1022 1022
 			//now refresh the cart, based on the TXN
1023
-			$this->cart = $this->get_cart_for_transaction( $this->transaction );
1023
+			$this->cart = $this->get_cart_for_transaction($this->transaction);
1024 1024
 		} else {
1025
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
1025
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1026 1026
 			return FALSE;
1027 1027
 		}
1028 1028
 		return TRUE;
@@ -1037,21 +1037,21 @@  discard block
 block discarded – undo
1037 1037
 	 * @return  EE_Attendee | null
1038 1038
 	 * @throws \EE_Error
1039 1039
 	 */
1040
-	protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) {
1040
+	protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) {
1041 1041
 
1042 1042
 		$primary_attendee_obj = null;
1043 1043
 		// grab the saved registrations from the transaction
1044
-		foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) {
1044
+		foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) {
1045 1045
 			// verify object
1046
-			if ( $registration instanceof EE_Registration ) {
1046
+			if ($registration instanceof EE_Registration) {
1047 1047
 				$attendee = $registration->attendee();
1048 1048
 				// verify object && maybe cache primary_attendee_obj ?
1049
-				if ( $attendee instanceof EE_Attendee&& $registration->is_primary_registrant() ) {
1049
+				if ($attendee instanceof EE_Attendee && $registration->is_primary_registrant()) {
1050 1050
 					$primary_attendee_obj = $attendee;
1051 1051
 				}
1052 1052
 			} else {
1053 1053
 				EE_Error::add_error(
1054
-						__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1054
+						__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1055 1055
 						__FILE__, __FUNCTION__, __LINE__
1056 1056
 				);
1057 1057
 			}
@@ -1072,45 +1072,45 @@  discard block
 block discarded – undo
1072 1072
 	 */
1073 1073
 	protected function refresh_entity_map() {
1074 1074
 		// verify the transaction
1075
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
1075
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
1076 1076
 			// never cache payment info
1077
-			$this->transaction->clear_cache( 'Payment' );
1077
+			$this->transaction->clear_cache('Payment');
1078 1078
 			/** @type EE_Transaction_Processor $transaction_processor */
1079
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1079
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1080 1080
 			// is the Payment Options Reg Step completed ?
1081
-			if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) {
1081
+			if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) {
1082 1082
 				// then check for payments and update TXN accordingly
1083 1083
 				/** @type EE_Transaction_Payments $transaction_payments */
1084
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
1085
-				$transaction_payments->calculate_total_payments_and_update_status( $this->transaction );
1084
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1085
+				$transaction_payments->calculate_total_payments_and_update_status($this->transaction);
1086 1086
 			}
1087 1087
 			// grab the saved registrations from the transaction
1088 1088
 			foreach (
1089
-				$this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration
1089
+				$this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration
1090 1090
 			) {
1091
-				$this->_refresh_registration( $reg_cache_ID, $registration );
1091
+				$this->_refresh_registration($reg_cache_ID, $registration);
1092 1092
 			}
1093 1093
 			// make sure our cached TXN is added to the model entity mapper
1094
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction );
1094
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction);
1095 1095
 
1096 1096
 		} else {
1097
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
1097
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1098 1098
 			return FALSE;
1099 1099
 		}
1100 1100
 		// verify and update the cart because inaccurate totals are not so much fun
1101
-		if ( $this->cart instanceof EE_Cart ) {
1101
+		if ($this->cart instanceof EE_Cart) {
1102 1102
 			$grand_total = $this->cart->get_grand_total();
1103
-			if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) {
1103
+			if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) {
1104 1104
 				$grand_total->recalculate_total_including_taxes();
1105 1105
 				$grand_total = $grand_total->get_model()->refresh_entity_map_with(
1106 1106
 					$this->cart->get_grand_total()->ID(),
1107 1107
 					$this->cart->get_grand_total()
1108 1108
 				);
1109 1109
 			}
1110
-			if ( $grand_total instanceof EE_Line_Item ) {
1111
-				$this->cart = EE_Cart::instance( $grand_total );
1110
+			if ($grand_total instanceof EE_Line_Item) {
1111
+				$this->cart = EE_Cart::instance($grand_total);
1112 1112
 			} else {
1113
-				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1113
+				EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1114 1114
 				return false;
1115 1115
 			}
1116 1116
 		}
@@ -1127,19 +1127,19 @@  discard block
 block discarded – undo
1127 1127
 	 * @return void
1128 1128
 	 * @throws \EE_Error
1129 1129
 	 */
1130
-	protected function _refresh_registration( $reg_cache_ID, $registration ) {
1130
+	protected function _refresh_registration($reg_cache_ID, $registration) {
1131 1131
 
1132 1132
 		// verify object
1133
-		if ( $registration instanceof EE_Registration ) {
1133
+		if ($registration instanceof EE_Registration) {
1134 1134
 			// update the entity mapper attendee
1135
-			$this->_refresh_registration_attendee( $registration );
1135
+			$this->_refresh_registration_attendee($registration);
1136 1136
 			// update the entity mapper answers for reg form questions
1137
-			$this->_refresh_registration_answers( $registration );
1137
+			$this->_refresh_registration_answers($registration);
1138 1138
 			// make sure the cached registration is added to the model entity mapper
1139
-			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1139
+			$registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
1140 1140
 		} else {
1141 1141
 			EE_Error::add_error(
1142
-				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1142
+				__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1143 1143
 				__FILE__, __FUNCTION__, __LINE__
1144 1144
 			);
1145 1145
 		}
@@ -1154,15 +1154,15 @@  discard block
 block discarded – undo
1154 1154
 	 * @return void
1155 1155
 	 * @throws \EE_Error
1156 1156
 	 */
1157
-	protected function _refresh_registration_attendee( $registration ) {
1157
+	protected function _refresh_registration_attendee($registration) {
1158 1158
 
1159 1159
 		$attendee = $registration->attendee();
1160 1160
 		// verify object
1161
-		if ( $attendee instanceof EE_Attendee && $attendee->ID() ) {
1161
+		if ($attendee instanceof EE_Attendee && $attendee->ID()) {
1162 1162
 			// make sure the cached attendee is added to the model entity mapper
1163
-			$registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee );
1163
+			$registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee);
1164 1164
 			// maybe cache primary_attendee_obj ?
1165
-			if ( $registration->is_primary_registrant() ) {
1165
+			if ($registration->is_primary_registrant()) {
1166 1166
 				$this->primary_attendee_obj = $attendee;
1167 1167
 			}
1168 1168
 		}
@@ -1177,19 +1177,19 @@  discard block
 block discarded – undo
1177 1177
 	 * @return void
1178 1178
 	 * @throws \EE_Error
1179 1179
 	 */
1180
-	protected function _refresh_registration_answers( $registration ) {
1180
+	protected function _refresh_registration_answers($registration) {
1181 1181
 
1182 1182
 		// now update the answers
1183
-		foreach ( $registration->answers() as $cache_key => $answer ) {
1183
+		foreach ($registration->answers() as $cache_key => $answer) {
1184 1184
 			// verify object
1185
-			if ( $answer instanceof EE_Answer ) {
1186
-				if ( $answer->ID() ) {
1185
+			if ($answer instanceof EE_Answer) {
1186
+				if ($answer->ID()) {
1187 1187
 					// make sure the cached answer is added to the model entity mapper
1188
-					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1188
+					$answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1189 1189
 				}
1190 1190
 			} else {
1191 1191
 				EE_Error::add_error(
1192
-					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1192
+					__('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1193 1193
 					__FILE__, __FUNCTION__, __LINE__
1194 1194
 				);
1195 1195
 			}
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 	 * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object
1205 1205
 	 */
1206 1206
 	public function __wakeup() {
1207
-		foreach ( $this->reg_steps as $reg_step ) {
1207
+		foreach ($this->reg_steps as $reg_step) {
1208 1208
 			$reg_step->checkout = $this;
1209 1209
 		}
1210 1210
 	}
@@ -1221,12 +1221,12 @@  discard block
 block discarded – undo
1221 1221
 	 * @param bool   $display_request
1222 1222
 	 * @throws \EE_Error
1223 1223
 	 */
1224
-	public function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) {
1224
+	public function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) {
1225 1225
 		$disabled = true;
1226
-		if ( WP_DEBUG && ! $disabled ) {
1227
-			$debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() );
1226
+		if (WP_DEBUG && ! $disabled) {
1227
+			$debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array());
1228 1228
 			$default_data = array(
1229
-				$class 		=> $func . '() : ' . $line,
1229
+				$class 		=> $func.'() : '.$line,
1230 1230
 				'request->step' 		=> $this->step,
1231 1231
 				'request->action' 	=> $this->action,
1232 1232
 				'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ?
@@ -1238,24 +1238,24 @@  discard block
 block discarded – undo
1238 1238
 				'reg_url_link' => $this->reg_url_link,
1239 1239
 				'REQ' => $display_request ? $_REQUEST : '',
1240 1240
 			);
1241
-			if ( $this->transaction instanceof EE_Transaction ) {
1242
-				$default_data[ 'TXN_status' ] 		= $this->transaction->status_ID();
1243
-				$default_data[ 'TXN_reg_steps' ] 	= $this->transaction->reg_steps();
1244
-				foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) {
1245
-					$default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID();
1241
+			if ($this->transaction instanceof EE_Transaction) {
1242
+				$default_data['TXN_status'] = $this->transaction->status_ID();
1243
+				$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
1244
+				foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
1245
+					$default_data['registrations'][$REG_ID] = $registration->status_ID();
1246 1246
 				}
1247
-				if ( $this->transaction->ID() ) {
1248
-					$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
1247
+				if ($this->transaction->ID()) {
1248
+					$TXN_ID = 'EE_Transaction: '.$this->transaction->ID();
1249 1249
 					// don't serialize objects
1250
-					$info = $this->_strip_objects( $info );
1251
-					if ( ! isset( $debug_data[ $TXN_ID ] ) ) {
1252
-						$debug_data[ $TXN_ID ] = array();
1250
+					$info = $this->_strip_objects($info);
1251
+					if ( ! isset($debug_data[$TXN_ID])) {
1252
+						$debug_data[$TXN_ID] = array();
1253 1253
 					}
1254
-					$debug_data[ $TXN_ID ][ microtime() ] = array_merge(
1254
+					$debug_data[$TXN_ID][microtime()] = array_merge(
1255 1255
 						$default_data,
1256 1256
 						$info
1257 1257
 					);
1258
-					update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data );
1258
+					update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data);
1259 1259
 				}
1260 1260
 			}
1261 1261
 		}
@@ -1268,23 +1268,23 @@  discard block
 block discarded – undo
1268 1268
 	 * @param array $info
1269 1269
 	 * @return array
1270 1270
 	 */
1271
-	public function _strip_objects( $info = array() ) {
1272
-		foreach ( (array)$info as $key => $value ) {
1273
-			if ( is_array( $value )) {
1274
-				$info[ $key ] = $this->_strip_objects( $value );
1275
-			} else if ( is_object( $value ) ) {
1276
-				$object_class = get_class( $value );
1277
-				$info[ $object_class ] = array();
1278
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1279
-				if ( method_exists( $value, 'status' ) ) {
1280
-					$info[ $object_class ][ 'status' ] = $value->status();
1281
-				} else if ( method_exists( $value, 'status_ID' ) ) {
1282
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
1271
+	public function _strip_objects($info = array()) {
1272
+		foreach ((array) $info as $key => $value) {
1273
+			if (is_array($value)) {
1274
+				$info[$key] = $this->_strip_objects($value);
1275
+			} else if (is_object($value)) {
1276
+				$object_class = get_class($value);
1277
+				$info[$object_class] = array();
1278
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0;
1279
+				if (method_exists($value, 'status')) {
1280
+					$info[$object_class]['status'] = $value->status();
1281
+				} else if (method_exists($value, 'status_ID')) {
1282
+					$info[$object_class]['status'] = $value->status_ID();
1283 1283
 				}
1284
-				unset( $info[ $key ] );
1284
+				unset($info[$key]);
1285 1285
 			}
1286 1286
 		}
1287
-		return (array)$info;
1287
+		return (array) $info;
1288 1288
 	}
1289 1289
 
1290 1290
 
Please login to merge, or discard this patch.
modules/single_page_checkout/EED_Single_Page_Checkout.module.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -817,12 +817,12 @@
 block discarded – undo
817 817
 			if ( $registration instanceof EE_Registration ) {
818 818
 				// we display all attendee info for the primary registrant
819 819
 				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
820
-				     && $registration->is_primary_registrant()
820
+					 && $registration->is_primary_registrant()
821 821
 				) {
822 822
 					$this->checkout->primary_revisit = true;
823 823
 					break;
824 824
 				} else if ( $this->checkout->revisit
825
-				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
825
+							&& $this->checkout->reg_url_link !== $registration->reg_url_link()
826 826
 				) {
827 827
 					// but hide info if it doesn't belong to you
828 828
 					$transaction->clear_cache( 'Registration', $registration->ID() );
Please login to merge, or discard this patch.
Spacing   +262 added lines, -262 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');}
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); }
2 2
 /**
3 3
  * Single Page Checkout (SPCO)
4 4
  *
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 	 * @return EED_Single_Page_Checkout
39 39
 	 */
40 40
 	public static function instance() {
41
-		add_filter( 'EED_Single_Page_Checkout__SPCO_active', '__return_true' );
42
-		return parent::get_instance( __CLASS__ );
41
+		add_filter('EED_Single_Page_Checkout__SPCO_active', '__return_true');
42
+		return parent::get_instance(__CLASS__);
43 43
 	}
44 44
 
45 45
 
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public static function set_hooks_admin() {
86 86
 		EED_Single_Page_Checkout::set_definitions();
87
-		if ( defined( 'DOING_AJAX' )) {
87
+		if (defined('DOING_AJAX')) {
88 88
 			// going to start an output buffer in case anything gets accidentally output that might disrupt our JSON response
89 89
 			ob_start();
90 90
 			EED_Single_Page_Checkout::load_request_handler();
91 91
 			EED_Single_Page_Checkout::load_reg_steps();
92 92
 		} else {
93 93
 			// hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called
94
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
94
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
95 95
 		}
96 96
 		// set ajax hooks
97
-		add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
98
-		add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
99
-		add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
100
-		add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
101
-		add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
102
-		add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
97
+		add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
98
+		add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
99
+		add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
100
+		add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
101
+		add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
102
+		add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
103 103
 	}
104 104
 
105 105
 
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	 * @param string $ajax_action
111 111
 	 * @throws \EE_Error
112 112
 	 */
113
-	public static function process_ajax_request( $ajax_action ) {
114
-		EE_Registry::instance()->REQ->set( 'action', $ajax_action );
113
+	public static function process_ajax_request($ajax_action) {
114
+		EE_Registry::instance()->REQ->set('action', $ajax_action);
115 115
 		EED_Single_Page_Checkout::instance()->_initialize();
116 116
 	}
117 117
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * @throws \EE_Error
124 124
 	 */
125 125
 	public static function display_reg_step() {
126
-		EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' );
126
+		EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step');
127 127
 	}
128 128
 
129 129
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 * @throws \EE_Error
135 135
 	 */
136 136
 	public static function process_reg_step() {
137
-		EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' );
137
+		EED_Single_Page_Checkout::process_ajax_request('process_reg_step');
138 138
 	}
139 139
 
140 140
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * @throws \EE_Error
146 146
 	 */
147 147
 	public static function update_reg_step() {
148
-		EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' );
148
+		EED_Single_Page_Checkout::process_ajax_request('update_reg_step');
149 149
 	}
150 150
 
151 151
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @throws \EE_Error
159 159
 	 */
160 160
 	public static function update_checkout() {
161
-		EED_Single_Page_Checkout::process_ajax_request( 'update_checkout' );
161
+		EED_Single_Page_Checkout::process_ajax_request('update_checkout');
162 162
 	}
163 163
 
164 164
 
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public static function load_request_handler() {
173 173
 		// load core Request_Handler class
174
-		if ( ! isset( EE_Registry::instance()->REQ )) {
175
-			EE_Registry::instance()->load_core( 'Request_Handler' );
174
+		if ( ! isset(EE_Registry::instance()->REQ)) {
175
+			EE_Registry::instance()->load_core('Request_Handler');
176 176
 		}
177 177
 	}
178 178
 
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
 	 * @throws \EE_Error
187 187
 	 */
188 188
 	public static function set_definitions() {
189
-		define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
190
-		define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS );
191
-		define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS );
192
-		define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS );
193
-		define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS );
194
-		define( 'SPCO_REG_STEPS_PATH', SPCO_BASE_PATH . 'reg_steps' . DS );
195
-		define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS );
196
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE );
189
+		define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
190
+		define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS);
191
+		define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS);
192
+		define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS);
193
+		define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS);
194
+		define('SPCO_REG_STEPS_PATH', SPCO_BASE_PATH.'reg_steps'.DS);
195
+		define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS);
196
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE);
197 197
 	}
198 198
 
199 199
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public static function load_reg_steps() {
210 210
 		static $reg_steps_loaded = FALSE;
211
-		if ( $reg_steps_loaded ) {
211
+		if ($reg_steps_loaded) {
212 212
 			return;
213 213
 		}
214 214
 		// filter list of reg_steps
@@ -217,24 +217,24 @@  discard block
 block discarded – undo
217 217
 			EED_Single_Page_Checkout::get_reg_steps()
218 218
 		);
219 219
 		// sort by key (order)
220
-		ksort( $reg_steps_to_load );
220
+		ksort($reg_steps_to_load);
221 221
 		// loop through folders
222
-		foreach ( $reg_steps_to_load as $order => $reg_step ) {
222
+		foreach ($reg_steps_to_load as $order => $reg_step) {
223 223
 			// we need a
224
-			if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
224
+			if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
225 225
 				// copy over to the reg_steps_array
226
-				EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step;
226
+				EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step;
227 227
 				// register custom key route for each reg step
228 228
 				// ie: step=>"slug" - this is the entire reason we load the reg steps array now
229
-				EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' );
229
+				EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step');
230 230
 				// add AJAX or other hooks
231
-				if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) {
231
+				if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) {
232 232
 					// setup autoloaders if necessary
233
-					if ( ! class_exists( $reg_step['class_name'] )) {
234
-						EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE );
233
+					if ( ! class_exists($reg_step['class_name'])) {
234
+						EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE);
235 235
 					}
236
-					if ( is_callable( $reg_step['class_name'], 'set_hooks' )) {
237
-						call_user_func( array( $reg_step['class_name'], 'set_hooks' ));
236
+					if (is_callable($reg_step['class_name'], 'set_hooks')) {
237
+						call_user_func(array($reg_step['class_name'], 'set_hooks'));
238 238
 					}
239 239
 				}
240 240
 			}
@@ -253,28 +253,28 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	public static function get_reg_steps() {
255 255
 		$reg_steps = EE_Registry::instance()->CFG->registration->reg_steps;
256
-		if ( empty( $reg_steps )) {
256
+		if (empty($reg_steps)) {
257 257
 			$reg_steps = array(
258 258
 				10 => array(
259
-					'file_path' => SPCO_REG_STEPS_PATH . 'attendee_information',
259
+					'file_path' => SPCO_REG_STEPS_PATH.'attendee_information',
260 260
 					'class_name' => 'EE_SPCO_Reg_Step_Attendee_Information',
261 261
 					'slug' => 'attendee_information',
262 262
 					'has_hooks' => FALSE
263 263
 				),
264 264
 				20 => array(
265
-					'file_path' => SPCO_REG_STEPS_PATH . 'registration_confirmation',
265
+					'file_path' => SPCO_REG_STEPS_PATH.'registration_confirmation',
266 266
 					'class_name' => 'EE_SPCO_Reg_Step_Registration_Confirmation',
267 267
 					'slug' => 'registration_confirmation',
268 268
 					'has_hooks' => FALSE
269 269
 				),
270 270
 				30 => array(
271
-					'file_path' => SPCO_REG_STEPS_PATH . 'payment_options',
271
+					'file_path' => SPCO_REG_STEPS_PATH.'payment_options',
272 272
 					'class_name' => 'EE_SPCO_Reg_Step_Payment_Options',
273 273
 					'slug' => 'payment_options',
274 274
 					'has_hooks' => TRUE
275 275
 				),
276 276
 				999 => array(
277
-					'file_path' => SPCO_REG_STEPS_PATH . 'finalize_registration',
277
+					'file_path' => SPCO_REG_STEPS_PATH.'finalize_registration',
278 278
 					'class_name' => 'EE_SPCO_Reg_Step_Finalize_Registration',
279 279
 					'slug' => 'finalize_registration',
280 280
 					'has_hooks' => FALSE
@@ -295,9 +295,9 @@  discard block
 block discarded – undo
295 295
 	 */
296 296
 	public static function registration_checkout_for_admin() {
297 297
 		EED_Single_Page_Checkout::load_reg_steps();
298
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
299
-		EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' );
300
-		EE_Registry::instance()->REQ->set( 'process_form_submission', false );
298
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
299
+		EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step');
300
+		EE_Registry::instance()->REQ->set('process_form_submission', false);
301 301
 		EED_Single_Page_Checkout::instance()->_initialize();
302 302
 		EED_Single_Page_Checkout::instance()->_display_spco_reg_form();
303 303
 		return EE_Registry::instance()->REQ->get_output();
@@ -314,15 +314,15 @@  discard block
 block discarded – undo
314 314
 	 */
315 315
 	public static function process_registration_from_admin() {
316 316
 		EED_Single_Page_Checkout::load_reg_steps();
317
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
318
-		EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' );
319
-		EE_Registry::instance()->REQ->set( 'process_form_submission', true );
317
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
318
+		EE_Registry::instance()->REQ->set('action', 'process_reg_step');
319
+		EE_Registry::instance()->REQ->set('process_form_submission', true);
320 320
 		EED_Single_Page_Checkout::instance()->_initialize();
321
-		if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) {
322
-			$final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps );
323
-			if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
324
-				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated( $final_reg_step );
325
-				if ( $final_reg_step->process_reg_step() ) {
321
+		if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) {
322
+			$final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps);
323
+			if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
324
+				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated($final_reg_step);
325
+				if ($final_reg_step->process_reg_step()) {
326 326
 					$final_reg_step->set_completed();
327 327
 					EED_Single_Page_Checkout::instance()->checkout->update_txn_reg_steps_array();
328 328
 					return EED_Single_Page_Checkout::instance()->checkout->transaction;
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 	 * @return    void
343 343
 	 * @throws \EE_Error
344 344
 	 */
345
-	public function run( $WP_Query ) {
345
+	public function run($WP_Query) {
346 346
 		if (
347 347
 			$WP_Query instanceof WP_Query
348 348
 			&& $WP_Query->is_main_query()
349
-			&& apply_filters( 'FHEE__EED_Single_Page_Checkout__run', true )
349
+			&& apply_filters('FHEE__EED_Single_Page_Checkout__run', true)
350 350
 		) {
351 351
 			$this->_initialize();
352 352
 		}
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
 	 * @return    void
363 363
 	 * @throws \EE_Error
364 364
 	 */
365
-	public static function init( $WP_Query ) {
366
-		EED_Single_Page_Checkout::instance()->run( $WP_Query );
365
+	public static function init($WP_Query) {
366
+		EED_Single_Page_Checkout::instance()->run($WP_Query);
367 367
 	}
368 368
 
369 369
 
@@ -377,36 +377,36 @@  discard block
 block discarded – undo
377 377
 	 */
378 378
 	private function _initialize() {
379 379
 		// ensure SPCO doesn't run twice
380
-		if ( EED_Single_Page_Checkout::$_initialized ) {
380
+		if (EED_Single_Page_Checkout::$_initialized) {
381 381
 			return;
382 382
 		}
383 383
 		try {
384 384
 			// setup the EE_Checkout object
385 385
 			$this->checkout = $this->_initialize_checkout();
386 386
 			// filter checkout
387
-			$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout );
387
+			$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout);
388 388
 			// get the $_GET
389 389
 			$this->_get_request_vars();
390 390
 			// filter continue_reg
391
-			$this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout );
391
+			$this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout);
392 392
 			// load the reg steps array
393
-			if ( ! $this->_load_and_instantiate_reg_steps() ) {
393
+			if ( ! $this->_load_and_instantiate_reg_steps()) {
394 394
 				EED_Single_Page_Checkout::$_initialized = true;
395 395
 				return;
396 396
 			}
397 397
 			// set the current step
398
-			$this->checkout->set_current_step( $this->checkout->step );
398
+			$this->checkout->set_current_step($this->checkout->step);
399 399
 			// and the next step
400 400
 			$this->checkout->set_next_step();
401 401
 			// was there already a valid transaction in the checkout from the session ?
402
-			if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
402
+			if ( ! $this->checkout->transaction instanceof EE_Transaction) {
403 403
 				// get transaction from db or session
404 404
 				$this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin()
405 405
 					? $this->_get_transaction_and_cart_for_previous_visit()
406 406
 					: $this->_get_cart_for_current_session_and_setup_new_transaction();
407
-				if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
407
+				if ( ! $this->checkout->transaction instanceof EE_Transaction) {
408 408
 					EE_Error::add_error(
409
-						__( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ),
409
+						__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'),
410 410
 						__FILE__, __FUNCTION__, __LINE__
411 411
 					);
412 412
 					// add some style and make it dance
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
 					return;
417 417
 				}
418 418
 				// and the registrations for the transaction
419
-				$this->_get_registrations( $this->checkout->transaction );
419
+				$this->_get_registrations($this->checkout->transaction);
420 420
 			}
421 421
 			// verify that everything has been setup correctly
422
-			if ( ! $this->_final_verifications() ) {
422
+			if ( ! $this->_final_verifications()) {
423 423
 				EED_Single_Page_Checkout::$_initialized = true;
424 424
 				return;
425 425
 			}
@@ -444,9 +444,9 @@  discard block
 block discarded – undo
444 444
 			// set no cache headers and constants
445 445
 			EE_System::do_not_cache();
446 446
 			// add anchor
447
-			add_action( 'loop_start', array( $this, 'set_checkout_anchor' ), 1 );
448
-		} catch ( Exception $e ) {
449
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
447
+			add_action('loop_start', array($this, 'set_checkout_anchor'), 1);
448
+		} catch (Exception $e) {
449
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
450 450
 		}
451 451
 	}
452 452
 
@@ -464,20 +464,20 @@  discard block
 block discarded – undo
464 464
 		// look in session for existing checkout
465 465
 		$checkout = EE_Registry::instance()->SSN->checkout();
466 466
 		// verify
467
-		if ( ! $checkout instanceof EE_Checkout ) {
467
+		if ( ! $checkout instanceof EE_Checkout) {
468 468
 			// instantiate EE_Checkout object for handling the properties of the current checkout process
469
-			$checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE  );
469
+			$checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE);
470 470
 		} else {
471
-			if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true )  {
471
+			if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) {
472 472
 				$this->unlock_transaction();
473
-				wp_safe_redirect( $checkout->redirect_url );
473
+				wp_safe_redirect($checkout->redirect_url);
474 474
 				exit();
475 475
 			}
476 476
 		}
477
-		$checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout );
477
+		$checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout);
478 478
 		// verify again
479
-		if ( ! $checkout instanceof EE_Checkout ) {
480
-			throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) );
479
+		if ( ! $checkout instanceof EE_Checkout) {
480
+			throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso'));
481 481
 		}
482 482
 		// reset anything that needs a clean slate for each request
483 483
 		$checkout->reset_for_current_request();
@@ -497,24 +497,24 @@  discard block
 block discarded – undo
497 497
 		// load classes
498 498
 		EED_Single_Page_Checkout::load_request_handler();
499 499
 		//make sure this request is marked as belonging to EE
500
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
500
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
501 501
 		// which step is being requested ?
502
-		$this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() );
502
+		$this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step());
503 503
 		// which step is being edited ?
504
-		$this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' );
504
+		$this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', '');
505 505
 		// and what we're doing on the current step
506
-		$this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' );
506
+		$this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step');
507 507
 		// returning to edit ?
508
-		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' );
508
+		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', '');
509 509
 		// or some other kind of revisit ?
510
-		$this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE );
510
+		$this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE);
511 511
 		// and whether or not to generate a reg form for this request
512
-		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); 		// TRUE 	FALSE
512
+		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE 	FALSE
513 513
 		// and whether or not to process a reg form submission for this request
514
-		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); 		// TRUE 	FALSE
514
+		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE 	FALSE
515 515
 		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step'
516 516
 			? $this->checkout->process_form_submission
517
-			: FALSE; 		// TRUE 	FALSE
517
+			: FALSE; // TRUE 	FALSE
518 518
 		// $this->_display_request_vars();
519 519
 	}
520 520
 
@@ -527,17 +527,17 @@  discard block
 block discarded – undo
527 527
 	 * @return    void
528 528
 	 */
529 529
 	protected function _display_request_vars() {
530
-		if ( ! WP_DEBUG ) {
530
+		if ( ! WP_DEBUG) {
531 531
 			return;
532 532
 		}
533
-		EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
534
-		EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ );
535
-		EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ );
536
-		EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ );
537
-		EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ );
538
-		EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ );
539
-		EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ );
540
-		EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ );
533
+		EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__);
534
+		EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__);
535
+		EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__);
536
+		EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__);
537
+		EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__);
538
+		EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__);
539
+		EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__);
540
+		EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__);
541 541
 	}
542 542
 
543 543
 
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
 	 * @return    array
552 552
 	 */
553 553
 	private function _get_first_step() {
554
-		$first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array );
555
-		return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information';
554
+		$first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array);
555
+		return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information';
556 556
 	}
557 557
 
558 558
 
@@ -568,27 +568,27 @@  discard block
 block discarded – undo
568 568
 	private function _load_and_instantiate_reg_steps() {
569 569
 		// have reg_steps already been instantiated ?
570 570
 		if (
571
-			empty( $this->checkout->reg_steps ) ||
572
-			apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout )
571
+			empty($this->checkout->reg_steps) ||
572
+			apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout)
573 573
 		) {
574 574
 			// if not, then loop through raw reg steps array
575
-			foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) {
576
-				if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) {
575
+			foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) {
576
+				if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) {
577 577
 					return false;
578 578
 				}
579 579
 			}
580 580
 			EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE;
581 581
 			EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE;
582 582
 			// skip the registration_confirmation page ?
583
-			if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) {
583
+			if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) {
584 584
 				// just remove it from the reg steps array
585
-				$this->checkout->remove_reg_step( 'registration_confirmation', false );
585
+				$this->checkout->remove_reg_step('registration_confirmation', false);
586 586
 			} else if (
587
-				isset( $this->checkout->reg_steps['registration_confirmation'] )
587
+				isset($this->checkout->reg_steps['registration_confirmation'])
588 588
 				&& EE_Registry::instance()->CFG->registration->reg_confirmation_last
589 589
 			) {
590 590
 				// set the order to something big like 100
591
-				$this->checkout->set_reg_step_order( 'registration_confirmation', 100 );
591
+				$this->checkout->set_reg_step_order('registration_confirmation', 100);
592 592
 			}
593 593
 			// filter the array for good luck
594 594
 			$this->checkout->reg_steps = apply_filters(
@@ -598,13 +598,13 @@  discard block
 block discarded – undo
598 598
 			// finally re-sort based on the reg step class order properties
599 599
 			$this->checkout->sort_reg_steps();
600 600
 		} else {
601
-			foreach ( $this->checkout->reg_steps as $reg_step ) {
601
+			foreach ($this->checkout->reg_steps as $reg_step) {
602 602
 				// set all current step stati to FALSE
603
-				$reg_step->set_is_current_step( FALSE );
603
+				$reg_step->set_is_current_step(FALSE);
604 604
 			}
605 605
 		}
606
-		if ( empty( $this->checkout->reg_steps )) {
607
-			EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
606
+		if (empty($this->checkout->reg_steps)) {
607
+			EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
608 608
 			return false;
609 609
 		}
610 610
 			// make reg step details available to JS
@@ -622,10 +622,10 @@  discard block
 block discarded – undo
622 622
 	 * @param int   $order
623 623
 	 * @return bool
624 624
 	 */
625
-	private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) {
625
+	private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) {
626 626
 
627 627
 		// we need a file_path, class_name, and slug to add a reg step
628
-		if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
628
+		if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
629 629
 			// if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step)
630 630
 			if (
631 631
 				$this->checkout->reg_url_link
@@ -643,26 +643,26 @@  discard block
 block discarded – undo
643 643
 				FALSE
644 644
 			);
645 645
 			// did we gets the goods ?
646
-			if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) {
646
+			if ($reg_step_obj instanceof EE_SPCO_Reg_Step) {
647 647
 				// set reg step order based on config
648
-				$reg_step_obj->set_order( $order );
648
+				$reg_step_obj->set_order($order);
649 649
 				// add instantiated reg step object to the master reg steps array
650
-				$this->checkout->add_reg_step( $reg_step_obj );
650
+				$this->checkout->add_reg_step($reg_step_obj);
651 651
 			} else {
652 652
 				EE_Error::add_error(
653
-					__( 'The current step could not be set.', 'event_espresso' ),
653
+					__('The current step could not be set.', 'event_espresso'),
654 654
 					__FILE__, __FUNCTION__, __LINE__
655 655
 				);
656 656
 				return false;
657 657
 			}
658 658
 		} else {
659
-			if ( WP_DEBUG ) {
659
+			if (WP_DEBUG) {
660 660
 				EE_Error::add_error(
661 661
 					sprintf(
662
-						__( 'A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso' ),
663
-						isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '',
664
-						isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '',
665
-						isset( $reg_step['slug'] ) ? $reg_step['slug'] : '',
662
+						__('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'),
663
+						isset($reg_step['file_path']) ? $reg_step['file_path'] : '',
664
+						isset($reg_step['class_name']) ? $reg_step['class_name'] : '',
665
+						isset($reg_step['slug']) ? $reg_step['slug'] : '',
666 666
 						'<ul>',
667 667
 						'<li>',
668 668
 						'</li>',
@@ -686,16 +686,16 @@  discard block
 block discarded – undo
686 686
 	 */
687 687
 	private function _get_transaction_and_cart_for_previous_visit() {
688 688
 		/** @var $TXN_model EEM_Transaction */
689
-		$TXN_model = EE_Registry::instance()->load_model( 'Transaction' );
689
+		$TXN_model = EE_Registry::instance()->load_model('Transaction');
690 690
 		// because the reg_url_link is present in the request, this is a return visit to SPCO, so we'll get the transaction data from the db
691
-		$transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link );
691
+		$transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link);
692 692
 		// verify transaction
693
-		if ( $transaction instanceof EE_Transaction ) {
693
+		if ($transaction instanceof EE_Transaction) {
694 694
 			// and get the cart that was used for that transaction
695
-			$this->checkout->cart = $this->_get_cart_for_transaction( $transaction );
695
+			$this->checkout->cart = $this->_get_cart_for_transaction($transaction);
696 696
 			return $transaction;
697 697
 		} else {
698
-			EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
698
+			EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
699 699
 			return NULL;
700 700
 		}
701 701
 	}
@@ -709,8 +709,8 @@  discard block
 block discarded – undo
709 709
 	 * @param EE_Transaction $transaction
710 710
 	 * @return EE_Cart
711 711
 	 */
712
-	private function _get_cart_for_transaction( $transaction ) {
713
-		return $this->checkout->get_cart_for_transaction( $transaction );
712
+	private function _get_cart_for_transaction($transaction) {
713
+		return $this->checkout->get_cart_for_transaction($transaction);
714 714
 	}
715 715
 
716 716
 
@@ -722,8 +722,8 @@  discard block
 block discarded – undo
722 722
 	 * @param EE_Transaction $transaction
723 723
 	 * @return EE_Cart
724 724
 	 */
725
-	public function get_cart_for_transaction( EE_Transaction $transaction ) {
726
-		return $this->checkout->get_cart_for_transaction( $transaction );
725
+	public function get_cart_for_transaction(EE_Transaction $transaction) {
726
+		return $this->checkout->get_cart_for_transaction($transaction);
727 727
 	}
728 728
 
729 729
 
@@ -739,17 +739,17 @@  discard block
 block discarded – undo
739 739
 	private function _get_cart_for_current_session_and_setup_new_transaction() {
740 740
 		//  if there's no transaction, then this is the FIRST visit to SPCO
741 741
 		// so load up the cart ( passing nothing for the TXN because it doesn't exist yet )
742
-		$this->checkout->cart = $this->_get_cart_for_transaction( NULL );
742
+		$this->checkout->cart = $this->_get_cart_for_transaction(NULL);
743 743
 		// and then create a new transaction
744 744
 		$transaction = $this->_initialize_transaction();
745 745
 		// verify transaction
746
-		if ( $transaction instanceof EE_Transaction ) {
746
+		if ($transaction instanceof EE_Transaction) {
747 747
 			// save it so that we have an ID for other objects to use
748 748
 			$transaction->save();
749 749
 			// and save TXN data to the cart
750
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() );
750
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID());
751 751
 		} else {
752
-			EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
752
+			EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
753 753
 		}
754 754
 		return $transaction;
755 755
 	}
@@ -769,15 +769,15 @@  discard block
 block discarded – undo
769 769
 			// grab the cart grand total
770 770
 			$cart_total = $this->checkout->cart->get_cart_grand_total();
771 771
 			// create new TXN
772
-			return EE_Transaction::new_instance( array(
772
+			return EE_Transaction::new_instance(array(
773 773
 				'TXN_timestamp' 	=> time(),
774 774
 				'TXN_reg_steps' 		=> $this->checkout->initialize_txn_reg_steps_array(),
775 775
 				'TXN_total' 				=> $cart_total > 0 ? $cart_total : 0,
776 776
 				'TXN_paid' 				=> 0,
777 777
 				'STS_ID' 					=> EEM_Transaction::failed_status_code,
778 778
 			));
779
-		} catch( Exception $e ) {
780
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
779
+		} catch (Exception $e) {
780
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
781 781
 		}
782 782
 		return NULL;
783 783
 	}
@@ -792,38 +792,38 @@  discard block
 block discarded – undo
792 792
 	 * @return EE_Cart
793 793
 	 * @throws \EE_Error
794 794
 	 */
795
-	private function _get_registrations( EE_Transaction $transaction ) {
795
+	private function _get_registrations(EE_Transaction $transaction) {
796 796
 		// first step: grab the registrants  { : o
797
-		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true );
797
+		$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
798 798
 		// verify registrations have been set
799
-		if ( empty( $registrations )) {
799
+		if (empty($registrations)) {
800 800
 			// if no cached registrations, then check the db
801
-			$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, false );
801
+			$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
802 802
 			// still nothing ? well as long as this isn't a revisit
803
-			if ( empty( $registrations ) && ! $this->checkout->revisit ) {
803
+			if (empty($registrations) && ! $this->checkout->revisit) {
804 804
 				// generate new registrations from scratch
805
-				$registrations = $this->_initialize_registrations( $transaction );
805
+				$registrations = $this->_initialize_registrations($transaction);
806 806
 			}
807 807
 		}
808 808
 		// sort by their original registration order
809
-		usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' ));
809
+		usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
810 810
 		// then loop thru the array
811
-		foreach ( $registrations as $registration ) {
811
+		foreach ($registrations as $registration) {
812 812
 			// verify each registration
813
-			if ( $registration instanceof EE_Registration ) {
813
+			if ($registration instanceof EE_Registration) {
814 814
 				// we display all attendee info for the primary registrant
815
-				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
815
+				if ($this->checkout->reg_url_link === $registration->reg_url_link()
816 816
 				     && $registration->is_primary_registrant()
817 817
 				) {
818 818
 					$this->checkout->primary_revisit = true;
819 819
 					break;
820
-				} else if ( $this->checkout->revisit
820
+				} else if ($this->checkout->revisit
821 821
 				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
822 822
 				) {
823 823
 					// but hide info if it doesn't belong to you
824
-					$transaction->clear_cache( 'Registration', $registration->ID() );
824
+					$transaction->clear_cache('Registration', $registration->ID());
825 825
 				}
826
-				$this->checkout->set_reg_status_updated( $registration->ID(), false );
826
+				$this->checkout->set_reg_status_updated($registration->ID(), false);
827 827
 			}
828 828
 		}
829 829
 	}
@@ -838,17 +838,17 @@  discard block
 block discarded – undo
838 838
 	 * @return    array
839 839
 	 * @throws \EE_Error
840 840
 	 */
841
-	private function _initialize_registrations( EE_Transaction $transaction ) {
841
+	private function _initialize_registrations(EE_Transaction $transaction) {
842 842
 		$att_nmbr = 0;
843 843
 		$registrations = array();
844
-		if ( $transaction instanceof EE_Transaction ) {
844
+		if ($transaction instanceof EE_Transaction) {
845 845
 			/** @type EE_Registration_Processor $registration_processor */
846
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
846
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
847 847
 			$this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count();
848 848
 			// now let's add the cart items to the $transaction
849
-			foreach ( $this->checkout->cart->get_tickets() as $line_item ) {
849
+			foreach ($this->checkout->cart->get_tickets() as $line_item) {
850 850
 				//do the following for each ticket of this type they selected
851
-				for ( $x = 1; $x <= $line_item->quantity(); $x++ ) {
851
+				for ($x = 1; $x <= $line_item->quantity(); $x++) {
852 852
 					$att_nmbr++;
853 853
 					$registration = $registration_processor->generate_ONE_registration_from_line_item(
854 854
 						$line_item,
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
 						$att_nmbr,
857 857
 						$this->checkout->total_ticket_count
858 858
 					);
859
-					if ( $registration instanceof EE_Registration ) {
860
-						$registrations[ $registration->ID() ] = $registration;
859
+					if ($registration instanceof EE_Registration) {
860
+						$registrations[$registration->ID()] = $registration;
861 861
 					}
862 862
 				}
863 863
 			}
864
-			$registration_processor->fix_reg_final_price_rounding_issue( $transaction );
864
+			$registration_processor->fix_reg_final_price_rounding_issue($transaction);
865 865
 		}
866 866
 		return $registrations;
867 867
 	}
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
 	 * @param EE_Registration $reg_B
877 877
 	 * @return array()
878 878
 	 */
879
-	public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) {
879
+	public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) {
880 880
 		// this shouldn't ever happen within the same TXN, but oh well
881
-		if ( $reg_A->count() === $reg_B->count() ) {
881
+		if ($reg_A->count() === $reg_B->count()) {
882 882
 			return 0;
883 883
 		}
884
-		return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1;
884
+		return ($reg_A->count() > $reg_B->count()) ? 1 : -1;
885 885
 	}
886 886
 
887 887
 
@@ -896,21 +896,21 @@  discard block
 block discarded – undo
896 896
 	 */
897 897
 	private function _final_verifications() {
898 898
 		// filter checkout
899
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout );
899
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
900 900
 		//verify that current step is still set correctly
901
-		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) {
902
-			EE_Error::add_error( __( 'We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
901
+		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
902
+			EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
903 903
 			return false;
904 904
 		}
905 905
 		// if returning to SPCO, then verify that primary registrant is set
906
-		if ( ! empty( $this->checkout->reg_url_link )) {
906
+		if ( ! empty($this->checkout->reg_url_link)) {
907 907
 			$valid_registrant = $this->checkout->transaction->primary_registration();
908
-			if ( ! $valid_registrant instanceof EE_Registration ) {
909
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
908
+			if ( ! $valid_registrant instanceof EE_Registration) {
909
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
910 910
 				return false;
911 911
 			}
912 912
 			$valid_registrant = null;
913
-			foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) {
913
+			foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
914 914
 				if (
915 915
 					$registration instanceof EE_Registration
916 916
 					&& $registration->reg_url_link() === $this->checkout->reg_url_link
@@ -918,14 +918,14 @@  discard block
 block discarded – undo
918 918
 					$valid_registrant = $registration;
919 919
 				}
920 920
 			}
921
-			if ( ! $valid_registrant instanceof EE_Registration ) {
922
-				EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
921
+			if ( ! $valid_registrant instanceof EE_Registration) {
922
+				EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
923 923
 				return false;
924 924
 			}
925 925
 		}
926 926
 		// now that things have been kinda sufficiently verified,
927 927
 		// let's add the checkout to the session so that's available other systems
928
-		EE_Registry::instance()->SSN->set_checkout( $this->checkout );
928
+		EE_Registry::instance()->SSN->set_checkout($this->checkout);
929 929
 		return true;
930 930
 	}
931 931
 
@@ -940,28 +940,28 @@  discard block
 block discarded – undo
940 940
 	 * @param bool $reinitializing
941 941
 	 * @throws \EE_Error
942 942
 	 */
943
-	private function _initialize_reg_steps( $reinitializing = false ) {
944
-		$this->checkout->set_reg_step_initiated( $this->checkout->current_step );
943
+	private function _initialize_reg_steps($reinitializing = false) {
944
+		$this->checkout->set_reg_step_initiated($this->checkout->current_step);
945 945
 		// loop thru all steps to call their individual "initialize" methods and set i18n strings for JS
946
-		foreach ( $this->checkout->reg_steps as $reg_step ) {
947
-			if ( ! $reg_step->initialize_reg_step() ) {
946
+		foreach ($this->checkout->reg_steps as $reg_step) {
947
+			if ( ! $reg_step->initialize_reg_step()) {
948 948
 				// if not initialized then maybe this step is being removed...
949
-				if ( ! $reinitializing && $reg_step->is_current_step() ) {
949
+				if ( ! $reinitializing && $reg_step->is_current_step()) {
950 950
 					// if it was the current step, then we need to start over here
951
-					$this->_initialize_reg_steps( true );
951
+					$this->_initialize_reg_steps(true);
952 952
 					return;
953 953
 				}
954 954
 				continue;
955 955
 			}
956 956
 			// i18n
957 957
 			$reg_step->translate_js_strings();
958
-			if ( $reg_step->is_current_step() ) {
958
+			if ($reg_step->is_current_step()) {
959 959
 				// the text that appears on the reg step form submit button
960 960
 				$reg_step->set_submit_button_text();
961 961
 			}
962 962
 		}
963 963
 		// dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information
964
-		do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step );
964
+		do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step);
965 965
 	}
966 966
 
967 967
 
@@ -974,43 +974,43 @@  discard block
 block discarded – undo
974 974
 	 */
975 975
 	private function _check_form_submission() {
976 976
 		//does this request require the reg form to be generated ?
977
-		if ( $this->checkout->generate_reg_form ) {
977
+		if ($this->checkout->generate_reg_form) {
978 978
 			// ever heard that song by Blue Rodeo ?
979 979
 			try {
980 980
 				$this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form();
981 981
 				// if not displaying a form, then check for form submission
982
-				if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) {
982
+				if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) {
983 983
 					// clear out any old data in case this step is being run again
984
-					$this->checkout->current_step->set_valid_data( array() );
984
+					$this->checkout->current_step->set_valid_data(array());
985 985
 					// capture submitted form data
986 986
 					$this->checkout->current_step->reg_form->receive_form_submission(
987
-						apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout )
987
+						apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout)
988 988
 					);
989 989
 					// validate submitted form data
990
-					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid() ) {
990
+					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid()) {
991 991
 						// thou shall not pass !!!
992 992
 						$this->checkout->continue_reg = FALSE;
993 993
 						// any form validation errors?
994
-						if ( $this->checkout->current_step->reg_form->submission_error_message() !== '' ) {
994
+						if ($this->checkout->current_step->reg_form->submission_error_message() !== '') {
995 995
 							$submission_error_messages = array();
996 996
 							// bad, bad, bad registrant
997
-							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
998
-								if ( $validation_error instanceof EE_Validation_Error ) {
997
+							foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) {
998
+								if ($validation_error instanceof EE_Validation_Error) {
999 999
 									$submission_error_messages[] = sprintf(
1000
-										__( '%s : %s', 'event_espresso' ),
1000
+										__('%s : %s', 'event_espresso'),
1001 1001
 										$validation_error->get_form_section()->html_label_text(),
1002 1002
 										$validation_error->getMessage()
1003 1003
 									);
1004 1004
 								}
1005 1005
 							}
1006
-							EE_Error::add_error( implode( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1006
+							EE_Error::add_error(implode('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1007 1007
 						}
1008 1008
 						// well not really... what will happen is we'll just get redirected back to redo the current step
1009 1009
 						$this->go_to_next_step();
1010 1010
 						return;
1011 1011
 					}
1012 1012
 				}
1013
-			} catch( EE_Error $e ) {
1013
+			} catch (EE_Error $e) {
1014 1014
 				$e->get_error();
1015 1015
 			}
1016 1016
 		}
@@ -1027,22 +1027,22 @@  discard block
 block discarded – undo
1027 1027
 	 */
1028 1028
 	private function _process_form_action() {
1029 1029
 		// what cha wanna do?
1030
-		switch( $this->checkout->action ) {
1030
+		switch ($this->checkout->action) {
1031 1031
 			// AJAX next step reg form
1032 1032
 			case 'display_spco_reg_step' :
1033 1033
 				$this->checkout->redirect = FALSE;
1034
-				if ( EE_Registry::instance()->REQ->ajax ) {
1035
-					$this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() );
1034
+				if (EE_Registry::instance()->REQ->ajax) {
1035
+					$this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form());
1036 1036
 				}
1037 1037
 				break;
1038 1038
 
1039 1039
 			default :
1040 1040
 				// meh... do one of those other steps first
1041
-				if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) {
1041
+				if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) {
1042 1042
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step
1043
-					do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1043
+					do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1044 1044
 					// call action on current step
1045
-					if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) {
1045
+					if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) {
1046 1046
 						// good registrant, you get to proceed
1047 1047
 						if (
1048 1048
 							$this->checkout->current_step->success_message() !== ''
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 						) {
1054 1054
 								EE_Error::add_success(
1055 1055
 									$this->checkout->current_step->success_message()
1056
-									. '<br />' . $this->checkout->next_step->_instructions()
1056
+									. '<br />'.$this->checkout->next_step->_instructions()
1057 1057
 								);
1058 1058
 
1059 1059
 						}
@@ -1061,12 +1061,12 @@  discard block
 block discarded – undo
1061 1061
 						$this->_setup_redirect();
1062 1062
 					}
1063 1063
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step
1064
-					do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1064
+					do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1065 1065
 
1066 1066
 				} else {
1067 1067
 					EE_Error::add_error(
1068 1068
 						sprintf(
1069
-							__( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ),
1069
+							__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'),
1070 1070
 							$this->checkout->action,
1071 1071
 							$this->checkout->current_step->name()
1072 1072
 						),
@@ -1092,10 +1092,10 @@  discard block
 block discarded – undo
1092 1092
 	public function add_styles_and_scripts() {
1093 1093
 		// i18n
1094 1094
 		$this->translate_js_strings();
1095
-		if ( $this->checkout->admin_request ) {
1096
-			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 );
1095
+		if ($this->checkout->admin_request) {
1096
+			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1097 1097
 		} else {
1098
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 );
1098
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1099 1099
 		}
1100 1100
 	}
1101 1101
 
@@ -1111,42 +1111,42 @@  discard block
 block discarded – undo
1111 1111
 		EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit;
1112 1112
 		EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link;
1113 1113
 		EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1114
-		EE_Registry::$i18n_js_strings['invalid_json_response'] = __( 'An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso' );
1115
-		EE_Registry::$i18n_js_strings['validation_error'] = __( 'There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso' );
1116
-		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso' );
1114
+		EE_Registry::$i18n_js_strings['invalid_json_response'] = __('An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso');
1115
+		EE_Registry::$i18n_js_strings['validation_error'] = __('There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso');
1116
+		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso');
1117 1117
 		EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso');
1118 1118
 		EE_Registry::$i18n_js_strings['invalid_coupon'] = __('We\'re sorry but that coupon code does not appear to be valid. If this is incorrect, please contact the site administrator.', 'event_espresso');
1119
-		EE_Registry::$i18n_js_strings['process_registration'] = sprintf( __( 'Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso' ), '<br/>', '<br/>' );
1120
-		EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' );
1119
+		EE_Registry::$i18n_js_strings['process_registration'] = sprintf(__('Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso'), '<br/>', '<br/>');
1120
+		EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language');
1121 1121
 		EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id();
1122 1122
 		EE_Registry::$i18n_js_strings['currency'] = EE_Registry::instance()->CFG->currency;
1123 1123
 		EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20';
1124
-		EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' );
1125
-		EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' );
1126
-		EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' );
1127
-		EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' );
1128
-		EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' );
1129
-		EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' );
1130
-		EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' );
1131
-		EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' );
1132
-		EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' );
1133
-		EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' );
1134
-		EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' );
1135
-		EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' );
1136
-		EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' );
1137
-		EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' );
1124
+		EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso');
1125
+		EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso');
1126
+		EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso');
1127
+		EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso');
1128
+		EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso');
1129
+		EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso');
1130
+		EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso');
1131
+		EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso');
1132
+		EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso');
1133
+		EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso');
1134
+		EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso');
1135
+		EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso');
1136
+		EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso');
1137
+		EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso');
1138 1138
 		EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf(
1139
-			__( '%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso' ),
1139
+			__('%1$sWe\'re sorry, but your registration time has expired.%2$s%3$s%4$sIf you still wish to complete your registration, please return to the %5$sEvent List%6$sEvent List%7$s and reselect your tickets if available. Please except our apologies for any inconvenience this may have caused.%8$s', 'event_espresso'),
1140 1140
 			'<h4 class="important-notice">',
1141 1141
 			'</h4>',
1142 1142
 			'<br />',
1143 1143
 			'<p>',
1144
-			'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1144
+			'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1145 1145
 			'">',
1146 1146
 			'</a>',
1147 1147
 			'</p>'
1148 1148
 		);
1149
-		EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true );
1149
+		EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true);
1150 1150
 	}
1151 1151
 
1152 1152
 
@@ -1159,25 +1159,25 @@  discard block
 block discarded – undo
1159 1159
 	 */
1160 1160
 	public function enqueue_styles_and_scripts() {
1161 1161
 		// load css
1162
-		wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION );
1163
-		wp_enqueue_style( 'single_page_checkout' );
1162
+		wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION);
1163
+		wp_enqueue_style('single_page_checkout');
1164 1164
 		// load JS
1165
-		wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery	.plugin.min.js', array( 'jquery' ), '1.0.1', TRUE );
1166
-		wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery	.countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE );
1167
-		wp_register_script( 'single_page_checkout', SPCO_JS_URL . 'single_page_checkout.js', array( 'espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown' ), EVENT_ESPRESSO_VERSION, TRUE );
1168
-		wp_enqueue_script( 'single_page_checkout' );
1165
+		wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery	.plugin.min.js', array('jquery'), '1.0.1', TRUE);
1166
+		wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery	.countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE);
1167
+		wp_register_script('single_page_checkout', SPCO_JS_URL.'single_page_checkout.js', array('espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown'), EVENT_ESPRESSO_VERSION, TRUE);
1168
+		wp_enqueue_script('single_page_checkout');
1169 1169
 
1170 1170
 		/**
1171 1171
 		 * global action hook for enqueueing styles and scripts with
1172 1172
 		 * spco calls.
1173 1173
 		 */
1174
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this );
1174
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this);
1175 1175
 
1176 1176
 		/**
1177 1177
 		 * dynamic action hook for enqueueing styles and scripts with spco calls.
1178 1178
 		 * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information
1179 1179
 		 */
1180
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this );
1180
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this);
1181 1181
 
1182 1182
 		// add css and JS for current step
1183 1183
 		$this->checkout->current_step->enqueue_styles_and_scripts();
@@ -1194,19 +1194,19 @@  discard block
 block discarded – undo
1194 1194
 	 */
1195 1195
 	private function _display_spco_reg_form() {
1196 1196
 		// if registering via the admin, just display the reg form for the current step
1197
-		if ( $this->checkout->admin_request ) {
1198
-			EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() );
1197
+		if ($this->checkout->admin_request) {
1198
+			EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form());
1199 1199
 		} else {
1200 1200
 			// add powered by EE msg
1201
-			add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' ));
1201
+			add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer'));
1202 1202
 
1203
-			$empty_cart = count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) ) < 1 ? true : false;
1203
+			$empty_cart = count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? true : false;
1204 1204
 			$cookies_not_set_msg = '';
1205
-			if ( $empty_cart && ! isset( $_COOKIE[ 'ee_cookie_test' ] ) ) {
1205
+			if ($empty_cart && ! isset($_COOKIE['ee_cookie_test'])) {
1206 1206
 				$cookies_not_set_msg = apply_filters(
1207 1207
 					'FHEE__Single_Page_Checkout__display_spco_reg_form__cookies_not_set_msg',
1208 1208
 					sprintf(
1209
-						__( '%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso' ),
1209
+						__('%1$s%3$sIt appears your browser is not currently set to accept Cookies%4$s%5$sIn order to register for events, you need to enable cookies.%7$sIf you require assistance, then click the following link to learn how to %8$senable cookies%9$s%6$s%2$s', 'event_espresso'),
1210 1210
 						'<div class="ee-attention">',
1211 1211
 						'</div>',
1212 1212
 						'<h6 class="important-notice">',
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 					'layout_strategy' =>
1227 1227
 						new EE_Template_Layout(
1228 1228
 							array(
1229
-								'layout_template_file' 			=> SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php',
1229
+								'layout_template_file' 			=> SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php',
1230 1230
 								'template_args' => array(
1231 1231
 									'empty_cart' 		=> $empty_cart,
1232 1232
 									'revisit' 				=> $this->checkout->revisit,
@@ -1235,8 +1235,8 @@  discard block
 block discarded – undo
1235 1235
 									'empty_msg' 		=> apply_filters(
1236 1236
 										'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
1237 1237
 										sprintf(
1238
-											__( 'You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso' ),
1239
-											'<a href="' . get_post_type_archive_link( 'espresso_events' ) . '" title="',
1238
+											__('You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso'),
1239
+											'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1240 1240
 											'">',
1241 1241
 											'</a>'
1242 1242
 										)
@@ -1244,14 +1244,14 @@  discard block
 block discarded – undo
1244 1244
 									'cookies_not_set_msg' 		=> $cookies_not_set_msg,
1245 1245
 									'registration_time_limit' 	=> $this->checkout->get_registration_time_limit(),
1246 1246
 									'session_expiration' 			=>
1247
-										gmdate( 'M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) )
1247
+										gmdate('M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS))
1248 1248
 							)
1249 1249
 						)
1250 1250
 					)
1251 1251
 				)
1252 1252
 			);
1253 1253
 			// load template and add to output sent that gets filtered into the_content()
1254
-			EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() );
1254
+			EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js());
1255 1255
 		}
1256 1256
 	}
1257 1257
 
@@ -1265,8 +1265,8 @@  discard block
 block discarded – undo
1265 1265
 	 * @internal  param string $label
1266 1266
 	 * @return        string
1267 1267
 	 */
1268
-	public function add_extra_finalize_registration_inputs( $next_step ) {
1269
-		if ( $next_step === 'finalize_registration' ) {
1268
+	public function add_extra_finalize_registration_inputs($next_step) {
1269
+		if ($next_step === 'finalize_registration') {
1270 1270
 			echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>';
1271 1271
 		}
1272 1272
 	}
@@ -1280,18 +1280,18 @@  discard block
 block discarded – undo
1280 1280
 	 *  @return 	string
1281 1281
 	 */
1282 1282
 	public static function display_registration_footer() {
1283
-		if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) {
1284
-			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1285
-			$url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'https://eventespresso.com/' );
1286
-			$url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url );
1283
+		if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) {
1284
+			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1285
+			$url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'https://eventespresso.com/');
1286
+			$url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url);
1287 1287
 			echo apply_filters(
1288 1288
 				'FHEE__EE_Front_Controller__display_registration_footer',
1289 1289
 				sprintf(
1290
-					__( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ),
1291
-					'<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="',
1290
+					__('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'),
1291
+					'<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="',
1292 1292
 					'" target="_blank">',
1293 1293
 					'</a>',
1294
-					'<a href="' . $url . '" title="',
1294
+					'<a href="'.$url.'" title="',
1295 1295
 					'" target="_blank">',
1296 1296
 					'</a></div>'
1297 1297
 				)
@@ -1322,12 +1322,12 @@  discard block
 block discarded – undo
1322 1322
 	 * @return 	array
1323 1323
 	 */
1324 1324
 	private function _setup_redirect() {
1325
-		if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
1325
+		if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
1326 1326
 			$this->checkout->redirect = TRUE;
1327
-			if ( empty( $this->checkout->redirect_url )) {
1327
+			if (empty($this->checkout->redirect_url)) {
1328 1328
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1329 1329
 			}
1330
-			$this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout );
1330
+			$this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout);
1331 1331
 		}
1332 1332
 	}
1333 1333
 
@@ -1341,9 +1341,9 @@  discard block
 block discarded – undo
1341 1341
 	 * @throws \EE_Error
1342 1342
 	 */
1343 1343
 	public function go_to_next_step() {
1344
-		if ( EE_Registry::instance()->REQ->ajax ) {
1344
+		if (EE_Registry::instance()->REQ->ajax) {
1345 1345
 			// capture contents of output buffer we started earlier in the request, and insert into JSON response
1346
-			$this->checkout->json_response->set_unexpected_errors( ob_get_clean() );
1346
+			$this->checkout->json_response->set_unexpected_errors(ob_get_clean());
1347 1347
 		}
1348 1348
 		$this->unlock_transaction();
1349 1349
 		// just return for these conditions
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 	 */
1373 1373
 	protected function _handle_json_response() {
1374 1374
 		// if this is an ajax request
1375
-		if ( EE_Registry::instance()->REQ->ajax ) {
1375
+		if (EE_Registry::instance()->REQ->ajax) {
1376 1376
 			// DEBUG LOG
1377 1377
 			//$this->checkout->log(
1378 1378
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 			$this->checkout->json_response->set_registration_time_limit(
1386 1386
 				$this->checkout->get_registration_time_limit()
1387 1387
 			);
1388
-			$this->checkout->json_response->set_payment_amount( $this->checkout->amount_owing );
1388
+			$this->checkout->json_response->set_payment_amount($this->checkout->amount_owing);
1389 1389
 			// just send the ajax (
1390 1390
 			$json_response = apply_filters(
1391 1391
 				'FHEE__EE_Single_Page_Checkout__JSON_response',
@@ -1406,9 +1406,9 @@  discard block
 block discarded – undo
1406 1406
 	 */
1407 1407
 	protected function _handle_html_redirects() {
1408 1408
 		// going somewhere ?
1409
-		if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) {
1409
+		if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) {
1410 1410
 			// store notices in a transient
1411
-			EE_Error::get_notices( false, true, true );
1411
+			EE_Error::get_notices(false, true, true);
1412 1412
 			// DEBUG LOG
1413 1413
 			//$this->checkout->log(
1414 1414
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 			//		'headers_list'    => headers_list(),
1419 1419
 			//	)
1420 1420
 			//);
1421
-			wp_safe_redirect( $this->checkout->redirect_url );
1421
+			wp_safe_redirect($this->checkout->redirect_url);
1422 1422
 			exit();
1423 1423
 		}
1424 1424
 	}
Please login to merge, or discard this patch.