Completed
Branch FET-8385-datetime-ticket-selec... (cac7e5)
by
unknown
67:23 queued 43:13
created
core/libraries/form_sections/form_handlers/FormHandler.php 2 patches
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 use EventEspresso\core\exceptions\InvalidDataTypeException;
11 11
 use EventEspresso\core\exceptions\InvalidFormSubmissionException;
12 12
 
13
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
14
-	exit( 'No direct script access allowed' );
13
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
14
+	exit('No direct script access allowed');
15 15
 }
16 16
 
17 17
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  * @author        Brent Christensen
29 29
  * @since         4.9.0
30 30
  */
31
-abstract class FormHandler implements FormHandlerInterface{
31
+abstract class FormHandler implements FormHandlerInterface {
32 32
 
33 33
 	/**
34 34
 	 * will add opening and closing HTML form tags as well as a submit button
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 		$form_config = FormHandler::ADD_FORM_TAGS_AND_SUBMIT,
140 140
 		\EE_Registry $registry
141 141
 	) {
142
-		$this->setFormName( $form_name );
143
-		$this->setAdminName( $admin_name );
144
-		$this->setSlug( $slug );
145
-		$this->setFormAction( $form_action );
146
-		$this->setFormConfig( $form_config );
147
-		$this->setSubmitBtnText( __( 'Submit', 'event_espresso' ) );
142
+		$this->setFormName($form_name);
143
+		$this->setAdminName($admin_name);
144
+		$this->setSlug($slug);
145
+		$this->setFormAction($form_action);
146
+		$this->setFormConfig($form_config);
147
+		$this->setSubmitBtnText(__('Submit', 'event_espresso'));
148 148
 		$this->registry = $registry;
149 149
 	}
150 150
 
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 	 * @throws \EE_Error
171 171
 	 * @throws \LogicException
172 172
 	 */
173
-	public function form( $for_display = false ) {
174
-        if ( ! $this->formIsValid() ) {
173
+	public function form($for_display = false) {
174
+        if ( ! $this->formIsValid()) {
175 175
 			return null;
176 176
 		}
177
-		if ( $for_display ) {
177
+		if ($for_display) {
178 178
 			$form_config = $this->formConfig();
179 179
 			if (
180 180
 				$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
 	 * @throws LogicException
195 195
 	 */
196 196
 	public function formIsValid() {
197
-        if ( ! $this->form instanceof \EE_Form_Section_Proper ) {
197
+        if ( ! $this->form instanceof \EE_Form_Section_Proper) {
198 198
 			static $generated = false;
199
-			if ( ! $generated ) {
199
+			if ( ! $generated) {
200 200
 				$generated = true;
201 201
 				$form = $this->generate();
202
-                if ( $form instanceof \EE_Form_Section_Proper) {
202
+                if ($form instanceof \EE_Form_Section_Proper) {
203 203
                     $this->setForm($form);
204 204
                 }
205 205
 			}
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
 	 * @throws LogicException
216 216
 	 */
217 217
 	public function verifyForm() {
218
-		if ( $this->form instanceof \EE_Form_Section_Proper ) {
218
+		if ($this->form instanceof \EE_Form_Section_Proper) {
219 219
 			return true;
220 220
 		}
221 221
 		throw new LogicException(
222 222
 			sprintf(
223
-				__( 'The "%1$s" form is invalid or missing', 'event_espresso' ),
223
+				__('The "%1$s" form is invalid or missing', 'event_espresso'),
224 224
 				$this->form_name
225 225
 			)
226 226
 		);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	/**
232 232
 	 * @param \EE_Form_Section_Proper $form
233 233
 	 */
234
-	public function setForm( \EE_Form_Section_Proper $form ) {
234
+	public function setForm(\EE_Form_Section_Proper $form) {
235 235
 		$this->form = $form;
236 236
 	}
237 237
 
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
 	/**
250 250
 	 * @param boolean $displayable
251 251
 	 */
252
-	public function setDisplayable( $displayable = false ) {
253
-		$this->displayable = filter_var( $displayable, FILTER_VALIDATE_BOOLEAN );
252
+	public function setDisplayable($displayable = false) {
253
+		$this->displayable = filter_var($displayable, FILTER_VALIDATE_BOOLEAN);
254 254
 	}
255 255
 
256 256
 
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
 	 * @param string $form_name
271 271
 	 * @throws InvalidDataTypeException
272 272
 	 */
273
-	public function setFormName( $form_name ) {
274
-		if ( ! is_string( $form_name ) ) {
275
-			throw new InvalidDataTypeException( '$form_name', $form_name, 'string' );
273
+	public function setFormName($form_name) {
274
+		if ( ! is_string($form_name)) {
275
+			throw new InvalidDataTypeException('$form_name', $form_name, 'string');
276 276
 		}
277 277
 		$this->form_name = $form_name;
278 278
 	}
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 	 * @param string $admin_name
295 295
 	 * @throws InvalidDataTypeException
296 296
 	 */
297
-	public function setAdminName( $admin_name ) {
298
-		if ( ! is_string( $admin_name ) ) {
299
-			throw new InvalidDataTypeException( '$admin_name', $admin_name, 'string' );
297
+	public function setAdminName($admin_name) {
298
+		if ( ! is_string($admin_name)) {
299
+			throw new InvalidDataTypeException('$admin_name', $admin_name, 'string');
300 300
 		}
301 301
 		$this->admin_name = $admin_name;
302 302
 	}
@@ -318,9 +318,9 @@  discard block
 block discarded – undo
318 318
 	 * @param string $slug
319 319
 	 * @throws InvalidDataTypeException
320 320
 	 */
321
-	public function setSlug( $slug ) {
322
-		if ( ! is_string( $slug ) ) {
323
-			throw new InvalidDataTypeException( '$slug', $slug, 'string' );
321
+	public function setSlug($slug) {
322
+		if ( ! is_string($slug)) {
323
+			throw new InvalidDataTypeException('$slug', $slug, 'string');
324 324
 		}
325 325
 		$this->slug = $slug;
326 326
 	}
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 	/**
340 340
 	 * @param string $submit_btn_text
341 341
 	 */
342
-	public function setSubmitBtnText( $submit_btn_text ) {
343
-		if ( ! is_string( $submit_btn_text ) ) {
344
-			throw new InvalidDataTypeException( '$submit_btn_text', $submit_btn_text, 'string' );
342
+	public function setSubmitBtnText($submit_btn_text) {
343
+		if ( ! is_string($submit_btn_text)) {
344
+			throw new InvalidDataTypeException('$submit_btn_text', $submit_btn_text, 'string');
345 345
 		}
346
-		if ( empty( $submit_btn_text ) ) {
346
+		if (empty($submit_btn_text)) {
347 347
 			throw new InvalidArgumentException(
348
-				__( 'Can not set Submit button text because an empty string was provided.', 'event_espresso' )
348
+				__('Can not set Submit button text because an empty string was provided.', 'event_espresso')
349 349
 			);
350 350
 		}
351 351
 		$this->submit_btn_text = $submit_btn_text;
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 	 * @return string
358 358
 	 */
359 359
 	public function formAction() {
360
-		return ! empty( $this->form_args )
361
-			? add_query_arg( $this->form_args, $this->form_action )
360
+		return ! empty($this->form_args)
361
+			? add_query_arg($this->form_args, $this->form_action)
362 362
 			: $this->form_action;
363 363
 	}
364 364
 
@@ -368,9 +368,9 @@  discard block
 block discarded – undo
368 368
 	 * @param string $form_action
369 369
 	 * @throws InvalidDataTypeException
370 370
 	 */
371
-	public function setFormAction( $form_action ) {
372
-		if ( ! is_string( $form_action ) ) {
373
-			throw new InvalidDataTypeException( '$form_action', $form_action, 'string' );
371
+	public function setFormAction($form_action) {
372
+		if ( ! is_string($form_action)) {
373
+			throw new InvalidDataTypeException('$form_action', $form_action, 'string');
374 374
 		}
375 375
 		$this->form_action = $form_action;
376 376
 	}
@@ -382,20 +382,20 @@  discard block
 block discarded – undo
382 382
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
383 383
 	 * @throws \InvalidArgumentException
384 384
 	 */
385
-	public function addFormActionArgs( $form_args = array() ) {
386
-		if ( is_object( $form_args ) ) {
385
+	public function addFormActionArgs($form_args = array()) {
386
+		if (is_object($form_args)) {
387 387
 			throw new InvalidDataTypeException(
388 388
 				'$form_args',
389 389
 				$form_args,
390 390
 				'anything other than an object was expected.'
391 391
 			);
392 392
 		}
393
-		if ( empty( $form_args ) ) {
393
+		if (empty($form_args)) {
394 394
 			throw new InvalidArgumentException(
395
-				__( 'The redirect arguments can not be an empty array.', 'event_espresso' )
395
+				__('The redirect arguments can not be an empty array.', 'event_espresso')
396 396
 			);
397 397
 		}
398
-		$this->form_args = array_merge( $this->form_args, $form_args );
398
+		$this->form_args = array_merge($this->form_args, $form_args);
399 399
 	}
400 400
 
401 401
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 	 * @param string $form_config
414 414
 	 * @throws DomainException
415 415
 	 */
416
-	public function setFormConfig( $form_config ) {
416
+	public function setFormConfig($form_config) {
417 417
 		if (
418 418
 			! in_array(
419 419
 				$form_config,
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		) {
428 428
 			throw new DomainException(
429 429
 				sprintf(
430
-					__( '"%1$s" is not a valid value for the form config. Please use one of the class constants on \EventEspresso\core\libraries\form_sections\form_handlers\Form', 'event_espresso' ),
430
+					__('"%1$s" is not a valid value for the form config. Please use one of the class constants on \EventEspresso\core\libraries\form_sections\form_handlers\Form', 'event_espresso'),
431 431
 					$form_config
432 432
 				)
433 433
 			);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 	 * @return boolean
448 448
 	 */
449 449
 	public function initialize() {
450
-		$this->form_has_errors = \EE_Error::has_error( true );
450
+		$this->form_has_errors = \EE_Error::has_error(true);
451 451
 		return true;
452 452
 	}
453 453
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	 * @throws \EE_Error
462 462
 	 */
463 463
 	public function enqueueStylesAndScripts() {
464
-		$this->form( false )->enqueue_js();
464
+		$this->form(false)->enqueue_js();
465 465
 
466 466
 	}
467 467
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 	 *
473 473
 	 * @return EE_Form_Section_Proper
474 474
 	 */
475
-	abstract public function generate() ;
475
+	abstract public function generate();
476 476
 
477 477
 
478 478
 
@@ -482,15 +482,15 @@  discard block
 block discarded – undo
482 482
 	 * @param string $text
483 483
 	 * @return \EE_Submit_Input
484 484
 	 */
485
-	public function generateSubmitButton( $text = '' ) {
486
-		$text = ! empty( $text ) ? $text : $this->submitBtnText();
485
+	public function generateSubmitButton($text = '') {
486
+		$text = ! empty($text) ? $text : $this->submitBtnText();
487 487
 		return new EE_Submit_Input(
488 488
 			array(
489
-				'html_name'             => 'ee-form-submit-' . $this->slug(),
490
-				'html_id'               => 'ee-form-submit-' . $this->slug(),
489
+				'html_name'             => 'ee-form-submit-'.$this->slug(),
490
+				'html_id'               => 'ee-form-submit-'.$this->slug(),
491 491
 				'html_class'            => 'ee-form-submit',
492 492
 				'html_label'            => ' ',
493
-				'other_html_attributes' => ' rel="' . $this->slug() . '"',
493
+				'other_html_attributes' => ' rel="'.$this->slug().'"',
494 494
 				'default'               => $text
495 495
 			)
496 496
 		);
@@ -506,12 +506,12 @@  discard block
 block discarded – undo
506 506
 	 * @throws \LogicException
507 507
 	 * @throws \EE_Error
508 508
 	 */
509
-	public function appendSubmitButton( $text = '' ) {
510
-		if ( $this->form->subsection_exists( $this->slug() . '-submit-btn' ) ) {
509
+	public function appendSubmitButton($text = '') {
510
+		if ($this->form->subsection_exists($this->slug().'-submit-btn')) {
511 511
 			return;
512 512
 		}
513 513
 		$this->form->add_subsections(
514
-			array( $this->slug() . '-submit-btn' => $this->generateSubmitButton( $text ) ),
514
+			array($this->slug().'-submit-btn' => $this->generateSubmitButton($text)),
515 515
 			null,
516 516
 			false
517 517
 		);
@@ -525,18 +525,18 @@  discard block
 block discarded – undo
525 525
 	 * @param string $text
526 526
 	 * @return \EE_Submit_Input
527 527
 	 */
528
-	public function generateCancelButton( $text = '' ) {
528
+	public function generateCancelButton($text = '') {
529 529
 		$cancel_button = new EE_Submit_Input(
530 530
 			array(
531
-				'html_name'             => 'ee-form-submit-' . $this->slug(), // YES! Same name as submit !!!
532
-				'html_id'               => 'ee-cancel-form-' . $this->slug(),
531
+				'html_name'             => 'ee-form-submit-'.$this->slug(), // YES! Same name as submit !!!
532
+				'html_id'               => 'ee-cancel-form-'.$this->slug(),
533 533
 				'html_class'            => 'ee-cancel-form',
534 534
 				'html_label'            => ' ',
535
-				'other_html_attributes' => ' rel="' . $this->slug() . '"',
536
-				'default'               => ! empty( $text ) ? $text : __( 'Cancel', 'event_espresso' )
535
+				'other_html_attributes' => ' rel="'.$this->slug().'"',
536
+				'default'               => ! empty($text) ? $text : __('Cancel', 'event_espresso')
537 537
 			)
538 538
 		);
539
-		$cancel_button->set_button_css_attributes( false );
539
+		$cancel_button->set_button_css_attributes(false);
540 540
 		return $cancel_button;
541 541
 	}
542 542
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 		$this->form->add_subsections(
553 553
 			array(
554 554
 				'clear-submit-btn-float' => new \EE_Form_Section_HTML(
555
-					EEH_HTML::div( '', '', 'clear-float' ) . EEH_HTML::divx()
555
+					EEH_HTML::div('', '', 'clear-float').EEH_HTML::divx()
556 556
 				)
557 557
 			),
558 558
 			null,
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
 			$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
581 581
 			|| $form_config === FormHandler::ADD_FORM_TAGS_ONLY
582 582
 		) {
583
-			$form_html .= $this->form()->form_open( $this->formAction() );
583
+			$form_html .= $this->form()->form_open($this->formAction());
584 584
 		}
585
-		$form_html .= $this->form( true )->get_html( $this->form_has_errors );
585
+		$form_html .= $this->form(true)->get_html($this->form_has_errors);
586 586
 		if (
587 587
 			$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
588 588
 			|| $form_config === FormHandler::ADD_FORM_TAGS_ONLY
@@ -608,12 +608,12 @@  discard block
 block discarded – undo
608 608
 	 * @throws \LogicException
609 609
 	 * @throws InvalidFormSubmissionException
610 610
 	 */
611
-	public function process( $submitted_form_data = array() ) {
612
-		if ( ! $this->form()->was_submitted( $submitted_form_data ) ) {
613
-            throw new InvalidFormSubmissionException( $this->form_name );
611
+	public function process($submitted_form_data = array()) {
612
+		if ( ! $this->form()->was_submitted($submitted_form_data)) {
613
+            throw new InvalidFormSubmissionException($this->form_name);
614 614
 		}
615
-        $this->form( true )->receive_form_submission( $submitted_form_data );
616
-		if ( ! $this->form()->is_valid() ) {
615
+        $this->form(true)->receive_form_submission($submitted_form_data);
616
+		if ( ! $this->form()->is_valid()) {
617 617
             throw new InvalidFormSubmissionException(
618 618
 				$this->form_name,
619 619
 				sprintf(
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 
120 120
 
121 121
 
122
-    /**
123
-     * Form constructor.
124
-     *
125
-     * @param string       $form_name
126
-     * @param string       $admin_name
127
-     * @param string       $slug
128
-     * @param string       $form_action
129
-     * @param string       $form_config
130
-     * @param \EE_Registry $registry
131
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
132
-     * @throws \DomainException
133
-     * @throws \InvalidArgumentException
134
-     */
122
+	/**
123
+	 * Form constructor.
124
+	 *
125
+	 * @param string       $form_name
126
+	 * @param string       $admin_name
127
+	 * @param string       $slug
128
+	 * @param string       $form_action
129
+	 * @param string       $form_config
130
+	 * @param \EE_Registry $registry
131
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
132
+	 * @throws \DomainException
133
+	 * @throws \InvalidArgumentException
134
+	 */
135 135
 	public function __construct(
136 136
 		$form_name,
137 137
 		$admin_name,
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * @throws \LogicException
173 173
 	 */
174 174
 	public function form( $for_display = false ) {
175
-        if ( ! $this->formIsValid() ) {
175
+		if ( ! $this->formIsValid() ) {
176 176
 			return null;
177 177
 		}
178 178
 		if ( $for_display ) {
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
 	 * @throws LogicException
196 196
 	 */
197 197
 	public function formIsValid() {
198
-        if ( ! $this->form instanceof \EE_Form_Section_Proper ) {
198
+		if ( ! $this->form instanceof \EE_Form_Section_Proper ) {
199 199
 			static $generated = false;
200 200
 			if ( ! $generated ) {
201 201
 				$generated = true;
202 202
 				$form = $this->generate();
203
-                if ( $form instanceof \EE_Form_Section_Proper) {
204
-                    $this->setForm($form);
205
-                }
203
+				if ( $form instanceof \EE_Form_Section_Proper) {
204
+					$this->setForm($form);
205
+				}
206 206
 			}
207 207
 			return $this->verifyForm();
208 208
 		}
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
 
338 338
 
339 339
 
340
-    /**
341
-     * @param string $submit_btn_text
342
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
343
-     * @throws \InvalidArgumentException
344
-     */
340
+	/**
341
+	 * @param string $submit_btn_text
342
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
343
+	 * @throws \InvalidArgumentException
344
+	 */
345 345
 	public function setSubmitBtnText( $submit_btn_text ) {
346 346
 		if ( ! is_string( $submit_btn_text ) ) {
347 347
 			throw new InvalidDataTypeException( '$submit_btn_text', $submit_btn_text, 'string' );
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	 * @throws \EE_Error
575 575
 	 */
576 576
 	public function display() {
577
-        $form_html = apply_filters(
577
+		$form_html = apply_filters(
578 578
 			'FHEE__EventEspresso_core_libraries_form_sections_form_handlers_FormHandler__display__before_form',
579 579
 			''
580 580
 		);
@@ -613,11 +613,11 @@  discard block
 block discarded – undo
613 613
 	 */
614 614
 	public function process( $submitted_form_data = array() ) {
615 615
 		if ( ! $this->form()->was_submitted( $submitted_form_data ) ) {
616
-            throw new InvalidFormSubmissionException( $this->form_name );
616
+			throw new InvalidFormSubmissionException( $this->form_name );
617 617
 		}
618
-        $this->form( true )->receive_form_submission( $submitted_form_data );
618
+		$this->form( true )->receive_form_submission( $submitted_form_data );
619 619
 		if ( ! $this->form()->is_valid() ) {
620
-            throw new InvalidFormSubmissionException(
620
+			throw new InvalidFormSubmissionException(
621 621
 				$this->form_name,
622 622
 				sprintf(
623 623
 					__(
Please login to merge, or discard this patch.
modules/single_page_checkout/EED_Single_Page_Checkout.module.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 
323 323
 
324 324
 	/**
325
-     * process_registration_from_admin
326
-     *
327
-     * @access public
325
+	 * process_registration_from_admin
326
+	 *
327
+	 * @access public
328 328
 	 * @return \EE_Transaction
329 329
 	 * @throws \EE_Error
330 330
 	 */
@@ -819,15 +819,15 @@  discard block
 block discarded – undo
819 819
 
820 820
 
821 821
 
822
-    /**
823
-     * _get_registrations
824
-     *
825
-     * @access private
826
-     * @param EE_Transaction $transaction
827
-     * @return void
828
-     * @throws \EventEspresso\core\exceptions\InvalidEntityException
829
-     * @throws \EE_Error
830
-     */
822
+	/**
823
+	 * _get_registrations
824
+	 *
825
+	 * @access private
826
+	 * @param EE_Transaction $transaction
827
+	 * @return void
828
+	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
829
+	 * @throws \EE_Error
830
+	 */
831 831
 	private function _get_registrations( EE_Transaction $transaction ) {
832 832
 		// first step: grab the registrants  { : o
833 833
 		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true );
@@ -849,12 +849,12 @@  discard block
 block discarded – undo
849 849
 			if ( $registration instanceof EE_Registration ) {
850 850
 				// we display all attendee info for the primary registrant
851 851
 				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
852
-				     && $registration->is_primary_registrant()
852
+					 && $registration->is_primary_registrant()
853 853
 				) {
854 854
 					$this->checkout->primary_revisit = true;
855 855
 					break;
856 856
 				} else if ( $this->checkout->revisit
857
-				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
857
+							&& $this->checkout->reg_url_link !== $registration->reg_url_link()
858 858
 				) {
859 859
 					// but hide info if it doesn't belong to you
860 860
 					$transaction->clear_cache( 'Registration', $registration->ID() );
@@ -866,15 +866,15 @@  discard block
 block discarded – undo
866 866
 
867 867
 
868 868
 
869
-    /**
870
-     *    adds related EE_Registration objects for each ticket in the cart to the current EE_Transaction object
871
-     *
872
-     * @access private
873
-     * @param EE_Transaction $transaction
874
-     * @return    array
875
-     * @throws \EventEspresso\core\exceptions\InvalidEntityException
876
-     * @throws \EE_Error
877
-     */
869
+	/**
870
+	 *    adds related EE_Registration objects for each ticket in the cart to the current EE_Transaction object
871
+	 *
872
+	 * @access private
873
+	 * @param EE_Transaction $transaction
874
+	 * @return    array
875
+	 * @throws \EventEspresso\core\exceptions\InvalidEntityException
876
+	 * @throws \EE_Error
877
+	 */
878 878
 	private function _initialize_registrations( EE_Transaction $transaction ) {
879 879
 		$att_nmbr = 0;
880 880
 		$registrations = array();
@@ -887,23 +887,23 @@  discard block
 block discarded – undo
887 887
 				//do the following for each ticket of this type they selected
888 888
 				for ( $x = 1; $x <= $line_item->quantity(); $x++ ) {
889 889
 					$att_nmbr++;
890
-                    /** @var EventEspresso\core\services\commands\registration\CreateRegistrationCommand $CreateRegistrationCommand */
891
-                    $CreateRegistrationCommand = EE_Registry::instance()
892
-                        ->create(
893
-                           'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
894
-                           array(
895
-	                           $transaction,
896
-	                           $line_item,
897
-	                           $att_nmbr,
898
-	                           $this->checkout->total_ticket_count
899
-                           )
900
-                        );
901
-                    // override capabilities for frontend registrations
902
-                    if ( ! is_admin()) {
903
-                        $CreateRegistrationCommand->setCapCheck(
904
-	                        new PublicCapabilities( '', 'create_new_registration' )
905
-                        );
906
-                    }
890
+					/** @var EventEspresso\core\services\commands\registration\CreateRegistrationCommand $CreateRegistrationCommand */
891
+					$CreateRegistrationCommand = EE_Registry::instance()
892
+						->create(
893
+						   'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
894
+						   array(
895
+							   $transaction,
896
+							   $line_item,
897
+							   $att_nmbr,
898
+							   $this->checkout->total_ticket_count
899
+						   )
900
+						);
901
+					// override capabilities for frontend registrations
902
+					if ( ! is_admin()) {
903
+						$CreateRegistrationCommand->setCapCheck(
904
+							new PublicCapabilities( '', 'create_new_registration' )
905
+						);
906
+					}
907 907
 					$registration = EE_Registry::instance()->BUS->execute( $CreateRegistrationCommand );
908 908
 					if ( ! $registration instanceof EE_Registration ) {
909 909
 						throw new InvalidEntityException( $registration, 'EE_Registration' );
@@ -1395,10 +1395,10 @@  discard block
 block discarded – undo
1395 1395
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1396 1396
 			}
1397 1397
 			$this->checkout->redirect_url = apply_filters(
1398
-			    'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url',
1399
-                $this->checkout->redirect_url,
1400
-                $this->checkout
1401
-            );
1398
+				'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url',
1399
+				$this->checkout->redirect_url,
1400
+				$this->checkout
1401
+			);
1402 1402
 		}
1403 1403
 	}
1404 1404
 
Please login to merge, or discard this patch.
Spacing   +265 added lines, -265 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php use EventEspresso\core\domain\services\capabilities\PublicCapabilities;
2 2
 use EventEspresso\core\exceptions\InvalidEntityException;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 * @return EED_Single_Page_Checkout
55 55
 	 */
56 56
 	public static function instance() {
57
-		add_filter( 'EED_Single_Page_Checkout__SPCO_active', '__return_true' );
58
-		return parent::get_instance( __CLASS__ );
57
+		add_filter('EED_Single_Page_Checkout__SPCO_active', '__return_true');
58
+		return parent::get_instance(__CLASS__);
59 59
 	}
60 60
 
61 61
 
@@ -100,22 +100,22 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public static function set_hooks_admin() {
102 102
 		EED_Single_Page_Checkout::set_definitions();
103
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
103
+		if (defined('DOING_AJAX') && DOING_AJAX) {
104 104
 			// going to start an output buffer in case anything gets accidentally output that might disrupt our JSON response
105 105
 			ob_start();
106 106
 			EED_Single_Page_Checkout::load_request_handler();
107 107
 			EED_Single_Page_Checkout::load_reg_steps();
108 108
 		} else {
109 109
 			// 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
110
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
110
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
111 111
 		}
112 112
 		// set ajax hooks
113
-		add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
114
-		add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
115
-		add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
116
-		add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
117
-		add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
118
-		add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
113
+		add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
114
+		add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
115
+		add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
116
+		add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
117
+		add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
118
+		add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
119 119
 	}
120 120
 
121 121
 
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 * @param string $ajax_action
127 127
 	 * @throws \EE_Error
128 128
 	 */
129
-	public static function process_ajax_request( $ajax_action ) {
130
-		EE_Registry::instance()->REQ->set( 'action', $ajax_action );
129
+	public static function process_ajax_request($ajax_action) {
130
+		EE_Registry::instance()->REQ->set('action', $ajax_action);
131 131
 		EED_Single_Page_Checkout::instance()->_initialize();
132 132
 	}
133 133
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @throws \EE_Error
140 140
 	 */
141 141
 	public static function display_reg_step() {
142
-		EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' );
142
+		EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step');
143 143
 	}
144 144
 
145 145
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 * @throws \EE_Error
151 151
 	 */
152 152
 	public static function process_reg_step() {
153
-		EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' );
153
+		EED_Single_Page_Checkout::process_ajax_request('process_reg_step');
154 154
 	}
155 155
 
156 156
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * @throws \EE_Error
162 162
 	 */
163 163
 	public static function update_reg_step() {
164
-		EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' );
164
+		EED_Single_Page_Checkout::process_ajax_request('update_reg_step');
165 165
 	}
166 166
 
167 167
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * @throws \EE_Error
175 175
 	 */
176 176
 	public static function update_checkout() {
177
-		EED_Single_Page_Checkout::process_ajax_request( 'update_checkout' );
177
+		EED_Single_Page_Checkout::process_ajax_request('update_checkout');
178 178
 	}
179 179
 
180 180
 
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public static function load_request_handler() {
189 189
 		// load core Request_Handler class
190
-		if ( ! isset( EE_Registry::instance()->REQ )) {
191
-			EE_Registry::instance()->load_core( 'Request_Handler' );
190
+		if ( ! isset(EE_Registry::instance()->REQ)) {
191
+			EE_Registry::instance()->load_core('Request_Handler');
192 192
 		}
193 193
 	}
194 194
 
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	 * @throws \EE_Error
203 203
 	 */
204 204
 	public static function set_definitions() {
205
-		define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
206
-		define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS );
207
-		define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS );
208
-		define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS );
209
-		define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS );
210
-		define( 'SPCO_REG_STEPS_PATH', SPCO_BASE_PATH . 'reg_steps' . DS );
211
-		define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS );
212
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE );
205
+		define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
206
+		define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS);
207
+		define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS);
208
+		define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS);
209
+		define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS);
210
+		define('SPCO_REG_STEPS_PATH', SPCO_BASE_PATH.'reg_steps'.DS);
211
+		define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS);
212
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE);
213 213
 	}
214 214
 
215 215
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public static function load_reg_steps() {
226 226
 		static $reg_steps_loaded = FALSE;
227
-		if ( $reg_steps_loaded ) {
227
+		if ($reg_steps_loaded) {
228 228
 			return;
229 229
 		}
230 230
 		// filter list of reg_steps
@@ -233,24 +233,24 @@  discard block
 block discarded – undo
233 233
 			EED_Single_Page_Checkout::get_reg_steps()
234 234
 		);
235 235
 		// sort by key (order)
236
-		ksort( $reg_steps_to_load );
236
+		ksort($reg_steps_to_load);
237 237
 		// loop through folders
238
-		foreach ( $reg_steps_to_load as $order => $reg_step ) {
238
+		foreach ($reg_steps_to_load as $order => $reg_step) {
239 239
 			// we need a
240
-			if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
240
+			if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
241 241
 				// copy over to the reg_steps_array
242
-				EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step;
242
+				EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step;
243 243
 				// register custom key route for each reg step
244 244
 				// ie: step=>"slug" - this is the entire reason we load the reg steps array now
245
-				EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' );
245
+				EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step');
246 246
 				// add AJAX or other hooks
247
-				if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) {
247
+				if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) {
248 248
 					// setup autoloaders if necessary
249
-					if ( ! class_exists( $reg_step['class_name'] )) {
250
-						EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE );
249
+					if ( ! class_exists($reg_step['class_name'])) {
250
+						EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE);
251 251
 					}
252
-					if ( is_callable( $reg_step['class_name'], 'set_hooks' )) {
253
-						call_user_func( array( $reg_step['class_name'], 'set_hooks' ));
252
+					if (is_callable($reg_step['class_name'], 'set_hooks')) {
253
+						call_user_func(array($reg_step['class_name'], 'set_hooks'));
254 254
 					}
255 255
 				}
256 256
 			}
@@ -269,28 +269,28 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	public static function get_reg_steps() {
271 271
 		$reg_steps = EE_Registry::instance()->CFG->registration->reg_steps;
272
-		if ( empty( $reg_steps )) {
272
+		if (empty($reg_steps)) {
273 273
 			$reg_steps = array(
274 274
 				10 => array(
275
-					'file_path' => SPCO_REG_STEPS_PATH . 'attendee_information',
275
+					'file_path' => SPCO_REG_STEPS_PATH.'attendee_information',
276 276
 					'class_name' => 'EE_SPCO_Reg_Step_Attendee_Information',
277 277
 					'slug' => 'attendee_information',
278 278
 					'has_hooks' => FALSE
279 279
 				),
280 280
 				20 => array(
281
-					'file_path' => SPCO_REG_STEPS_PATH . 'registration_confirmation',
281
+					'file_path' => SPCO_REG_STEPS_PATH.'registration_confirmation',
282 282
 					'class_name' => 'EE_SPCO_Reg_Step_Registration_Confirmation',
283 283
 					'slug' => 'registration_confirmation',
284 284
 					'has_hooks' => FALSE
285 285
 				),
286 286
 				30 => array(
287
-					'file_path' => SPCO_REG_STEPS_PATH . 'payment_options',
287
+					'file_path' => SPCO_REG_STEPS_PATH.'payment_options',
288 288
 					'class_name' => 'EE_SPCO_Reg_Step_Payment_Options',
289 289
 					'slug' => 'payment_options',
290 290
 					'has_hooks' => TRUE
291 291
 				),
292 292
 				999 => array(
293
-					'file_path' => SPCO_REG_STEPS_PATH . 'finalize_registration',
293
+					'file_path' => SPCO_REG_STEPS_PATH.'finalize_registration',
294 294
 					'class_name' => 'EE_SPCO_Reg_Step_Finalize_Registration',
295 295
 					'slug' => 'finalize_registration',
296 296
 					'has_hooks' => FALSE
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 	 */
312 312
 	public static function registration_checkout_for_admin() {
313 313
 		EED_Single_Page_Checkout::load_reg_steps();
314
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
315
-		EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' );
316
-		EE_Registry::instance()->REQ->set( 'process_form_submission', false );
314
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
315
+		EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step');
316
+		EE_Registry::instance()->REQ->set('process_form_submission', false);
317 317
 		EED_Single_Page_Checkout::instance()->_initialize();
318 318
 		EED_Single_Page_Checkout::instance()->_display_spco_reg_form();
319 319
 		return EE_Registry::instance()->REQ->get_output();
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 	 */
331 331
 	public static function process_registration_from_admin() {
332 332
 		EED_Single_Page_Checkout::load_reg_steps();
333
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
334
-		EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' );
335
-		EE_Registry::instance()->REQ->set( 'process_form_submission', true );
333
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
334
+		EE_Registry::instance()->REQ->set('action', 'process_reg_step');
335
+		EE_Registry::instance()->REQ->set('process_form_submission', true);
336 336
 		EED_Single_Page_Checkout::instance()->_initialize();
337
-		if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) {
338
-			$final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps );
339
-			if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
340
-				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated( $final_reg_step );
341
-				if ( $final_reg_step->process_reg_step() ) {
337
+		if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) {
338
+			$final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps);
339
+			if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
340
+				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated($final_reg_step);
341
+				if ($final_reg_step->process_reg_step()) {
342 342
 					$final_reg_step->set_completed();
343 343
 					EED_Single_Page_Checkout::instance()->checkout->update_txn_reg_steps_array();
344 344
 					return EED_Single_Page_Checkout::instance()->checkout->transaction;
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
 	 * @return    void
359 359
 	 * @throws \EE_Error
360 360
 	 */
361
-	public function run( $WP_Query ) {
361
+	public function run($WP_Query) {
362 362
 		if (
363 363
 			$WP_Query instanceof WP_Query
364 364
 			&& $WP_Query->is_main_query()
365
-			&& apply_filters( 'FHEE__EED_Single_Page_Checkout__run', true )
366
-			&& isset( $WP_Query->query['pagename'] )
367
-			&& strpos( EE_Config::instance()->core->reg_page_url(), $WP_Query->query['pagename'] ) !== false
365
+			&& apply_filters('FHEE__EED_Single_Page_Checkout__run', true)
366
+			&& isset($WP_Query->query['pagename'])
367
+			&& strpos(EE_Config::instance()->core->reg_page_url(), $WP_Query->query['pagename']) !== false
368 368
 		) {
369 369
 			$this->_initialize();
370 370
 		}
@@ -380,8 +380,8 @@  discard block
 block discarded – undo
380 380
 	 * @return    void
381 381
 	 * @throws \EE_Error
382 382
 	 */
383
-	public static function init( $WP_Query ) {
384
-		EED_Single_Page_Checkout::instance()->run( $WP_Query );
383
+	public static function init($WP_Query) {
384
+		EED_Single_Page_Checkout::instance()->run($WP_Query);
385 385
 	}
386 386
 
387 387
 
@@ -395,35 +395,35 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	private function _initialize() {
397 397
 		// ensure SPCO doesn't run twice
398
-		if ( EED_Single_Page_Checkout::$_initialized ) {
398
+		if (EED_Single_Page_Checkout::$_initialized) {
399 399
 			return;
400 400
 		}
401 401
 		try {
402 402
 			// setup the EE_Checkout object
403 403
 			$this->checkout = $this->_initialize_checkout();
404 404
 			// filter checkout
405
-			$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout );
405
+			$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout);
406 406
 			// get the $_GET
407 407
 			$this->_get_request_vars();
408 408
 			$this->_block_bots();
409 409
 			// filter continue_reg
410
-			$this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout );
410
+			$this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout);
411 411
 			// load the reg steps array
412
-			if ( ! $this->_load_and_instantiate_reg_steps() ) {
412
+			if ( ! $this->_load_and_instantiate_reg_steps()) {
413 413
 				EED_Single_Page_Checkout::$_initialized = true;
414 414
 				return;
415 415
 			}
416 416
 			// set the current step
417
-			$this->checkout->set_current_step( $this->checkout->step );
417
+			$this->checkout->set_current_step($this->checkout->step);
418 418
 			// and the next step
419 419
 			$this->checkout->set_next_step();
420 420
 			// was there already a valid transaction in the checkout from the session ?
421
-			if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
421
+			if ( ! $this->checkout->transaction instanceof EE_Transaction) {
422 422
 				// get transaction from db or session
423 423
 				$this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin()
424 424
 					? $this->_get_transaction_and_cart_for_previous_visit()
425 425
 					: $this->_get_cart_for_current_session_and_setup_new_transaction();
426
-				if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
426
+				if ( ! $this->checkout->transaction instanceof EE_Transaction) {
427 427
 					// add some style and make it dance
428 428
 					$this->checkout->transaction = EE_Transaction::new_instance();
429 429
 					$this->add_styles_and_scripts();
@@ -431,10 +431,10 @@  discard block
 block discarded – undo
431 431
 					return;
432 432
 				}
433 433
 				// and the registrations for the transaction
434
-				$this->_get_registrations( $this->checkout->transaction );
434
+				$this->_get_registrations($this->checkout->transaction);
435 435
 			}
436 436
 			// verify that everything has been setup correctly
437
-			if ( ! $this->_final_verifications() ) {
437
+			if ( ! $this->_final_verifications()) {
438 438
 				EED_Single_Page_Checkout::$_initialized = true;
439 439
 				return;
440 440
 			}
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
 			// set no cache headers and constants
460 460
 			EE_System::do_not_cache();
461 461
 			// add anchor
462
-			add_action( 'loop_start', array( $this, 'set_checkout_anchor' ), 1 );
463
-		} catch ( Exception $e ) {
464
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
462
+			add_action('loop_start', array($this, 'set_checkout_anchor'), 1);
463
+		} catch (Exception $e) {
464
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
465 465
 		}
466 466
 	}
467 467
 
@@ -479,20 +479,20 @@  discard block
 block discarded – undo
479 479
 		// look in session for existing checkout
480 480
 		$checkout = EE_Registry::instance()->SSN->checkout();
481 481
 		// verify
482
-		if ( ! $checkout instanceof EE_Checkout ) {
482
+		if ( ! $checkout instanceof EE_Checkout) {
483 483
 			// instantiate EE_Checkout object for handling the properties of the current checkout process
484
-			$checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE  );
484
+			$checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE);
485 485
 		} else {
486
-			if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true )  {
486
+			if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) {
487 487
 				$this->unlock_transaction();
488
-				wp_safe_redirect( $checkout->redirect_url );
488
+				wp_safe_redirect($checkout->redirect_url);
489 489
 				exit();
490 490
 			}
491 491
 		}
492
-		$checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout );
492
+		$checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout);
493 493
 		// verify again
494
-		if ( ! $checkout instanceof EE_Checkout ) {
495
-			throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) );
494
+		if ( ! $checkout instanceof EE_Checkout) {
495
+			throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso'));
496 496
 		}
497 497
 		// reset anything that needs a clean slate for each request
498 498
 		$checkout->reset_for_current_request();
@@ -512,26 +512,26 @@  discard block
 block discarded – undo
512 512
 		// load classes
513 513
 		EED_Single_Page_Checkout::load_request_handler();
514 514
 		//make sure this request is marked as belonging to EE
515
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
515
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
516 516
 		// which step is being requested ?
517
-		$this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() );
517
+		$this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step());
518 518
 		// which step is being edited ?
519
-		$this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' );
519
+		$this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', '');
520 520
 		// and what we're doing on the current step
521
-		$this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' );
521
+		$this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step');
522 522
 		// timestamp
523
-		$this->checkout->uts = EE_Registry::instance()->REQ->get( 'uts', 0 );
523
+		$this->checkout->uts = EE_Registry::instance()->REQ->get('uts', 0);
524 524
 		// returning to edit ?
525
-		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' );
525
+		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', '');
526 526
 		// or some other kind of revisit ?
527
-		$this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE );
527
+		$this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE);
528 528
 		// and whether or not to generate a reg form for this request
529
-		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); 		// TRUE 	FALSE
529
+		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE 	FALSE
530 530
 		// and whether or not to process a reg form submission for this request
531
-		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); 		// TRUE 	FALSE
531
+		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE 	FALSE
532 532
 		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step'
533 533
 			? $this->checkout->process_form_submission
534
-			: FALSE; 		// TRUE 	FALSE
534
+			: FALSE; // TRUE 	FALSE
535 535
 		// $this->_display_request_vars();
536 536
 	}
537 537
 
@@ -544,17 +544,17 @@  discard block
 block discarded – undo
544 544
 	 * @return    void
545 545
 	 */
546 546
 	protected function _display_request_vars() {
547
-		if ( ! WP_DEBUG ) {
547
+		if ( ! WP_DEBUG) {
548 548
 			return;
549 549
 		}
550
-		EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
551
-		EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ );
552
-		EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ );
553
-		EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ );
554
-		EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ );
555
-		EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ );
556
-		EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ );
557
-		EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ );
550
+		EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__);
551
+		EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__);
552
+		EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__);
553
+		EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__);
554
+		EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__);
555
+		EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__);
556
+		EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__);
557
+		EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__);
558 558
 	}
559 559
 
560 560
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 	 */
570 570
 	private function _block_bots() {
571 571
 		$invalid_checkout_access = \EED_Invalid_Checkout_Access::getInvalidCheckoutAccess();
572
-		if ( $invalid_checkout_access->checkoutAccessIsInvalid( $this->checkout ) ) {
572
+		if ($invalid_checkout_access->checkoutAccessIsInvalid($this->checkout)) {
573 573
 			$this->_handle_html_redirects();
574 574
 		}
575 575
 	}
@@ -585,8 +585,8 @@  discard block
 block discarded – undo
585 585
 	 * @return    array
586 586
 	 */
587 587
 	private function _get_first_step() {
588
-		$first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array );
589
-		return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information';
588
+		$first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array);
589
+		return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information';
590 590
 	}
591 591
 
592 592
 
@@ -602,27 +602,27 @@  discard block
 block discarded – undo
602 602
 	private function _load_and_instantiate_reg_steps() {
603 603
 		// have reg_steps already been instantiated ?
604 604
 		if (
605
-			empty( $this->checkout->reg_steps ) ||
606
-			apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout )
605
+			empty($this->checkout->reg_steps) ||
606
+			apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout)
607 607
 		) {
608 608
 			// if not, then loop through raw reg steps array
609
-			foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) {
610
-				if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) {
609
+			foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) {
610
+				if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) {
611 611
 					return false;
612 612
 				}
613 613
 			}
614 614
 			EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE;
615 615
 			EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE;
616 616
 			// skip the registration_confirmation page ?
617
-			if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) {
617
+			if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) {
618 618
 				// just remove it from the reg steps array
619
-				$this->checkout->remove_reg_step( 'registration_confirmation', false );
619
+				$this->checkout->remove_reg_step('registration_confirmation', false);
620 620
 			} else if (
621
-				isset( $this->checkout->reg_steps['registration_confirmation'] )
621
+				isset($this->checkout->reg_steps['registration_confirmation'])
622 622
 				&& EE_Registry::instance()->CFG->registration->reg_confirmation_last
623 623
 			) {
624 624
 				// set the order to something big like 100
625
-				$this->checkout->set_reg_step_order( 'registration_confirmation', 100 );
625
+				$this->checkout->set_reg_step_order('registration_confirmation', 100);
626 626
 			}
627 627
 			// filter the array for good luck
628 628
 			$this->checkout->reg_steps = apply_filters(
@@ -632,13 +632,13 @@  discard block
 block discarded – undo
632 632
 			// finally re-sort based on the reg step class order properties
633 633
 			$this->checkout->sort_reg_steps();
634 634
 		} else {
635
-			foreach ( $this->checkout->reg_steps as $reg_step ) {
635
+			foreach ($this->checkout->reg_steps as $reg_step) {
636 636
 				// set all current step stati to FALSE
637
-				$reg_step->set_is_current_step( FALSE );
637
+				$reg_step->set_is_current_step(FALSE);
638 638
 			}
639 639
 		}
640
-		if ( empty( $this->checkout->reg_steps )) {
641
-			EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
640
+		if (empty($this->checkout->reg_steps)) {
641
+			EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
642 642
 			return false;
643 643
 		}
644 644
 			// make reg step details available to JS
@@ -656,10 +656,10 @@  discard block
 block discarded – undo
656 656
 	 * @param int   $order
657 657
 	 * @return bool
658 658
 	 */
659
-	private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) {
659
+	private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) {
660 660
 
661 661
 		// we need a file_path, class_name, and slug to add a reg step
662
-		if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
662
+		if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
663 663
 			// if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step)
664 664
 			if (
665 665
 				$this->checkout->reg_url_link
@@ -677,26 +677,26 @@  discard block
 block discarded – undo
677 677
 				FALSE
678 678
 			);
679 679
 			// did we gets the goods ?
680
-			if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) {
680
+			if ($reg_step_obj instanceof EE_SPCO_Reg_Step) {
681 681
 				// set reg step order based on config
682
-				$reg_step_obj->set_order( $order );
682
+				$reg_step_obj->set_order($order);
683 683
 				// add instantiated reg step object to the master reg steps array
684
-				$this->checkout->add_reg_step( $reg_step_obj );
684
+				$this->checkout->add_reg_step($reg_step_obj);
685 685
 			} else {
686 686
 				EE_Error::add_error(
687
-					__( 'The current step could not be set.', 'event_espresso' ),
687
+					__('The current step could not be set.', 'event_espresso'),
688 688
 					__FILE__, __FUNCTION__, __LINE__
689 689
 				);
690 690
 				return false;
691 691
 			}
692 692
 		} else {
693
-			if ( WP_DEBUG ) {
693
+			if (WP_DEBUG) {
694 694
 				EE_Error::add_error(
695 695
 					sprintf(
696
-						__( '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' ),
697
-						isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '',
698
-						isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '',
699
-						isset( $reg_step['slug'] ) ? $reg_step['slug'] : '',
696
+						__('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'),
697
+						isset($reg_step['file_path']) ? $reg_step['file_path'] : '',
698
+						isset($reg_step['class_name']) ? $reg_step['class_name'] : '',
699
+						isset($reg_step['slug']) ? $reg_step['slug'] : '',
700 700
 						'<ul>',
701 701
 						'<li>',
702 702
 						'</li>',
@@ -720,16 +720,16 @@  discard block
 block discarded – undo
720 720
 	 */
721 721
 	private function _get_transaction_and_cart_for_previous_visit() {
722 722
 		/** @var $TXN_model EEM_Transaction */
723
-		$TXN_model = EE_Registry::instance()->load_model( 'Transaction' );
723
+		$TXN_model = EE_Registry::instance()->load_model('Transaction');
724 724
 		// 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
725
-		$transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link );
725
+		$transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link);
726 726
 		// verify transaction
727
-		if ( $transaction instanceof EE_Transaction ) {
727
+		if ($transaction instanceof EE_Transaction) {
728 728
 			// and get the cart that was used for that transaction
729
-			$this->checkout->cart = $this->_get_cart_for_transaction( $transaction );
729
+			$this->checkout->cart = $this->_get_cart_for_transaction($transaction);
730 730
 			return $transaction;
731 731
 		} else {
732
-			EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
732
+			EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
733 733
 			return NULL;
734 734
 		}
735 735
 	}
@@ -743,8 +743,8 @@  discard block
 block discarded – undo
743 743
 	 * @param EE_Transaction $transaction
744 744
 	 * @return EE_Cart
745 745
 	 */
746
-	private function _get_cart_for_transaction( $transaction ) {
747
-		return $this->checkout->get_cart_for_transaction( $transaction );
746
+	private function _get_cart_for_transaction($transaction) {
747
+		return $this->checkout->get_cart_for_transaction($transaction);
748 748
 	}
749 749
 
750 750
 
@@ -756,8 +756,8 @@  discard block
 block discarded – undo
756 756
 	 * @param EE_Transaction $transaction
757 757
 	 * @return EE_Cart
758 758
 	 */
759
-	public function get_cart_for_transaction( EE_Transaction $transaction ) {
760
-		return $this->checkout->get_cart_for_transaction( $transaction );
759
+	public function get_cart_for_transaction(EE_Transaction $transaction) {
760
+		return $this->checkout->get_cart_for_transaction($transaction);
761 761
 	}
762 762
 
763 763
 
@@ -773,17 +773,17 @@  discard block
 block discarded – undo
773 773
 	private function _get_cart_for_current_session_and_setup_new_transaction() {
774 774
 		//  if there's no transaction, then this is the FIRST visit to SPCO
775 775
 		// so load up the cart ( passing nothing for the TXN because it doesn't exist yet )
776
-		$this->checkout->cart = $this->_get_cart_for_transaction( NULL );
776
+		$this->checkout->cart = $this->_get_cart_for_transaction(NULL);
777 777
 		// and then create a new transaction
778 778
 		$transaction = $this->_initialize_transaction();
779 779
 		// verify transaction
780
-		if ( $transaction instanceof EE_Transaction ) {
780
+		if ($transaction instanceof EE_Transaction) {
781 781
 			// save it so that we have an ID for other objects to use
782 782
 			$transaction->save();
783 783
 			// and save TXN data to the cart
784
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() );
784
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID());
785 785
 		} else {
786
-			EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
786
+			EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
787 787
 		}
788 788
 		return $transaction;
789 789
 	}
@@ -811,8 +811,8 @@  discard block
 block discarded – undo
811 811
 					'STS_ID'        => EEM_Transaction::failed_status_code,
812 812
 				)
813 813
 			);
814
-		} catch( Exception $e ) {
815
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
814
+		} catch (Exception $e) {
815
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
816 816
 		}
817 817
 		return NULL;
818 818
 	}
@@ -828,38 +828,38 @@  discard block
 block discarded – undo
828 828
      * @throws \EventEspresso\core\exceptions\InvalidEntityException
829 829
      * @throws \EE_Error
830 830
      */
831
-	private function _get_registrations( EE_Transaction $transaction ) {
831
+	private function _get_registrations(EE_Transaction $transaction) {
832 832
 		// first step: grab the registrants  { : o
833
-		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true );
833
+		$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
834 834
 		// verify registrations have been set
835
-		if ( empty( $registrations )) {
835
+		if (empty($registrations)) {
836 836
 			// if no cached registrations, then check the db
837
-			$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, false );
837
+			$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
838 838
 			// still nothing ? well as long as this isn't a revisit
839
-			if ( empty( $registrations ) && ! $this->checkout->revisit ) {
839
+			if (empty($registrations) && ! $this->checkout->revisit) {
840 840
 				// generate new registrations from scratch
841
-				$registrations = $this->_initialize_registrations( $transaction );
841
+				$registrations = $this->_initialize_registrations($transaction);
842 842
 			}
843 843
 		}
844 844
 		// sort by their original registration order
845
-		usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' ));
845
+		usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
846 846
 		// then loop thru the array
847
-		foreach ( $registrations as $registration ) {
847
+		foreach ($registrations as $registration) {
848 848
 			// verify each registration
849
-			if ( $registration instanceof EE_Registration ) {
849
+			if ($registration instanceof EE_Registration) {
850 850
 				// we display all attendee info for the primary registrant
851
-				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
851
+				if ($this->checkout->reg_url_link === $registration->reg_url_link()
852 852
 				     && $registration->is_primary_registrant()
853 853
 				) {
854 854
 					$this->checkout->primary_revisit = true;
855 855
 					break;
856
-				} else if ( $this->checkout->revisit
856
+				} else if ($this->checkout->revisit
857 857
 				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
858 858
 				) {
859 859
 					// but hide info if it doesn't belong to you
860
-					$transaction->clear_cache( 'Registration', $registration->ID() );
860
+					$transaction->clear_cache('Registration', $registration->ID());
861 861
 				}
862
-				$this->checkout->set_reg_status_updated( $registration->ID(), false );
862
+				$this->checkout->set_reg_status_updated($registration->ID(), false);
863 863
 			}
864 864
 		}
865 865
 	}
@@ -875,17 +875,17 @@  discard block
 block discarded – undo
875 875
      * @throws \EventEspresso\core\exceptions\InvalidEntityException
876 876
      * @throws \EE_Error
877 877
      */
878
-	private function _initialize_registrations( EE_Transaction $transaction ) {
878
+	private function _initialize_registrations(EE_Transaction $transaction) {
879 879
 		$att_nmbr = 0;
880 880
 		$registrations = array();
881
-		if ( $transaction instanceof EE_Transaction ) {
881
+		if ($transaction instanceof EE_Transaction) {
882 882
 			/** @type EE_Registration_Processor $registration_processor */
883
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
883
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
884 884
 			$this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count();
885 885
 			// now let's add the cart items to the $transaction
886
-			foreach ( $this->checkout->cart->get_tickets() as $line_item ) {
886
+			foreach ($this->checkout->cart->get_tickets() as $line_item) {
887 887
 				//do the following for each ticket of this type they selected
888
-				for ( $x = 1; $x <= $line_item->quantity(); $x++ ) {
888
+				for ($x = 1; $x <= $line_item->quantity(); $x++) {
889 889
 					$att_nmbr++;
890 890
                     /** @var EventEspresso\core\services\commands\registration\CreateRegistrationCommand $CreateRegistrationCommand */
891 891
                     $CreateRegistrationCommand = EE_Registry::instance()
@@ -901,17 +901,17 @@  discard block
 block discarded – undo
901 901
                     // override capabilities for frontend registrations
902 902
                     if ( ! is_admin()) {
903 903
                         $CreateRegistrationCommand->setCapCheck(
904
-	                        new PublicCapabilities( '', 'create_new_registration' )
904
+	                        new PublicCapabilities('', 'create_new_registration')
905 905
                         );
906 906
                     }
907
-					$registration = EE_Registry::instance()->BUS->execute( $CreateRegistrationCommand );
908
-					if ( ! $registration instanceof EE_Registration ) {
909
-						throw new InvalidEntityException( $registration, 'EE_Registration' );
907
+					$registration = EE_Registry::instance()->BUS->execute($CreateRegistrationCommand);
908
+					if ( ! $registration instanceof EE_Registration) {
909
+						throw new InvalidEntityException($registration, 'EE_Registration');
910 910
 					}
911
-					$registrations[ $registration->ID() ] = $registration;
911
+					$registrations[$registration->ID()] = $registration;
912 912
 				}
913 913
 			}
914
-			$registration_processor->fix_reg_final_price_rounding_issue( $transaction );
914
+			$registration_processor->fix_reg_final_price_rounding_issue($transaction);
915 915
 		}
916 916
 		return $registrations;
917 917
 	}
@@ -926,12 +926,12 @@  discard block
 block discarded – undo
926 926
 	 * @param EE_Registration $reg_B
927 927
 	 * @return int
928 928
 	 */
929
-	public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) {
929
+	public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) {
930 930
 		// this shouldn't ever happen within the same TXN, but oh well
931
-		if ( $reg_A->count() === $reg_B->count() ) {
931
+		if ($reg_A->count() === $reg_B->count()) {
932 932
 			return 0;
933 933
 		}
934
-		return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1;
934
+		return ($reg_A->count() > $reg_B->count()) ? 1 : -1;
935 935
 	}
936 936
 
937 937
 
@@ -946,21 +946,21 @@  discard block
 block discarded – undo
946 946
 	 */
947 947
 	private function _final_verifications() {
948 948
 		// filter checkout
949
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout );
949
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
950 950
 		//verify that current step is still set correctly
951
-		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) {
952
-			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__ );
951
+		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
952
+			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__);
953 953
 			return false;
954 954
 		}
955 955
 		// if returning to SPCO, then verify that primary registrant is set
956
-		if ( ! empty( $this->checkout->reg_url_link )) {
956
+		if ( ! empty($this->checkout->reg_url_link)) {
957 957
 			$valid_registrant = $this->checkout->transaction->primary_registration();
958
-			if ( ! $valid_registrant instanceof EE_Registration ) {
959
-				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__ );
958
+			if ( ! $valid_registrant instanceof EE_Registration) {
959
+				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__);
960 960
 				return false;
961 961
 			}
962 962
 			$valid_registrant = null;
963
-			foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) {
963
+			foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
964 964
 				if (
965 965
 					$registration instanceof EE_Registration
966 966
 					&& $registration->reg_url_link() === $this->checkout->reg_url_link
@@ -968,9 +968,9 @@  discard block
 block discarded – undo
968 968
 					$valid_registrant = $registration;
969 969
 				}
970 970
 			}
971
-			if ( ! $valid_registrant instanceof EE_Registration ) {
971
+			if ( ! $valid_registrant instanceof EE_Registration) {
972 972
 				// hmmm... maybe we have the wrong session because the user is opening multiple tabs ?
973
-				if ( EED_Single_Page_Checkout::$_checkout_verified ) {
973
+				if (EED_Single_Page_Checkout::$_checkout_verified) {
974 974
 					// clear the session, mark the checkout as unverified, and try again
975 975
 					EE_Registry::instance()->SSN->clear_session();
976 976
 					EED_Single_Page_Checkout::$_initialized = false;
@@ -979,13 +979,13 @@  discard block
 block discarded – undo
979 979
 					EE_Error::reset_notices();
980 980
 					return false;
981 981
 				}
982
-				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__ );
982
+				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__);
983 983
 				return false;
984 984
 			}
985 985
 		}
986 986
 		// now that things have been kinda sufficiently verified,
987 987
 		// let's add the checkout to the session so that's available other systems
988
-		EE_Registry::instance()->SSN->set_checkout( $this->checkout );
988
+		EE_Registry::instance()->SSN->set_checkout($this->checkout);
989 989
 		return true;
990 990
 	}
991 991
 
@@ -1000,15 +1000,15 @@  discard block
 block discarded – undo
1000 1000
 	 * @param bool $reinitializing
1001 1001
 	 * @throws \EE_Error
1002 1002
 	 */
1003
-	private function _initialize_reg_steps( $reinitializing = false ) {
1004
-		$this->checkout->set_reg_step_initiated( $this->checkout->current_step );
1003
+	private function _initialize_reg_steps($reinitializing = false) {
1004
+		$this->checkout->set_reg_step_initiated($this->checkout->current_step);
1005 1005
 		// loop thru all steps to call their individual "initialize" methods and set i18n strings for JS
1006
-		foreach ( $this->checkout->reg_steps as $reg_step ) {
1007
-			if ( ! $reg_step->initialize_reg_step() ) {
1006
+		foreach ($this->checkout->reg_steps as $reg_step) {
1007
+			if ( ! $reg_step->initialize_reg_step()) {
1008 1008
 				// if not initialized then maybe this step is being removed...
1009
-				if ( ! $reinitializing && $reg_step->is_current_step() ) {
1009
+				if ( ! $reinitializing && $reg_step->is_current_step()) {
1010 1010
 					// if it was the current step, then we need to start over here
1011
-					$this->_initialize_reg_steps( true );
1011
+					$this->_initialize_reg_steps(true);
1012 1012
 					return;
1013 1013
 				}
1014 1014
 				continue;
@@ -1017,13 +1017,13 @@  discard block
 block discarded – undo
1017 1017
 			$reg_step->enqueue_styles_and_scripts();
1018 1018
 			// i18n
1019 1019
 			$reg_step->translate_js_strings();
1020
-			if ( $reg_step->is_current_step() ) {
1020
+			if ($reg_step->is_current_step()) {
1021 1021
 				// the text that appears on the reg step form submit button
1022 1022
 				$reg_step->set_submit_button_text();
1023 1023
 			}
1024 1024
 		}
1025 1025
 		// dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information
1026
-		do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step );
1026
+		do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step);
1027 1027
 	}
1028 1028
 
1029 1029
 
@@ -1036,43 +1036,43 @@  discard block
 block discarded – undo
1036 1036
 	 */
1037 1037
 	private function _check_form_submission() {
1038 1038
 		//does this request require the reg form to be generated ?
1039
-		if ( $this->checkout->generate_reg_form ) {
1039
+		if ($this->checkout->generate_reg_form) {
1040 1040
 			// ever heard that song by Blue Rodeo ?
1041 1041
 			try {
1042 1042
 				$this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form();
1043 1043
 				// if not displaying a form, then check for form submission
1044
-				if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) {
1044
+				if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) {
1045 1045
 					// clear out any old data in case this step is being run again
1046
-					$this->checkout->current_step->set_valid_data( array() );
1046
+					$this->checkout->current_step->set_valid_data(array());
1047 1047
 					// capture submitted form data
1048 1048
 					$this->checkout->current_step->reg_form->receive_form_submission(
1049
-						apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout )
1049
+						apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout)
1050 1050
 					);
1051 1051
 					// validate submitted form data
1052
-					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid() ) {
1052
+					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid()) {
1053 1053
 						// thou shall not pass !!!
1054 1054
 						$this->checkout->continue_reg = FALSE;
1055 1055
 						// any form validation errors?
1056
-						if ( $this->checkout->current_step->reg_form->submission_error_message() !== '' ) {
1056
+						if ($this->checkout->current_step->reg_form->submission_error_message() !== '') {
1057 1057
 							$submission_error_messages = array();
1058 1058
 							// bad, bad, bad registrant
1059
-							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
1060
-								if ( $validation_error instanceof EE_Validation_Error ) {
1059
+							foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) {
1060
+								if ($validation_error instanceof EE_Validation_Error) {
1061 1061
 									$submission_error_messages[] = sprintf(
1062
-										__( '%s : %s', 'event_espresso' ),
1062
+										__('%s : %s', 'event_espresso'),
1063 1063
 										$validation_error->get_form_section()->html_label_text(),
1064 1064
 										$validation_error->getMessage()
1065 1065
 									);
1066 1066
 								}
1067 1067
 							}
1068
-							EE_Error::add_error( implode( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1068
+							EE_Error::add_error(implode('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1069 1069
 						}
1070 1070
 						// well not really... what will happen is we'll just get redirected back to redo the current step
1071 1071
 						$this->go_to_next_step();
1072 1072
 						return;
1073 1073
 					}
1074 1074
 				}
1075
-			} catch( EE_Error $e ) {
1075
+			} catch (EE_Error $e) {
1076 1076
 				$e->get_error();
1077 1077
 			}
1078 1078
 		}
@@ -1089,22 +1089,22 @@  discard block
 block discarded – undo
1089 1089
 	 */
1090 1090
 	private function _process_form_action() {
1091 1091
 		// what cha wanna do?
1092
-		switch( $this->checkout->action ) {
1092
+		switch ($this->checkout->action) {
1093 1093
 			// AJAX next step reg form
1094 1094
 			case 'display_spco_reg_step' :
1095 1095
 				$this->checkout->redirect = FALSE;
1096
-				if ( EE_Registry::instance()->REQ->ajax ) {
1097
-					$this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() );
1096
+				if (EE_Registry::instance()->REQ->ajax) {
1097
+					$this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form());
1098 1098
 				}
1099 1099
 				break;
1100 1100
 
1101 1101
 			default :
1102 1102
 				// meh... do one of those other steps first
1103
-				if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) {
1103
+				if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) {
1104 1104
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step
1105
-					do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1105
+					do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1106 1106
 					// call action on current step
1107
-					if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) {
1107
+					if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) {
1108 1108
 						// good registrant, you get to proceed
1109 1109
 						if (
1110 1110
 							$this->checkout->current_step->success_message() !== ''
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 						) {
1116 1116
 								EE_Error::add_success(
1117 1117
 									$this->checkout->current_step->success_message()
1118
-									. '<br />' . $this->checkout->next_step->_instructions()
1118
+									. '<br />'.$this->checkout->next_step->_instructions()
1119 1119
 								);
1120 1120
 
1121 1121
 						}
@@ -1123,12 +1123,12 @@  discard block
 block discarded – undo
1123 1123
 						$this->_setup_redirect();
1124 1124
 					}
1125 1125
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step
1126
-					do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1126
+					do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1127 1127
 
1128 1128
 				} else {
1129 1129
 					EE_Error::add_error(
1130 1130
 						sprintf(
1131
-							__( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ),
1131
+							__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'),
1132 1132
 							$this->checkout->action,
1133 1133
 							$this->checkout->current_step->name()
1134 1134
 						),
@@ -1154,10 +1154,10 @@  discard block
 block discarded – undo
1154 1154
 	public function add_styles_and_scripts() {
1155 1155
 		// i18n
1156 1156
 		$this->translate_js_strings();
1157
-		if ( $this->checkout->admin_request ) {
1158
-			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 );
1157
+		if ($this->checkout->admin_request) {
1158
+			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1159 1159
 		} else {
1160
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 );
1160
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1161 1161
 		}
1162 1162
 	}
1163 1163
 
@@ -1173,42 +1173,42 @@  discard block
 block discarded – undo
1173 1173
 		EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit;
1174 1174
 		EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link;
1175 1175
 		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');
1176
-		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' );
1177
-		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' );
1178
-		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' );
1176
+		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');
1177
+		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');
1178
+		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');
1179 1179
 		EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso');
1180 1180
 		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');
1181
-		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/>' );
1182
-		EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' );
1181
+		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/>');
1182
+		EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language');
1183 1183
 		EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id();
1184 1184
 		EE_Registry::$i18n_js_strings['currency'] = EE_Registry::instance()->CFG->currency;
1185 1185
 		EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20';
1186
-		EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' );
1187
-		EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' );
1188
-		EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' );
1189
-		EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' );
1190
-		EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' );
1191
-		EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' );
1192
-		EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' );
1193
-		EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' );
1194
-		EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' );
1195
-		EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' );
1196
-		EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' );
1197
-		EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' );
1198
-		EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' );
1199
-		EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' );
1186
+		EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso');
1187
+		EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso');
1188
+		EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso');
1189
+		EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso');
1190
+		EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso');
1191
+		EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso');
1192
+		EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso');
1193
+		EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso');
1194
+		EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso');
1195
+		EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso');
1196
+		EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso');
1197
+		EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso');
1198
+		EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso');
1199
+		EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso');
1200 1200
 		EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf(
1201
-			__( '%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' ),
1201
+			__('%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'),
1202 1202
 			'<h4 class="important-notice">',
1203 1203
 			'</h4>',
1204 1204
 			'<br />',
1205 1205
 			'<p>',
1206
-			'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1206
+			'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1207 1207
 			'">',
1208 1208
 			'</a>',
1209 1209
 			'</p>'
1210 1210
 		);
1211
-		EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true );
1211
+		EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true);
1212 1212
 	}
1213 1213
 
1214 1214
 
@@ -1222,26 +1222,26 @@  discard block
 block discarded – undo
1222 1222
 	 */
1223 1223
 	public function enqueue_styles_and_scripts() {
1224 1224
 		// load css
1225
-		wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION );
1226
-		wp_enqueue_style( 'single_page_checkout' );
1225
+		wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION);
1226
+		wp_enqueue_style('single_page_checkout');
1227 1227
 		// load JS
1228
-		wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery	.plugin.min.js', array( 'jquery' ), '1.0.1', TRUE );
1229
-		wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery	.countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE );
1230
-		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 );
1228
+		wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery	.plugin.min.js', array('jquery'), '1.0.1', TRUE);
1229
+		wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery	.countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE);
1230
+		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);
1231 1231
 		$this->checkout->registration_form->enqueue_js();
1232
-		wp_enqueue_script( 'single_page_checkout' );
1232
+		wp_enqueue_script('single_page_checkout');
1233 1233
 
1234 1234
 		/**
1235 1235
 		 * global action hook for enqueueing styles and scripts with
1236 1236
 		 * spco calls.
1237 1237
 		 */
1238
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this );
1238
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this);
1239 1239
 
1240 1240
 		/**
1241 1241
 		 * dynamic action hook for enqueueing styles and scripts with spco calls.
1242 1242
 		 * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information
1243 1243
 		 */
1244
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this );
1244
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this);
1245 1245
 
1246 1246
 	}
1247 1247
 
@@ -1256,19 +1256,19 @@  discard block
 block discarded – undo
1256 1256
 	 */
1257 1257
 	private function _display_spco_reg_form() {
1258 1258
 		// if registering via the admin, just display the reg form for the current step
1259
-		if ( $this->checkout->admin_request ) {
1260
-			EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() );
1259
+		if ($this->checkout->admin_request) {
1260
+			EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form());
1261 1261
 		} else {
1262 1262
 			// add powered by EE msg
1263
-			add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' ));
1263
+			add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer'));
1264 1264
 
1265
-			$empty_cart = count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) ) < 1 ? true : false;
1265
+			$empty_cart = count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? true : false;
1266 1266
 			$cookies_not_set_msg = '';
1267
-			if ( $empty_cart && ! isset( $_COOKIE[ 'ee_cookie_test' ] ) ) {
1267
+			if ($empty_cart && ! isset($_COOKIE['ee_cookie_test'])) {
1268 1268
 				$cookies_not_set_msg = apply_filters(
1269 1269
 					'FHEE__Single_Page_Checkout__display_spco_reg_form__cookies_not_set_msg',
1270 1270
 					sprintf(
1271
-						__( '%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' ),
1271
+						__('%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'),
1272 1272
 						'<div class="ee-attention">',
1273 1273
 						'</div>',
1274 1274
 						'<h6 class="important-notice">',
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 					'layout_strategy' =>
1289 1289
 						new EE_Template_Layout(
1290 1290
 							array(
1291
-								'layout_template_file' 			=> SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php',
1291
+								'layout_template_file' 			=> SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php',
1292 1292
 								'template_args' => array(
1293 1293
 									'empty_cart' 		=> $empty_cart,
1294 1294
 									'revisit' 				=> $this->checkout->revisit,
@@ -1297,8 +1297,8 @@  discard block
 block discarded – undo
1297 1297
 									'empty_msg' 		=> apply_filters(
1298 1298
 										'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
1299 1299
 										sprintf(
1300
-											__( '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' ),
1301
-											'<a href="' . get_post_type_archive_link( 'espresso_events' ) . '" title="',
1300
+											__('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'),
1301
+											'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1302 1302
 											'">',
1303 1303
 											'</a>'
1304 1304
 										)
@@ -1306,14 +1306,14 @@  discard block
 block discarded – undo
1306 1306
 									'cookies_not_set_msg' 		=> $cookies_not_set_msg,
1307 1307
 									'registration_time_limit' 	=> $this->checkout->get_registration_time_limit(),
1308 1308
 									'session_expiration' 			=>
1309
-										date( 'M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) )
1309
+										date('M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS))
1310 1310
 							)
1311 1311
 						)
1312 1312
 					)
1313 1313
 				)
1314 1314
 			);
1315 1315
 			// load template and add to output sent that gets filtered into the_content()
1316
-			EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html() );
1316
+			EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html());
1317 1317
 		}
1318 1318
 	}
1319 1319
 
@@ -1327,8 +1327,8 @@  discard block
 block discarded – undo
1327 1327
 	 * @internal  param string $label
1328 1328
 	 * @return void
1329 1329
 	 */
1330
-	public function add_extra_finalize_registration_inputs( $next_step ) {
1331
-		if ( $next_step === 'finalize_registration' ) {
1330
+	public function add_extra_finalize_registration_inputs($next_step) {
1331
+		if ($next_step === 'finalize_registration') {
1332 1332
 			echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>';
1333 1333
 		}
1334 1334
 	}
@@ -1350,8 +1350,8 @@  discard block
 block discarded – undo
1350 1350
 		) {
1351 1351
 			add_filter(
1352 1352
 				'FHEE__EEH_Template__powered_by_event_espresso__url',
1353
-				function( $url) {
1354
-					return apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url );
1353
+				function($url) {
1354
+					return apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url);
1355 1355
 				}
1356 1356
 			);
1357 1357
 			echo apply_filters(
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
 				\EEH_Template::powered_by_event_espresso(
1360 1360
 					'',
1361 1361
 					'espresso-registration-footer-dv',
1362
-					array( 'utm_content' => 'registration_checkout' )
1362
+					array('utm_content' => 'registration_checkout')
1363 1363
 				)
1364 1364
 			);
1365 1365
 		}
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 	 * @throws \EE_Error
1377 1377
 	 */
1378 1378
 	public function unlock_transaction() {
1379
-		if ( $this->checkout->transaction instanceof EE_Transaction ) {
1379
+		if ($this->checkout->transaction instanceof EE_Transaction) {
1380 1380
 			$this->checkout->transaction->unlock();
1381 1381
 		}
1382 1382
 	}
@@ -1391,9 +1391,9 @@  discard block
 block discarded – undo
1391 1391
 	 * @return void
1392 1392
 	 */
1393 1393
 	private function _setup_redirect() {
1394
-		if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
1394
+		if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
1395 1395
 			$this->checkout->redirect = TRUE;
1396
-			if ( empty( $this->checkout->redirect_url )) {
1396
+			if (empty($this->checkout->redirect_url)) {
1397 1397
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1398 1398
 			}
1399 1399
 			$this->checkout->redirect_url = apply_filters(
@@ -1414,9 +1414,9 @@  discard block
 block discarded – undo
1414 1414
 	 * @throws \EE_Error
1415 1415
 	 */
1416 1416
 	public function go_to_next_step() {
1417
-		if ( EE_Registry::instance()->REQ->ajax ) {
1417
+		if (EE_Registry::instance()->REQ->ajax) {
1418 1418
 			// capture contents of output buffer we started earlier in the request, and insert into JSON response
1419
-			$this->checkout->json_response->set_unexpected_errors( ob_get_clean() );
1419
+			$this->checkout->json_response->set_unexpected_errors(ob_get_clean());
1420 1420
 		}
1421 1421
 		$this->unlock_transaction();
1422 1422
 		// just return for these conditions
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
 	 */
1446 1446
 	protected function _handle_json_response() {
1447 1447
 		// if this is an ajax request
1448
-		if ( EE_Registry::instance()->REQ->ajax ) {
1448
+		if (EE_Registry::instance()->REQ->ajax) {
1449 1449
 			// DEBUG LOG
1450 1450
 			//$this->checkout->log(
1451 1451
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 			$this->checkout->json_response->set_registration_time_limit(
1459 1459
 				$this->checkout->get_registration_time_limit()
1460 1460
 			);
1461
-			$this->checkout->json_response->set_payment_amount( $this->checkout->amount_owing );
1461
+			$this->checkout->json_response->set_payment_amount($this->checkout->amount_owing);
1462 1462
 			// just send the ajax (
1463 1463
 			$json_response = apply_filters(
1464 1464
 				'FHEE__EE_Single_Page_Checkout__JSON_response',
@@ -1479,9 +1479,9 @@  discard block
 block discarded – undo
1479 1479
 	 */
1480 1480
 	protected function _handle_html_redirects() {
1481 1481
 		// going somewhere ?
1482
-		if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) {
1482
+		if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) {
1483 1483
 			// store notices in a transient
1484
-			EE_Error::get_notices( false, true, true );
1484
+			EE_Error::get_notices(false, true, true);
1485 1485
 			// DEBUG LOG
1486 1486
 			//$this->checkout->log(
1487 1487
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 			//		'headers_list'    => headers_list(),
1492 1492
 			//	)
1493 1493
 			//);
1494
-			wp_safe_redirect( $this->checkout->redirect_url );
1494
+			wp_safe_redirect($this->checkout->redirect_url);
1495 1495
 			exit();
1496 1496
 		}
1497 1497
 	}
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php 2 patches
Indentation   +35 added lines, -35 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_SPCO_Reg_Step
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_SPCO_Reg_Step
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 abstract class EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
@@ -385,12 +385,12 @@  discard block
 block discarded – undo
385 385
 
386 386
 
387 387
 
388
-    /**
389
-     * creates the default hidden inputs section
390
-     *
391
-     * @return EE_Form_Section_Proper
392
-     * @throws \EE_Error
393
-     */
388
+	/**
389
+	 * creates the default hidden inputs section
390
+	 *
391
+	 * @return EE_Form_Section_Proper
392
+	 * @throws \EE_Error
393
+	 */
394 394
 	public function reg_step_hidden_inputs() {
395 395
 		// hidden inputs for admin registrations
396 396
 		if ( $this->checkout->admin_request ) {
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
 
466 466
 
467 467
 
468
-    /**
469
-     * @return string
470
-     * @throws \EE_Error
471
-     */
468
+	/**
469
+	 * @return string
470
+	 * @throws \EE_Error
471
+	 */
472 472
 	public function display_reg_form() {
473 473
 		$html = '';
474 474
 		if ( $this->reg_form instanceof EE_Form_Section_Proper ) {
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 				$this->reg_form->localize_validation_rules();
478 478
 				$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
479 479
 			}
480
-            $html .= $this->reg_form->get_html();
481
-            $html .= ! $this->checkout->admin_request ? $this->reg_step_submit_button() : '';
480
+			$html .= $this->reg_form->get_html();
481
+			$html .= ! $this->checkout->admin_request ? $this->reg_step_submit_button() : '';
482 482
 			$html .= ! $this->checkout->admin_request ? $this->reg_form->form_close() : '';
483 483
 		}
484 484
 		return $html;
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
 
487 487
 
488 488
 
489
-    /**
490
-     * div_class - returns nothing for current step, but a css class of "hidden" for others
491
-     *
492
-     * @return string
493
-     * @throws \EE_Error
494
-     */
489
+	/**
490
+	 * div_class - returns nothing for current step, but a css class of "hidden" for others
491
+	 *
492
+	 * @return string
493
+	 * @throws \EE_Error
494
+	 */
495 495
 	public function reg_step_submit_button() {
496 496
 		if ( ! $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
497 497
 			return '';
@@ -550,12 +550,12 @@  discard block
 block discarded – undo
550 550
 
551 551
 
552 552
 
553
-    /**
554
-     * update_checkout with changes that have been made to the cart
555
-     *
556
-     * @return void
557
-     * @throws \EE_Error
558
-     */
553
+	/**
554
+	 * update_checkout with changes that have been made to the cart
555
+	 *
556
+	 * @return void
557
+	 * @throws \EE_Error
558
+	 */
559 559
 	public function update_checkout() {
560 560
 		// grab the cart grand total and reset TXN total
561 561
 		$this->checkout->transaction->set_total( $this->checkout->cart->get_cart_grand_total() );
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	public function set_completed() {
154 154
 		// DEBUG LOG
155 155
 		//$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ );
156
-		$this->_completed = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', true, $this );
156
+		$this->_completed = apply_filters('FHEE__EE_SPCO_Reg_Step__set_completed___completed', true, $this);
157 157
 	}
158 158
 
159 159
 
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 	 * sets the text that appears on the reg step form submit button
202 202
 	 * @param string $submit_button_text
203 203
 	 */
204
-	public function set_submit_button_text( $submit_button_text = '' ) {
205
-		if ( ! empty( $submit_button_text )) {
204
+	public function set_submit_button_text($submit_button_text = '') {
205
+		if ( ! empty($submit_button_text)) {
206 206
 			$this->_submit_button_text = $submit_button_text;
207
-		} else if ( $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
208
-			if ( $this->checkout->revisit ) {
209
-				$this->_submit_button_text = sprintf( __( 'Update %s', 'event_espresso' ), $this->checkout->current_step->name() );
207
+		} else if ($this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
208
+			if ($this->checkout->revisit) {
209
+				$this->_submit_button_text = sprintf(__('Update %s', 'event_espresso'), $this->checkout->current_step->name());
210 210
 			} else {
211
-				$this->_submit_button_text = sprintf( __( 'Proceed to %s', 'event_espresso' ), $this->checkout->next_step->name() );
211
+				$this->_submit_button_text = sprintf(__('Proceed to %s', 'event_espresso'), $this->checkout->next_step->name());
212 212
 			}
213 213
 		}
214 214
 		// filters the submit button text
215
-		$this->_submit_button_text = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', $this->_submit_button_text, $this->checkout );
215
+		$this->_submit_button_text = apply_filters('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', $this->_submit_button_text, $this->checkout);
216 216
 	}
217 217
 
218 218
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	/**
221 221
 	 * @param boolean $is_current_step
222 222
 	 */
223
-	public function set_is_current_step( $is_current_step ) {
223
+	public function set_is_current_step($is_current_step) {
224 224
 		$this->_is_current_step = $is_current_step;
225 225
 	}
226 226
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	/**
248 248
 	 * @param int $order
249 249
 	 */
250
-	public function set_order( $order ) {
250
+	public function set_order($order) {
251 251
 		$this->_order = $order;
252 252
 	}
253 253
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * _set_success_message
286 286
 	 * @param string $success_message
287 287
 	 */
288
-	protected function _set_success_message( $success_message ) {
288
+	protected function _set_success_message($success_message) {
289 289
 		$this->_success_message = $success_message;
290 290
 	}
291 291
 
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 	/**
314 314
 	 * @param string $instructions
315 315
 	 */
316
-	public function set_instructions( $instructions ) {
317
-		$this->_instructions = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_instructions__instructions', $instructions, $this );
316
+	public function set_instructions($instructions) {
317
+		$this->_instructions = apply_filters('FHEE__EE_SPCO_Reg_Step__set_instructions__instructions', $instructions, $this);
318 318
 	}
319 319
 
320 320
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	/**
323 323
 	 * @param array $valid_data
324 324
 	 */
325
-	public function set_valid_data( $valid_data ) {
325
+	public function set_valid_data($valid_data) {
326 326
 		$this->_valid_data = $valid_data;
327 327
 	}
328 328
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 * @return array
333 333
 	 */
334 334
 	public function valid_data() {
335
-		if ( empty( $this->_valid_data )) {
335
+		if (empty($this->_valid_data)) {
336 336
 			$this->_valid_data = $this->reg_form->valid_data();
337 337
 		}
338 338
 		return $this->_valid_data;
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
 	 * @return string
344 344
 	 */
345 345
 	public function reg_form_name() {
346
-		if ( empty( $this->_reg_form_name )) {
347
-			$this->set_reg_form_name( 'ee-spco-' . $this->slug() . '-reg-step-form' );
346
+		if (empty($this->_reg_form_name)) {
347
+			$this->set_reg_form_name('ee-spco-'.$this->slug().'-reg-step-form');
348 348
 		}
349 349
 		return $this->_reg_form_name;
350 350
 	}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	/**
355 355
 	 * @param string $reg_form_name
356 356
 	 */
357
-	protected function set_reg_form_name( $reg_form_name ) {
357
+	protected function set_reg_form_name($reg_form_name) {
358 358
 		$this->_reg_form_name = $reg_form_name;
359 359
 	}
360 360
 
@@ -365,22 +365,22 @@  discard block
 block discarded – undo
365 365
 	 * @param string $action
366 366
 	 * @return string
367 367
 	 */
368
-	public function reg_step_url( $action = '' ) {
369
-		$query_args = array( 'step' => $this->slug() );
370
-		if( ! empty( $action )) {
368
+	public function reg_step_url($action = '') {
369
+		$query_args = array('step' => $this->slug());
370
+		if ( ! empty($action)) {
371 371
 			$query_args['action'] = $action;
372 372
 		}
373 373
 		// final step has no display
374
-		if ( $this instanceof EE_SPCO_Reg_Step_Finalize_Registration && $action === 'display_spco_reg_step' ) {
375
-			$query_args[ 'action' ] = 'process_reg_step';
374
+		if ($this instanceof EE_SPCO_Reg_Step_Finalize_Registration && $action === 'display_spco_reg_step') {
375
+			$query_args['action'] = 'process_reg_step';
376 376
 		}
377
-		if( $this->checkout->revisit ) {
377
+		if ($this->checkout->revisit) {
378 378
 			$query_args['revisit'] = TRUE;
379 379
 		}
380
-		if( $this->checkout->reg_url_link ) {
380
+		if ($this->checkout->reg_url_link) {
381 381
 			$query_args['e_reg_url_link'] = $this->checkout->reg_url_link;
382 382
 		}
383
-		return add_query_arg( $query_args, $this->checkout->reg_page_base_url );
383
+		return add_query_arg($query_args, $this->checkout->reg_page_base_url);
384 384
 	}
385 385
 
386 386
 
@@ -393,16 +393,16 @@  discard block
 block discarded – undo
393 393
      */
394 394
 	public function reg_step_hidden_inputs() {
395 395
 		// hidden inputs for admin registrations
396
-		if ( $this->checkout->admin_request ) {
396
+		if ($this->checkout->admin_request) {
397 397
 			return new EE_Form_Section_Proper(
398 398
 				array(
399 399
 					'layout_strategy' 	=> new EE_Div_Per_Section_Layout(),
400
-					'html_id' 					=> 'ee-' . $this->slug() . '-hidden-inputs',
400
+					'html_id' 					=> 'ee-'.$this->slug().'-hidden-inputs',
401 401
 					'subsections' 			=> array(
402 402
 						'next_step' 			=> new EE_Fixed_Hidden_Input(
403 403
 							array(
404 404
 								'html_name' 	=> 'next_step',
405
-								'html_id' 			=> 'spco-' . $this->slug() . '-next-step',
405
+								'html_id' 			=> 'spco-'.$this->slug().'-next-step',
406 406
 								'default' 			=> $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : ''
407 407
 							)
408 408
 						)
@@ -414,19 +414,19 @@  discard block
 block discarded – undo
414 414
 			return new EE_Form_Section_Proper(
415 415
 				array(
416 416
 					'layout_strategy' 	=> new EE_Div_Per_Section_Layout(),
417
-					'html_id' 					=> 'ee-' . $this->slug() . '-hidden-inputs',
417
+					'html_id' 					=> 'ee-'.$this->slug().'-hidden-inputs',
418 418
 					'subsections' 			=> array(
419 419
 						'action' 				=> new EE_Fixed_Hidden_Input(
420 420
 								array(
421 421
 									'html_name' 	=> 'action',
422
-									'html_id' 			=> 'spco-' . $this->slug() . '-action',
423
-									'default' 			=> empty( $this->checkout->reg_url_link ) ? 'process_reg_step' : 'update_reg_step'
422
+									'html_id' 			=> 'spco-'.$this->slug().'-action',
423
+									'default' 			=> empty($this->checkout->reg_url_link) ? 'process_reg_step' : 'update_reg_step'
424 424
 								)
425 425
 							),
426 426
 						'next_step' 			=> new EE_Fixed_Hidden_Input(
427 427
 								array(
428 428
 									'html_name' 	=> 'next_step',
429
-									'html_id' 			=> 'spco-' . $this->slug() . '-next-step',
429
+									'html_id' 			=> 'spco-'.$this->slug().'-next-step',
430 430
 									'default' 			=> $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : ''
431 431
 								)
432 432
 							),
@@ -458,9 +458,9 @@  discard block
 block discarded – undo
458 458
 	 * @param array $actions
459 459
 	 * @return void
460 460
 	 */
461
-	public function generate_reg_form_for_actions( $actions = array() ) {
462
-		$actions = array_merge( array( 'generate_reg_form', 'display_spco_reg_step', 'process_reg_step', 'update_reg_step' ), $actions );
463
-		$this->checkout->generate_reg_form = in_array( $this->checkout->action, $actions ) ? TRUE : FALSE;
461
+	public function generate_reg_form_for_actions($actions = array()) {
462
+		$actions = array_merge(array('generate_reg_form', 'display_spco_reg_step', 'process_reg_step', 'update_reg_step'), $actions);
463
+		$this->checkout->generate_reg_form = in_array($this->checkout->action, $actions) ? TRUE : FALSE;
464 464
 	}
465 465
 
466 466
 
@@ -471,11 +471,11 @@  discard block
 block discarded – undo
471 471
      */
472 472
 	public function display_reg_form() {
473 473
 		$html = '';
474
-		if ( $this->reg_form instanceof EE_Form_Section_Proper ) {
475
-			$html .= ! $this->checkout->admin_request ? $this->reg_form->form_open( $this->reg_step_url() ) : '';
476
-			if ( EE_Registry::instance()->REQ->ajax ) {
474
+		if ($this->reg_form instanceof EE_Form_Section_Proper) {
475
+			$html .= ! $this->checkout->admin_request ? $this->reg_form->form_open($this->reg_step_url()) : '';
476
+			if (EE_Registry::instance()->REQ->ajax) {
477 477
 				$this->reg_form->localize_validation_rules();
478
-				$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
478
+				$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
479 479
 			}
480 480
             $html .= $this->reg_form->get_html();
481 481
             $html .= ! $this->checkout->admin_request ? $this->reg_step_submit_button() : '';
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
      * @throws \EE_Error
494 494
      */
495 495
 	public function reg_step_submit_button() {
496
-		if ( ! $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
496
+		if ( ! $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
497 497
 			return '';
498 498
 		}
499 499
 		ob_start();
500
-		do_action( 'AHEE__before_spco_whats_next_buttons', $this->slug(), $this->checkout->next_step->slug(), $this->checkout );
500
+		do_action('AHEE__before_spco_whats_next_buttons', $this->slug(), $this->checkout->next_step->slug(), $this->checkout);
501 501
 		$html = ob_get_clean();
502 502
 		// generate submit button
503
-		$sbmt_btn = new EE_Submit_Input( array(
504
-			'html_name' 					=> 'spco-go-to-step-' . $this->checkout->next_step->slug(),
505
-			'html_id' 							=> 'spco-go-to-step-' . $this->checkout->next_step->slug(),
503
+		$sbmt_btn = new EE_Submit_Input(array(
504
+			'html_name' 					=> 'spco-go-to-step-'.$this->checkout->next_step->slug(),
505
+			'html_id' 							=> 'spco-go-to-step-'.$this->checkout->next_step->slug(),
506 506
 			'html_class' 					=> 'spco-next-step-btn',
507
-			'other_html_attributes' 	=> ' rel="' . $this->slug() . '"',
507
+			'other_html_attributes' 	=> ' rel="'.$this->slug().'"',
508 508
 			'default'							=> $this->submit_button_text()
509 509
 		));
510
-		$sbmt_btn->set_button_css_attributes( TRUE, 'large' );
510
+		$sbmt_btn->set_button_css_attributes(TRUE, 'large');
511 511
 		$sbmt_btn_html = $sbmt_btn->get_html_for_input();
512 512
 		$html .= EEH_HTML::div(
513
-			apply_filters( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', $sbmt_btn_html, $this ),
514
-			'spco-' . $this->slug() . '-whats-next-buttons-dv',
513
+			apply_filters('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', $sbmt_btn_html, $this),
514
+			'spco-'.$this->slug().'-whats-next-buttons-dv',
515 515
 			'spco-whats-next-buttons'
516 516
 		);
517 517
 		return $html;
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 * @return string
535 535
 	 */
536 536
 	public function edit_lnk_url() {
537
-		return 	add_query_arg( array( 'step' => $this->slug() ), $this->checkout->reg_page_base_url );
537
+		return 	add_query_arg(array('step' => $this->slug()), $this->checkout->reg_page_base_url);
538 538
 
539 539
 	}
540 540
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
      */
559 559
 	public function update_checkout() {
560 560
 		// grab the cart grand total and reset TXN total
561
-		$this->checkout->transaction->set_total( $this->checkout->cart->get_cart_grand_total() );
561
+		$this->checkout->transaction->set_total($this->checkout->cart->get_cart_grand_total());
562 562
 		$this->checkout->stash_transaction_and_checkout();
563 563
 	}
564 564
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 	 */
574 574
 	public function __sleep() {
575 575
 		// remove the reg form and the checkout
576
-		return array_diff( array_keys( get_object_vars( $this )), array( 'reg_form', 'checkout' ));
576
+		return array_diff(array_keys(get_object_vars($this)), array('reg_form', 'checkout'));
577 577
 	}
578 578
 }
579 579
 
Please login to merge, or discard this patch.
support/templates/support_admin_details_contact_support.template.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@
 block discarded – undo
1 1
 <div class="padding">
2 2
 	<h3><?php esc_html_e('Need help with Event Espresso?', 'event_espresso'); ?></h3>
3 3
 	
4
-	<h4><?php esc_html_e( 'You may be able to find an answer for your question or concern here:', 'event_espresso' ); ?></h4>
4
+	<h4><?php esc_html_e('You may be able to find an answer for your question or concern here:', 'event_espresso'); ?></h4>
5 5
 				<ol>
6
-					<li><strong><em><?php esc_html_e( 'A known issue.', 'event_espresso' ); ?></em></strong>  <?php printf( esc_html__( 'Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', 'event_espresso' ), '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">','</a>', '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', '<a href="https://eventespresso.com/support/forums/" target="_blank">' ); ?></li>
7
-					<li><strong><em><?php esc_html_e( 'A plugin conflict.', 'event_espresso' ); ?></em></strong>  <?php esc_html_e( 'You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', 'event_espresso' ); ?></li>
6
+					<li><strong><em><?php esc_html_e('A known issue.', 'event_espresso'); ?></em></strong>  <?php printf(esc_html__('Some themes and plugins have %1$sknown conflicts%2$s with Event Espresso. (You can also browse the %3$sEvent Espresso support pages%2$s or %4$sEvent Espresso support forums%2$s to see if other members have experienced and solved the problem.)', 'event_espresso'), '<a href="https://eventespresso.com/wiki/known-third-party-plugin-theme-conflicts/" target="_blank">', '</a>', '<a href="https://eventespresso.com/support/documentation/versioned-docs/?doc_ver=ee4" target="_blank">', '<a href="https://eventespresso.com/support/forums/" target="_blank">'); ?></li>
7
+					<li><strong><em><?php esc_html_e('A plugin conflict.', 'event_espresso'); ?></em></strong>  <?php esc_html_e('You can check to see if there is a plugin conflict by temporarily deactivating all plugins except for Event Espresso. If the problem goes away, then reactivate your plugins one by one until the issue returns. This will help you pinpoint the source of the conflict.', 'event_espresso'); ?></li>
8 8
 					<li>
9
-						<strong><em><?php esc_html_e( 'A theme conflict.', 'event_espresso' ); ?></em></strong>
9
+						<strong><em><?php esc_html_e('A theme conflict.', 'event_espresso'); ?></em></strong>
10 10
 						<?php
11
-							$default_theme = wp_get_theme( WP_DEFAULT_THEME );
11
+							$default_theme = wp_get_theme(WP_DEFAULT_THEME);
12 12
 
13
-							if ( $default_theme->exists() ) {
14
-								 printf( esc_html__( 'If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', 'event_espresso' ), $default_theme->get( 'Name' ) );
13
+							if ($default_theme->exists()) {
14
+								 printf(esc_html__('If your problem is not a known issue or caused by a plugin, then try activating %s (the default WordPress theme).', 'event_espresso'), $default_theme->get('Name'));
15 15
 							} else {
16
-								esc_html_e( 'If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', 'event_espresso' );
16
+								esc_html_e('If your problem is not a known issue or caused by a plugin, then try activating the default WordPress theme.', 'event_espresso');
17 17
 							}
18 18
 						?>
19
-						<?php esc_html_e( 'If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', 'event_espresso' ); ?>
19
+						<?php esc_html_e('If this solves the problem for you, then something in your theme is causing this issue. Check to see if an update is available for your WordPress theme or reach out to the theme author.', 'event_espresso'); ?>
20 20
 					</li>
21 21
 				</ol>
22 22
 				
23
-	<p><?php esc_html_e( 'If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', 'event_espresso' ); ?></p>
24
-	<p><?php printf( esc_html__( 'Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', 'event_espresso' ), '<a href="https://eventespresso.com/support/forums/" target="_blank">','</a>','<strong>','</strong>','<a href="#espresso_important_information_settings">' ); ?></p>
23
+	<p><?php esc_html_e('If none of the suggestions above help you find a solution, then feel free to reach out to the support team at Event Espresso.', 'event_espresso'); ?></p>
24
+	<p><?php printf(esc_html__('Login to your account on EventEspresso.com and %1$screate a support post in our member support forums%2$s. Use a %3$sclear and descriptive title%4$s in your support post, %3$sdescribe the issue to the best of your knowledge%4$s, and %3$snever post any sensitive information such as login details%4$s. Be sure to also include %5$simportant information in the section below%2$s about your WordPress site.', 'event_espresso'), '<a href="https://eventespresso.com/support/forums/" target="_blank">', '</a>', '<strong>', '</strong>', '<a href="#espresso_important_information_settings">'); ?></p>
25 25
 
26
-	<h4><?php esc_html_e( 'Have an emergency?', 'event_espresso' ); ?></h4>
26
+	<h4><?php esc_html_e('Have an emergency?', 'event_espresso'); ?></h4>
27 27
 
28
-	<p><?php printf( esc_html__( 'We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', 'event_espresso' ), '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">','</a>' ); ?></p>
28
+	<p><?php printf(esc_html__('We offer support tokens to members that need help with a time-sensitive issue. A support token will provide you with up to 30 minutes of one-on-one time with a team member at Event Espresso. If you have an emergency and need help quickly, then please %1$spurchase a support token%2$s.', 'event_espresso'), '<a href="https://eventespresso.com/product/premium-support-token/?utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=help_support_tab&utm_content=support_token" target="_blank">', '</a>'); ?></p>
29 29
 </div>
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
admin_pages/support/templates/developers_admin_details.template.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <div class="padding">
2
-	<?php esc_html_e( 'If you want to integrate with Event Espresso or participate in building code, then you are in the right place. The following resources can help you get started.', 'event_espresso' ); ?>
3
-	<h2><?php esc_html_e( 'Developer Resources', 'event_espresso' ); ?></h2>
2
+	<?php esc_html_e('If you want to integrate with Event Espresso or participate in building code, then you are in the right place. The following resources can help you get started.', 'event_espresso'); ?>
3
+	<h2><?php esc_html_e('Developer Resources', 'event_espresso'); ?></h2>
4 4
 	<ul>
5
-		<li><?php printf( esc_html__( '%1$sEvent Espresso 4 Developer Documentation%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/tree/master/docs#getting-started-with-the-ee-developer-docs" target="_blank">','</a>' ); ?></li>
6
-		<li><?php printf( esc_html__( '%1$sEvent Espresso 4 Developer News%2$s', 'event_espresso' ), '<a href="http://developer.eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
7
-		<li><?php printf( esc_html__( '%1$sApply%2$s to be listed as an %3$sEvent Espresso Professional%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/developers/event-espresso-pros-application/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>','<a href="https://eventespresso.com/developers/event-espresso-pros/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">' ); ?></li>
5
+		<li><?php printf(esc_html__('%1$sEvent Espresso 4 Developer Documentation%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/tree/master/docs#getting-started-with-the-ee-developer-docs" target="_blank">', '</a>'); ?></li>
6
+		<li><?php printf(esc_html__('%1$sEvent Espresso 4 Developer News%2$s', 'event_espresso'), '<a href="http://developer.eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
7
+		<li><?php printf(esc_html__('%1$sApply%2$s to be listed as an %3$sEvent Espresso Professional%2$s', 'event_espresso'), '<a href="https://eventespresso.com/developers/event-espresso-pros-application/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>', '<a href="https://eventespresso.com/developers/event-espresso-pros/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">'); ?></li>
8 8
 	</ul>
9 9
 
10
-	<h2><?php esc_html_e( 'Event Espresso 4 Articles for Developers', 'event_espresso' ); ?></h2>
10
+	<h2><?php esc_html_e('Event Espresso 4 Articles for Developers', 'event_espresso'); ?></h2>
11 11
 	<ul>
12
-		<li><?php printf( esc_html__( '%1$sCustom Post Types Usage%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/02/epsresso-brewery-custom-post-types-event-espresso/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
13
-		<li><?php printf( esc_html__( '%1$sTheme Development%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/02/developers-corner-theming-event-espresso-4/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
14
-		<li><?php printf( esc_html__( '%1$sCapability System%2$s', 'event_espresso' ), '<a href="http://developer.eventespresso.com/docs/ee-capability-system-overview/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
15
-		<li><?php printf( esc_html__( '%1$sPayment Method Development%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/L--Payment-Methods-and-Gateways/creating-a-payment-method.md" target="_blank">','</a>' ); ?></li>
16
-		<li><?php printf( esc_html__( '%1$sMessages System in Event Espresso 4%2$s', 'event_espresso' ), '<a href="https://eventespresso.com/2014/03/messages-systemyour-tool-getting-word/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
17
-		<li><?php printf( esc_html__( '%1$sDatabase Model System%2$s (used for interfacing with EE4 data via WordPress plugins and server side querying)', 'event_espresso' ), '<a href="http://developer.eventespresso.com/docs/using-ee4-model-objects/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">','</a>' ); ?></li>
12
+		<li><?php printf(esc_html__('%1$sCustom Post Types Usage%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/02/epsresso-brewery-custom-post-types-event-espresso/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
13
+		<li><?php printf(esc_html__('%1$sTheme Development%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/02/developers-corner-theming-event-espresso-4/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
14
+		<li><?php printf(esc_html__('%1$sCapability System%2$s', 'event_espresso'), '<a href="http://developer.eventespresso.com/docs/ee-capability-system-overview/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
15
+		<li><?php printf(esc_html__('%1$sPayment Method Development%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/L--Payment-Methods-and-Gateways/creating-a-payment-method.md" target="_blank">', '</a>'); ?></li>
16
+		<li><?php printf(esc_html__('%1$sMessages System in Event Espresso 4%2$s', 'event_espresso'), '<a href="https://eventespresso.com/2014/03/messages-systemyour-tool-getting-word/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
17
+		<li><?php printf(esc_html__('%1$sDatabase Model System%2$s (used for interfacing with EE4 data via WordPress plugins and server side querying)', 'event_espresso'), '<a href="http://developer.eventespresso.com/docs/using-ee4-model-objects/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=ee_support_page&utm_content=developers_tab" target="_blank">', '</a>'); ?></li>
18 18
 	</ul>
19 19
 	
20
-	<h2><?php esc_html_e( 'REST API Resources', 'event_espresso' ); ?></h2>
20
+	<h2><?php esc_html_e('REST API Resources', 'event_espresso'); ?></h2>
21 21
 	<ul>
22
-		<li><?php printf( esc_html__( '%1$sREST API: Introduction%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-introduction.md" target="_blank">','</a>' ); ?></li>
23
-		<li><?php printf( esc_html__( '%1$sREST API: Reading Data%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-reading-data.md" target="_blank">','</a>' ); ?></li>
24
-		<li><?php printf( esc_html__( '%1$sBuilding an EE4 Add-on Using the REST API%2$s', 'event_espresso' ), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/T--Tutorials/building-an-ee4-addon-that-uses-angular-js-and-the-ee4-json-rest-api.md" target="_blank">','</a>' ); ?></li>
22
+		<li><?php printf(esc_html__('%1$sREST API: Introduction%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-introduction.md" target="_blank">', '</a>'); ?></li>
23
+		<li><?php printf(esc_html__('%1$sREST API: Reading Data%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/C--REST-API/ee4-rest-api-reading-data.md" target="_blank">', '</a>'); ?></li>
24
+		<li><?php printf(esc_html__('%1$sBuilding an EE4 Add-on Using the REST API%2$s', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core/blob/master/docs/T--Tutorials/building-an-ee4-addon-that-uses-angular-js-and-the-ee4-json-rest-api.md" target="_blank">', '</a>'); ?></li>
25 25
 	</ul>
26 26
 </div>
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
core/middleware/EE_Recommended_Versions.core.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -22,32 +22,32 @@  discard block
 block discarded – undo
22 22
 	 * @param 	EE_Response $response
23 23
 	 * @return 	EE_Response
24 24
 	 */
25
-	public function handle_request( EE_Request $request, EE_Response $response ) {
25
+	public function handle_request(EE_Request $request, EE_Response $response) {
26 26
 		$this->_request = $request;
27 27
 		$this->_response = $response;
28 28
 		//$this->_response->add_output( "\n\t IN >>  " . __CLASS__ );
29 29
 		//$this->_response->set_notice( 1, 'hey look at this' );
30 30
 		// check required WP version
31
-		if ( ! $this->_minimum_wp_version_required() ) {
32
-			$this->_request->un_set( 'activate', true );
33
-			add_action( 'admin_notices', array( $this, 'minimum_wp_version_error' ), 1 );
31
+		if ( ! $this->_minimum_wp_version_required()) {
32
+			$this->_request->un_set('activate', true);
33
+			add_action('admin_notices', array($this, 'minimum_wp_version_error'), 1);
34 34
 			//$this->_response->add_output( "\n<br />" . 'minimum_wp_version_error' );
35 35
 			$this->_response->terminate_request();
36 36
 			$this->_response->deactivate_plugin();
37 37
 		}
38 38
 		// check required PHP version
39
-		if ( ! $this->_minimum_php_version_required() ) {
40
-			$this->_request->un_set( 'activate', true );
41
-			add_action( 'admin_notices', array( $this, 'minimum_php_version_error' ), 1 );
39
+		if ( ! $this->_minimum_php_version_required()) {
40
+			$this->_request->un_set('activate', true);
41
+			add_action('admin_notices', array($this, 'minimum_php_version_error'), 1);
42 42
 			//$this->_response->add_output( "\n<br />" . 'minimum_php_version_error' );
43 43
 			$this->_response->terminate_request();
44 44
 			$this->_response->deactivate_plugin();
45 45
 		}
46 46
 		// check recommended PHP version
47
-		if ( ! $this->_minimum_php_version_recommended() ) {
47
+		if ( ! $this->_minimum_php_version_recommended()) {
48 48
 			$this->_display_minimum_recommended_php_version_notice();
49 49
 		}
50
-		$this->_response = $this->process_request_stack( $this->_request, $this->_response );
50
+		$this->_response = $this->process_request_stack($this->_request, $this->_response);
51 51
 		//$this->_response->add_output( "\n\t OUT << " . __CLASS__ );
52 52
 		return $this->_response;
53 53
 	}
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 	 * @param string $min_version
62 62
 	 * @return boolean
63 63
 	 */
64
-	private function _check_wp_version( $min_version = EE_MIN_WP_VER_REQUIRED ) {
64
+	private function _check_wp_version($min_version = EE_MIN_WP_VER_REQUIRED) {
65 65
 		global $wp_version;
66
-		return version_compare( $wp_version, $min_version, '>=' ) ? true : false;
66
+		return version_compare($wp_version, $min_version, '>=') ? true : false;
67 67
 	}
68 68
 
69 69
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @return boolean
76 76
 	 */
77 77
 	private function _minimum_wp_version_required() {
78
-		return $this->_check_wp_version( EE_MIN_WP_VER_REQUIRED );
78
+		return $this->_check_wp_version(EE_MIN_WP_VER_REQUIRED);
79 79
 	}
80 80
 
81 81
 
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 * @param string $min_version
88 88
 	 * @return boolean
89 89
 	 */
90
-	private function _check_php_version( $min_version = EE_MIN_PHP_VER_RECOMMENDED ) {
91
-		return version_compare( PHP_VERSION, $min_version, '>=' ) ? true : false;
90
+	private function _check_php_version($min_version = EE_MIN_PHP_VER_RECOMMENDED) {
91
+		return version_compare(PHP_VERSION, $min_version, '>=') ? true : false;
92 92
 	}
93 93
 
94 94
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 * @return boolean
101 101
 	 */
102 102
 	private function _minimum_php_version_required() {
103
-		return $this->_check_php_version( EE_MIN_PHP_VER_REQUIRED );
103
+		return $this->_check_php_version(EE_MIN_PHP_VER_REQUIRED);
104 104
 	}
105 105
 
106 106
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 * @return boolean
113 113
 	 */
114 114
 	private function _minimum_php_version_recommended() {
115
-		return $this->_check_php_version( EE_MIN_PHP_VER_RECOMMENDED );
115
+		return $this->_check_php_version(EE_MIN_PHP_VER_RECOMMENDED);
116 116
 	}
117 117
 
118 118
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 			<p>
130 130
 				<?php
131 131
 				printf(
132
-					__( 'We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.', 'event_espresso' ),
132
+					__('We\'re sorry, but Event Espresso requires WordPress version %1$s or greater in order to operate. You are currently running version %2$s.%3$sFor information on how to update your version of WordPress, please go to %4$s.', 'event_espresso'),
133 133
 					EE_MIN_WP_VER_REQUIRED,
134 134
 					$wp_version,
135 135
 					'<br/>',
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	private function _display_minimum_recommended_php_version_notice() {
154 154
 		EE_Error::add_persistent_admin_notice(
155
-			'php_version_' . str_replace( '.', '-', EE_MIN_PHP_VER_RECOMMENDED ) . '_recommended',
155
+			'php_version_'.str_replace('.', '-', EE_MIN_PHP_VER_RECOMMENDED).'_recommended',
156 156
 			sprintf(
157
-				__( 'Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', 'event_espresso' ),
157
+				__('Event Espresso recommends PHP version %1$s or greater for optimal performance. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', 'event_espresso'),
158 158
 				EE_MIN_PHP_VER_RECOMMENDED,
159 159
 				PHP_VERSION,
160 160
 				'<br/>',
Please login to merge, or discard this patch.
core/libraries/plugin_api/EE_Register_Addon.lib.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		// if plugin_action_slug is NOT set, but an admin page path IS set,
382 382
 		// then let's just use the plugin_slug since that will be used for linking to the admin page
383 383
 		$addon_settings['plugin_action_slug'] = empty( $addon_settings['plugin_action_slug'] )
384
-		                                        && ! empty( $addon_settings['admin_path'] )
384
+												&& ! empty( $addon_settings['admin_path'] )
385 385
 			? $addon_settings['plugin_slug']
386 386
 			: $addon_settings['plugin_action_slug'];
387 387
 		// full server path to main file (file loaded directly by WP)
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
 				EE_Register_Widget::deregister( $addon_name );
767 767
 			}
768 768
 			if ( ! empty( self::$_settings[ $addon_name ]['model_paths'] )
769
-			     ||
770
-			     ! empty( self::$_settings[ $addon_name ]['class_paths'] )
769
+				 ||
770
+				 ! empty( self::$_settings[ $addon_name ]['class_paths'] )
771 771
 			) {
772 772
 				// add to list of shortcodes to be registered
773 773
 				EE_Register_Model::deregister( $addon_name );
774 774
 			}
775 775
 			if ( ! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
776
-			     ||
777
-			     ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
776
+				 ||
777
+				 ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
778 778
 			) {
779 779
 				// add to list of shortcodes to be registered
780 780
 				EE_Register_Model_Extensions::deregister( $addon_name );
Please login to merge, or discard this patch.
Spacing   +182 added lines, -182 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
 
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
 	 * @param string $min_core_version
61 61
 	 * @return string always like '4.3.0.rc.000'
62 62
 	 */
63
-	protected static function _effective_version( $min_core_version ) {
63
+	protected static function _effective_version($min_core_version) {
64 64
 		// versions: 4 . 3 . 1 . p . 123
65 65
 		// offsets:    0 . 1 . 2 . 3 . 4
66
-		$version_parts = explode( '.', $min_core_version );
66
+		$version_parts = explode('.', $min_core_version);
67 67
 		//check they specified the micro version (after 2nd period)
68
-		if ( ! isset( $version_parts[2] ) ) {
68
+		if ( ! isset($version_parts[2])) {
69 69
 			$version_parts[2] = '0';
70 70
 		}
71 71
 		//if they didn't specify the 'p', or 'rc' part. Just assume the lowest possible
72 72
 		//soon we can assume that's 'rc', but this current version is 'alpha'
73
-		if ( ! isset( $version_parts[3] ) ) {
73
+		if ( ! isset($version_parts[3])) {
74 74
 			$version_parts[3] = 'dev';
75 75
 		}
76
-		if ( ! isset( $version_parts[4] ) ) {
76
+		if ( ! isset($version_parts[4])) {
77 77
 			$version_parts[4] = '000';
78 78
 		}
79
-		return implode( '.', $version_parts );
79
+		return implode('.', $version_parts);
80 80
 	}
81 81
 
82 82
 
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 		$actual_core_version = EVENT_ESPRESSO_VERSION
94 94
 	) {
95 95
 		return version_compare(
96
-			self::_effective_version( $actual_core_version ),
97
-			self::_effective_version( $min_core_version ),
96
+			self::_effective_version($actual_core_version),
97
+			self::_effective_version($min_core_version),
98 98
 			'>='
99 99
 		);
100 100
 	}
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 	 * @throws EE_Error
217 217
 	 * @return void
218 218
 	 */
219
-	public static function register( $addon_name = '', $setup_args = array() ) {
219
+	public static function register($addon_name = '', $setup_args = array()) {
220 220
 		// required fields MUST be present, so let's make sure they are.
221
-		if ( empty( $addon_name ) || ! is_array( $setup_args ) ) {
221
+		if (empty($addon_name) || ! is_array($setup_args)) {
222 222
 			throw new EE_Error(
223 223
 				__(
224 224
 					'In order to register an EE_Addon with EE_Register_Addon::register(), you must include the "addon_name" (the name of the addon), and an array of arguments.',
@@ -226,19 +226,19 @@  discard block
 block discarded – undo
226 226
 				)
227 227
 			);
228 228
 		}
229
-		if ( ! isset( $setup_args['main_file_path'] ) || empty( $setup_args['main_file_path'] ) ) {
229
+		if ( ! isset($setup_args['main_file_path']) || empty($setup_args['main_file_path'])) {
230 230
 			throw new EE_Error(
231 231
 				sprintf(
232 232
 					__(
233 233
 						'When registering an addon, you didn\'t provide the "main_file_path", which is the full path to the main file loaded directly by Wordpress. You only provided %s',
234 234
 						'event_espresso'
235 235
 					),
236
-					implode( ",", array_keys( $setup_args ) )
236
+					implode(",", array_keys($setup_args))
237 237
 				)
238 238
 			);
239 239
 		}
240 240
 		// check that addon has not already been registered with that name
241
-		if ( isset( self::$_settings[ $addon_name ] ) && ! did_action( 'activate_plugin' ) ) {
241
+		if (isset(self::$_settings[$addon_name]) && ! did_action('activate_plugin')) {
242 242
 			throw new EE_Error(
243 243
 				sprintf(
244 244
 					__(
@@ -250,124 +250,124 @@  discard block
 block discarded – undo
250 250
 			);
251 251
 		}
252 252
 		// no class name for addon?
253
-		if ( empty( $setup_args['class_name'] ) ) {
253
+		if (empty($setup_args['class_name'])) {
254 254
 			// generate one by first separating name with spaces
255
-			$class_name = str_replace( array( '-', '_' ), ' ', trim( $addon_name ) );
255
+			$class_name = str_replace(array('-', '_'), ' ', trim($addon_name));
256 256
 			//capitalize, then replace spaces with underscores
257
-			$class_name = str_replace( ' ', '_', ucwords( $class_name ) );
257
+			$class_name = str_replace(' ', '_', ucwords($class_name));
258 258
 		} else {
259 259
 			$class_name = $setup_args['class_name'];
260 260
 		}
261
-		$class_name = strpos( $class_name, 'EE_' ) === 0 ? $class_name : 'EE_' . $class_name;
261
+		$class_name = strpos($class_name, 'EE_') === 0 ? $class_name : 'EE_'.$class_name;
262 262
 		//setup $_settings array from incoming values.
263 263
 		$addon_settings = array(
264 264
 			// generated from the addon name, changes something like "calendar" to "EE_Calendar"
265 265
 			'class_name'            => $class_name,
266 266
 			// the addon slug for use in URLs, etc
267
-			'plugin_slug'           => isset( $setup_args['plugin_slug'] )
267
+			'plugin_slug'           => isset($setup_args['plugin_slug'])
268 268
 				? (string) $setup_args['plugin_slug']
269 269
 				: '',
270 270
 			// page slug to be used when generating the "Settings" link on the WP plugin page
271
-			'plugin_action_slug'    => isset( $setup_args['plugin_action_slug'] )
271
+			'plugin_action_slug'    => isset($setup_args['plugin_action_slug'])
272 272
 				? (string) $setup_args['plugin_action_slug']
273 273
 				: '',
274 274
 			// the "software" version for the addon
275
-			'version'               => isset( $setup_args['version'] )
275
+			'version'               => isset($setup_args['version'])
276 276
 				? (string) $setup_args['version']
277 277
 				: '',
278 278
 			// the minimum version of EE Core that the addon will work with
279
-			'min_core_version'      => isset( $setup_args['min_core_version'] )
279
+			'min_core_version'      => isset($setup_args['min_core_version'])
280 280
 				? (string) $setup_args['min_core_version']
281 281
 				: '',
282 282
 			// the minimum version of WordPress that the addon will work with
283
-			'min_wp_version'        => isset( $setup_args['min_wp_version'] )
283
+			'min_wp_version'        => isset($setup_args['min_wp_version'])
284 284
 				? (string) $setup_args['min_wp_version']
285 285
 				: EE_MIN_WP_VER_REQUIRED,
286 286
 			// full server path to main file (file loaded directly by WP)
287
-			'main_file_path'        => isset( $setup_args['main_file_path'] )
287
+			'main_file_path'        => isset($setup_args['main_file_path'])
288 288
 				? (string) $setup_args['main_file_path']
289 289
 				: '',
290 290
 			// path to folder containing files for integrating with the EE core admin and/or setting up EE admin pages
291
-			'admin_path'            => isset( $setup_args['admin_path'] )
291
+			'admin_path'            => isset($setup_args['admin_path'])
292 292
 				? (string) $setup_args['admin_path'] : '',
293 293
 			// a method to be called when the EE Admin is first invoked, can be used for hooking into any admin page
294
-			'admin_callback'        => isset( $setup_args['admin_callback'] )
294
+			'admin_callback'        => isset($setup_args['admin_callback'])
295 295
 				? (string) $setup_args['admin_callback']
296 296
 				: '',
297 297
 			// the section name for this addon's configuration settings section (defaults to "addons")
298
-			'config_section'        => isset( $setup_args['config_section'] )
298
+			'config_section'        => isset($setup_args['config_section'])
299 299
 				? (string) $setup_args['config_section']
300 300
 				: 'addons',
301 301
 			// the class name for this addon's configuration settings object
302
-			'config_class'          => isset( $setup_args['config_class'] )
302
+			'config_class'          => isset($setup_args['config_class'])
303 303
 				? (string) $setup_args['config_class'] : '',
304 304
 			//the name given to the config for this addons' configuration settings object (optional)
305
-			'config_name'           => isset( $setup_args['config_name'] )
305
+			'config_name'           => isset($setup_args['config_name'])
306 306
 				? (string) $setup_args['config_name'] : '',
307 307
 			// an array of "class names" => "full server paths" for any classes that might be invoked by the addon
308
-			'autoloader_paths'      => isset( $setup_args['autoloader_paths'] )
308
+			'autoloader_paths'      => isset($setup_args['autoloader_paths'])
309 309
 				? (array) $setup_args['autoloader_paths']
310 310
 				: array(),
311 311
 			// an array of  "full server paths" for any folders containing classes that might be invoked by the addon
312
-			'autoloader_folders'    => isset( $setup_args['autoloader_folders'] )
312
+			'autoloader_folders'    => isset($setup_args['autoloader_folders'])
313 313
 				? (array) $setup_args['autoloader_folders']
314 314
 				: array(),
315 315
 			// array of full server paths to any EE_DMS data migration scripts used by the addon
316
-			'dms_paths'             => isset( $setup_args['dms_paths'] )
316
+			'dms_paths'             => isset($setup_args['dms_paths'])
317 317
 				? (array) $setup_args['dms_paths']
318 318
 				: array(),
319 319
 			// array of full server paths to any EED_Modules used by the addon
320
-			'module_paths'          => isset( $setup_args['module_paths'] )
320
+			'module_paths'          => isset($setup_args['module_paths'])
321 321
 				? (array) $setup_args['module_paths']
322 322
 				: array(),
323 323
 			// array of full server paths to any EES_Shortcodes used by the addon
324
-			'shortcode_paths'       => isset( $setup_args['shortcode_paths'] )
324
+			'shortcode_paths'       => isset($setup_args['shortcode_paths'])
325 325
 				? (array) $setup_args['shortcode_paths']
326 326
 				: array(),
327 327
 			// array of full server paths to any WP_Widgets used by the addon
328
-			'widget_paths'          => isset( $setup_args['widget_paths'] )
328
+			'widget_paths'          => isset($setup_args['widget_paths'])
329 329
 				? (array) $setup_args['widget_paths']
330 330
 				: array(),
331 331
 			// array of PUE options used by the addon
332
-			'pue_options'           => isset( $setup_args['pue_options'] )
332
+			'pue_options'           => isset($setup_args['pue_options'])
333 333
 				? (array) $setup_args['pue_options']
334 334
 				: array(),
335
-			'message_types'         => isset( $setup_args['message_types'] )
335
+			'message_types'         => isset($setup_args['message_types'])
336 336
 				? (array) $setup_args['message_types']
337 337
 				: array(),
338
-			'capabilities'          => isset( $setup_args['capabilities'] )
338
+			'capabilities'          => isset($setup_args['capabilities'])
339 339
 				? (array) $setup_args['capabilities']
340 340
 				: array(),
341
-			'capability_maps'       => isset( $setup_args['capability_maps'] )
341
+			'capability_maps'       => isset($setup_args['capability_maps'])
342 342
 				? (array) $setup_args['capability_maps']
343 343
 				: array(),
344
-			'model_paths'           => isset( $setup_args['model_paths'] )
344
+			'model_paths'           => isset($setup_args['model_paths'])
345 345
 				? (array) $setup_args['model_paths']
346 346
 				: array(),
347
-			'class_paths'           => isset( $setup_args['class_paths'] )
347
+			'class_paths'           => isset($setup_args['class_paths'])
348 348
 				? (array) $setup_args['class_paths']
349 349
 				: array(),
350
-			'model_extension_paths' => isset( $setup_args['model_extension_paths'] )
350
+			'model_extension_paths' => isset($setup_args['model_extension_paths'])
351 351
 				? (array) $setup_args['model_extension_paths']
352 352
 				: array(),
353
-			'class_extension_paths' => isset( $setup_args['class_extension_paths'] )
353
+			'class_extension_paths' => isset($setup_args['class_extension_paths'])
354 354
 				? (array) $setup_args['class_extension_paths']
355 355
 				: array(),
356
-			'custom_post_types'     => isset( $setup_args['custom_post_types'] )
356
+			'custom_post_types'     => isset($setup_args['custom_post_types'])
357 357
 				? (array) $setup_args['custom_post_types']
358 358
 				: array(),
359
-			'custom_taxonomies'     => isset( $setup_args['custom_taxonomies'] )
359
+			'custom_taxonomies'     => isset($setup_args['custom_taxonomies'])
360 360
 				? (array) $setup_args['custom_taxonomies']
361 361
 				: array(),
362
-			'payment_method_paths'  => isset( $setup_args['payment_method_paths'] )
362
+			'payment_method_paths'  => isset($setup_args['payment_method_paths'])
363 363
 				? (array) $setup_args['payment_method_paths']
364 364
 				: array(),
365
-			'default_terms'         => isset( $setup_args['default_terms'] )
365
+			'default_terms'         => isset($setup_args['default_terms'])
366 366
 				? (array) $setup_args['default_terms']
367 367
 				: array(),
368 368
 			// if not empty, inserts a new table row after this plugin's row on the WP Plugins page
369 369
 			// that can be used for adding upgrading/marketing info
370
-			'plugins_page_row'      => isset( $setup_args['plugins_page_row'] )
370
+			'plugins_page_row'      => isset($setup_args['plugins_page_row'])
371 371
 				? $setup_args['plugins_page_row']
372 372
 				: '',
373 373
 			'namespace'             => isset(
@@ -380,19 +380,19 @@  discard block
 block discarded – undo
380 380
 		);
381 381
 		// if plugin_action_slug is NOT set, but an admin page path IS set,
382 382
 		// then let's just use the plugin_slug since that will be used for linking to the admin page
383
-		$addon_settings['plugin_action_slug'] = empty( $addon_settings['plugin_action_slug'] )
384
-		                                        && ! empty( $addon_settings['admin_path'] )
383
+		$addon_settings['plugin_action_slug'] = empty($addon_settings['plugin_action_slug'])
384
+		                                        && ! empty($addon_settings['admin_path'])
385 385
 			? $addon_settings['plugin_slug']
386 386
 			: $addon_settings['plugin_action_slug'];
387 387
 		// full server path to main file (file loaded directly by WP)
388
-		$addon_settings['plugin_basename'] = plugin_basename( $addon_settings['main_file_path'] );
388
+		$addon_settings['plugin_basename'] = plugin_basename($addon_settings['main_file_path']);
389 389
 		global $wp_version;
390 390
 		$incompatibility_message = '';
391 391
 		//check whether this addon version is compatible with EE core
392 392
 		if (
393
-			isset( EE_Register_Addon::$_incompatible_addons[ $addon_name ] )
393
+			isset(EE_Register_Addon::$_incompatible_addons[$addon_name])
394 394
 			&& ! self::_meets_min_core_version_requirement(
395
-				EE_Register_Addon::$_incompatible_addons[ $addon_name ],
395
+				EE_Register_Addon::$_incompatible_addons[$addon_name],
396 396
 				$addon_settings['version']
397 397
 			)
398 398
 		) {
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 				),
404 404
 				$addon_name,
405 405
 				'<br />',
406
-				EE_Register_Addon::$_incompatible_addons[ $addon_name ]
406
+				EE_Register_Addon::$_incompatible_addons[$addon_name]
407 407
 			);
408 408
 		} else if (
409
-		! self::_meets_min_core_version_requirement( $addon_settings['min_core_version'], espresso_version() )
409
+		! self::_meets_min_core_version_requirement($addon_settings['min_core_version'], espresso_version())
410 410
 		) {
411 411
 			$incompatibility_message = sprintf(
412 412
 				__(
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 					'event_espresso'
415 415
 				),
416 416
 				$addon_name,
417
-				self::_effective_version( $addon_settings['min_core_version'] ),
418
-				self::_effective_version( espresso_version() ),
417
+				self::_effective_version($addon_settings['min_core_version']),
418
+				self::_effective_version(espresso_version()),
419 419
 				'<br />'
420 420
 			);
421
-		} else if ( version_compare( $wp_version, $addon_settings['min_wp_version'], '<' ) ) {
421
+		} else if (version_compare($wp_version, $addon_settings['min_wp_version'], '<')) {
422 422
 			$incompatibility_message = sprintf(
423 423
 				__(
424 424
 					'The Event Espresso "%1$s" addon could not be activated because it requires WordPress version "%2$s" or greater.%3$sPlease update your version of WordPress to use the "%1$s" addon and to keep your site secure.',
@@ -429,20 +429,20 @@  discard block
 block discarded – undo
429 429
 				'<br />'
430 430
 			);
431 431
 		}
432
-		if ( ! empty( $incompatibility_message ) ) {
432
+		if ( ! empty($incompatibility_message)) {
433 433
 			//remove 'activate' from the REQUEST so WP doesn't erroneously tell the user the
434 434
 			//plugin activated fine when it didn't
435
-			if ( isset( $_GET['activate'] ) ) {
436
-				unset( $_GET['activate'] );
435
+			if (isset($_GET['activate'])) {
436
+				unset($_GET['activate']);
437 437
 			}
438
-			if ( isset( $_REQUEST['activate'] ) ) {
439
-				unset( $_REQUEST['activate'] );
438
+			if (isset($_REQUEST['activate'])) {
439
+				unset($_REQUEST['activate']);
440 440
 			}
441 441
 			//and show an error message indicating the plugin didn't activate properly
442
-			EE_Error::add_error( $incompatibility_message, __FILE__, __FUNCTION__, __LINE__ );
443
-			if ( current_user_can( 'activate_plugins' ) ) {
444
-				require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
445
-				deactivate_plugins( plugin_basename( $addon_settings['main_file_path'] ), true );
442
+			EE_Error::add_error($incompatibility_message, __FILE__, __FUNCTION__, __LINE__);
443
+			if (current_user_can('activate_plugins')) {
444
+				require_once(ABSPATH.'wp-admin/includes/plugin.php');
445
+				deactivate_plugins(plugin_basename($addon_settings['main_file_path']), true);
446 446
 			}
447 447
 			return;
448 448
 		}
@@ -460,13 +460,13 @@  discard block
 block discarded – undo
460 460
 			);
461 461
 		}
462 462
 		//this is an activation request
463
-		if ( did_action( 'activate_plugin' ) ) {
463
+		if (did_action('activate_plugin')) {
464 464
 			//to find if THIS is the addon that was activated,
465 465
 			//just check if we have already registered it or not
466 466
 			//(as the newly-activated addon wasn't around the first time addons were registered)
467
-			if ( ! isset( self::$_settings[ $addon_name ] ) ) {
468
-				self::$_settings[ $addon_name ] = $addon_settings;
469
-				$addon = self::_load_and_init_addon_class( $addon_name );
467
+			if ( ! isset(self::$_settings[$addon_name])) {
468
+				self::$_settings[$addon_name] = $addon_settings;
469
+				$addon = self::_load_and_init_addon_class($addon_name);
470 470
 				$addon->set_activation_indicator_option();
471 471
 				//dont bother setting up the rest of the addon.
472 472
 				//we know it was just activated and the request will end soon
@@ -475,8 +475,8 @@  discard block
 block discarded – undo
475 475
 		} else {
476 476
 			// make sure this was called in the right place!
477 477
 			if (
478
-				! did_action( 'AHEE__EE_System__load_espresso_addons' )
479
-				|| did_action( 'AHEE__EE_System___detect_if_activation_or_upgrade__begin' )
478
+				! did_action('AHEE__EE_System__load_espresso_addons')
479
+				|| did_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin')
480 480
 			) {
481 481
 				EE_Error::doing_it_wrong(
482 482
 					__METHOD__,
@@ -490,155 +490,155 @@  discard block
 block discarded – undo
490 490
 					'4.3.0'
491 491
 				);
492 492
 			}
493
-			self::$_settings[ $addon_name ] = $addon_settings;
493
+			self::$_settings[$addon_name] = $addon_settings;
494 494
 		}
495 495
 		// we need cars
496
-		if ( ! empty( self::$_settings[ $addon_name ]['autoloader_paths'] ) ) {
496
+		if ( ! empty(self::$_settings[$addon_name]['autoloader_paths'])) {
497 497
 			// setup autoloader for single file
498
-			EEH_Autoloader::instance()->register_autoloader( self::$_settings[ $addon_name ]['autoloader_paths'] );
498
+			EEH_Autoloader::instance()->register_autoloader(self::$_settings[$addon_name]['autoloader_paths']);
499 499
 		}
500 500
 		// setup autoloaders for folders
501
-		if ( ! empty( self::$_settings[ $addon_name ]['autoloader_folders'] ) ) {
502
-			foreach ( self::$_settings[ $addon_name ]['autoloader_folders'] as $autoloader_folder ) {
503
-				EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $autoloader_folder );
501
+		if ( ! empty(self::$_settings[$addon_name]['autoloader_folders'])) {
502
+			foreach (self::$_settings[$addon_name]['autoloader_folders'] as $autoloader_folder) {
503
+				EEH_Autoloader::register_autoloaders_for_each_file_in_folder($autoloader_folder);
504 504
 			}
505 505
 		}
506 506
 		// register new models
507 507
 		if (
508
-			! empty( self::$_settings[ $addon_name ]['model_paths'] )
509
-			|| ! empty( self::$_settings[ $addon_name ]['class_paths'] )
508
+			! empty(self::$_settings[$addon_name]['model_paths'])
509
+			|| ! empty(self::$_settings[$addon_name]['class_paths'])
510 510
 		) {
511 511
 			EE_Register_Model::register(
512 512
 				$addon_name,
513 513
 				array(
514
-					'model_paths' => self::$_settings[ $addon_name ]['model_paths'],
515
-					'class_paths' => self::$_settings[ $addon_name ]['class_paths'],
514
+					'model_paths' => self::$_settings[$addon_name]['model_paths'],
515
+					'class_paths' => self::$_settings[$addon_name]['class_paths'],
516 516
 				)
517 517
 			);
518 518
 		}
519 519
 		// register model extensions
520 520
 		if (
521
-			! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
522
-			|| ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
521
+			! empty(self::$_settings[$addon_name]['model_extension_paths'])
522
+			|| ! empty(self::$_settings[$addon_name]['class_extension_paths'])
523 523
 		) {
524 524
 			EE_Register_Model_Extensions::register(
525 525
 				$addon_name,
526 526
 				array(
527
-					'model_extension_paths' => self::$_settings[ $addon_name ]['model_extension_paths'],
528
-					'class_extension_paths' => self::$_settings[ $addon_name ]['class_extension_paths'],
527
+					'model_extension_paths' => self::$_settings[$addon_name]['model_extension_paths'],
528
+					'class_extension_paths' => self::$_settings[$addon_name]['class_extension_paths'],
529 529
 				)
530 530
 			);
531 531
 		}
532 532
 		// setup DMS
533
-		if ( ! empty( self::$_settings[ $addon_name ]['dms_paths'] ) ) {
533
+		if ( ! empty(self::$_settings[$addon_name]['dms_paths'])) {
534 534
 			EE_Register_Data_Migration_Scripts::register(
535 535
 				$addon_name,
536
-				array( 'dms_paths' => self::$_settings[ $addon_name ]['dms_paths'] )
536
+				array('dms_paths' => self::$_settings[$addon_name]['dms_paths'])
537 537
 			);
538 538
 		}
539 539
 		// if config_class is present let's register config.
540
-		if ( ! empty( self::$_settings[ $addon_name ]['config_class'] ) ) {
540
+		if ( ! empty(self::$_settings[$addon_name]['config_class'])) {
541 541
 			EE_Register_Config::register(
542
-				self::$_settings[ $addon_name ]['config_class'],
542
+				self::$_settings[$addon_name]['config_class'],
543 543
 				array(
544
-					'config_section' => self::$_settings[ $addon_name ]['config_section'],
545
-					'config_name'    => self::$_settings[ $addon_name ]['config_name'],
544
+					'config_section' => self::$_settings[$addon_name]['config_section'],
545
+					'config_name'    => self::$_settings[$addon_name]['config_name'],
546 546
 				)
547 547
 			);
548 548
 		}
549 549
 		// register admin page
550
-		if ( ! empty( self::$_settings[ $addon_name ]['admin_path'] ) ) {
550
+		if ( ! empty(self::$_settings[$addon_name]['admin_path'])) {
551 551
 			EE_Register_Admin_Page::register(
552 552
 				$addon_name,
553
-				array( 'page_path' => self::$_settings[ $addon_name ]['admin_path'] )
553
+				array('page_path' => self::$_settings[$addon_name]['admin_path'])
554 554
 			);
555 555
 		}
556 556
 		// add to list of modules to be registered
557
-		if ( ! empty( self::$_settings[ $addon_name ]['module_paths'] ) ) {
557
+		if ( ! empty(self::$_settings[$addon_name]['module_paths'])) {
558 558
 			EE_Register_Module::register(
559 559
 				$addon_name,
560
-				array( 'module_paths' => self::$_settings[ $addon_name ]['module_paths'] )
560
+				array('module_paths' => self::$_settings[$addon_name]['module_paths'])
561 561
 			);
562 562
 		}
563 563
 		// add to list of shortcodes to be registered
564
-		if ( ! empty( self::$_settings[ $addon_name ]['shortcode_paths'] ) ) {
564
+		if ( ! empty(self::$_settings[$addon_name]['shortcode_paths'])) {
565 565
 			EE_Register_Shortcode::register(
566 566
 				$addon_name,
567
-				array( 'shortcode_paths' => self::$_settings[ $addon_name ]['shortcode_paths'] )
567
+				array('shortcode_paths' => self::$_settings[$addon_name]['shortcode_paths'])
568 568
 			);
569 569
 		}
570 570
 		// add to list of widgets to be registered
571
-		if ( ! empty( self::$_settings[ $addon_name ]['widget_paths'] ) ) {
571
+		if ( ! empty(self::$_settings[$addon_name]['widget_paths'])) {
572 572
 			EE_Register_Widget::register(
573 573
 				$addon_name,
574
-				array( 'widget_paths' => self::$_settings[ $addon_name ]['widget_paths'] )
574
+				array('widget_paths' => self::$_settings[$addon_name]['widget_paths'])
575 575
 			);
576 576
 		}
577 577
 		//register capability related stuff.
578
-		if ( ! empty( self::$_settings[ $addon_name ]['capabilities'] ) ) {
578
+		if ( ! empty(self::$_settings[$addon_name]['capabilities'])) {
579 579
 			EE_Register_Capabilities::register(
580 580
 				$addon_name,
581 581
 				array(
582
-					'capabilities'    => self::$_settings[ $addon_name ]['capabilities'],
583
-					'capability_maps' => self::$_settings[ $addon_name ]['capability_maps'],
582
+					'capabilities'    => self::$_settings[$addon_name]['capabilities'],
583
+					'capability_maps' => self::$_settings[$addon_name]['capability_maps'],
584 584
 				)
585 585
 			);
586 586
 		}
587 587
 		//any message type to register?
588
-		if ( ! empty( self::$_settings[ $addon_name ]['message_types'] ) ) {
588
+		if ( ! empty(self::$_settings[$addon_name]['message_types'])) {
589 589
 			add_action(
590 590
 				'EE_Brewing_Regular___messages_caf',
591
-				array( 'EE_Register_Addon', 'register_message_types' )
591
+				array('EE_Register_Addon', 'register_message_types')
592 592
 			);
593 593
 		}
594 594
 		// if plugin update engine is being used for auto-updates (not needed if PUE is not being used)
595
-		if ( ! empty( $setup_args['pue_options'] ) ) {
596
-			self::$_settings[ $addon_name ]['pue_options'] = array(
597
-				'pue_plugin_slug' => isset( $setup_args['pue_options']['pue_plugin_slug'] )
595
+		if ( ! empty($setup_args['pue_options'])) {
596
+			self::$_settings[$addon_name]['pue_options'] = array(
597
+				'pue_plugin_slug' => isset($setup_args['pue_options']['pue_plugin_slug'])
598 598
 					? (string) $setup_args['pue_options']['pue_plugin_slug']
599
-					: 'espresso_' . strtolower( $class_name ),
600
-				'plugin_basename' => isset( $setup_args['pue_options']['plugin_basename'] )
599
+					: 'espresso_'.strtolower($class_name),
600
+				'plugin_basename' => isset($setup_args['pue_options']['plugin_basename'])
601 601
 					? (string) $setup_args['pue_options']['plugin_basename']
602
-					: plugin_basename( self::$_settings[ $addon_name ]['main_file_path'] ),
603
-				'checkPeriod'     => isset( $setup_args['pue_options']['checkPeriod'] )
602
+					: plugin_basename(self::$_settings[$addon_name]['main_file_path']),
603
+				'checkPeriod'     => isset($setup_args['pue_options']['checkPeriod'])
604 604
 					? (string) $setup_args['pue_options']['checkPeriod']
605 605
 					: '24',
606
-				'use_wp_update'   => isset( $setup_args['pue_options']['use_wp_update'] )
606
+				'use_wp_update'   => isset($setup_args['pue_options']['use_wp_update'])
607 607
 					? (string) $setup_args['pue_options']['use_wp_update']
608 608
 					: false,
609 609
 			);
610 610
 			add_action(
611 611
 				'AHEE__EE_System__brew_espresso__after_pue_init',
612
-				array( 'EE_Register_Addon', 'load_pue_update' )
612
+				array('EE_Register_Addon', 'load_pue_update')
613 613
 			);
614 614
 		}
615 615
 		//any custom post type/ custom capabilities or default terms to register
616 616
 		if (
617
-			! empty( self::$_settings[ $addon_name ]['custom_post_types'] )
618
-			|| ! empty( self::$_settings[ $addon_name ]['custom_taxonomies'] )
617
+			! empty(self::$_settings[$addon_name]['custom_post_types'])
618
+			|| ! empty(self::$_settings[$addon_name]['custom_taxonomies'])
619 619
 		) {
620 620
 			EE_Register_CPT::register(
621 621
 				$addon_name,
622 622
 				array(
623
-					'cpts'          => self::$_settings[ $addon_name ]['custom_post_types'],
624
-					'cts'           => self::$_settings[ $addon_name ]['custom_taxonomies'],
625
-					'default_terms' => self::$_settings[ $addon_name ]['default_terms'],
623
+					'cpts'          => self::$_settings[$addon_name]['custom_post_types'],
624
+					'cts'           => self::$_settings[$addon_name]['custom_taxonomies'],
625
+					'default_terms' => self::$_settings[$addon_name]['default_terms'],
626 626
 				)
627 627
 			);
628 628
 		}
629
-		if ( ! empty( self::$_settings[ $addon_name ]['payment_method_paths'] ) ) {
629
+		if ( ! empty(self::$_settings[$addon_name]['payment_method_paths'])) {
630 630
 			EE_Register_Payment_Method::register(
631 631
 				$addon_name,
632
-				array( 'payment_method_paths' => self::$_settings[ $addon_name ]['payment_method_paths'] )
632
+				array('payment_method_paths' => self::$_settings[$addon_name]['payment_method_paths'])
633 633
 			);
634 634
 		}
635 635
 		// load and instantiate main addon class
636
-		$addon = self::_load_and_init_addon_class( $addon_name );
636
+		$addon = self::_load_and_init_addon_class($addon_name);
637 637
 		// call any additional admin_callback functions during load_admin_controller hook
638
-		if ( ! empty( self::$_settings[ $addon_name ]['admin_callback'] ) ) {
638
+		if ( ! empty(self::$_settings[$addon_name]['admin_callback'])) {
639 639
 			add_action(
640 640
 				'AHEE__EE_System__load_controllers__load_admin_controllers',
641
-				array( $addon, self::$_settings[ $addon_name ]['admin_callback'] )
641
+				array($addon, self::$_settings[$addon_name]['admin_callback'])
642 642
 			);
643 643
 		}
644 644
 	}
@@ -651,25 +651,25 @@  discard block
 block discarded – undo
651 651
 	 * @param string $addon_name
652 652
 	 * @return EE_Addon
653 653
 	 */
654
-	private static function _load_and_init_addon_class( $addon_name ) {
654
+	private static function _load_and_init_addon_class($addon_name) {
655 655
 		$addon = EE_Registry::instance()->load_addon(
656
-			dirname( self::$_settings[ $addon_name ]['main_file_path'] ),
657
-			self::$_settings[ $addon_name ]['class_name']
656
+			dirname(self::$_settings[$addon_name]['main_file_path']),
657
+			self::$_settings[$addon_name]['class_name']
658 658
 		);
659
-		$addon->set_name( $addon_name );
660
-		$addon->set_plugin_slug( self::$_settings[ $addon_name ]['plugin_slug'] );
661
-		$addon->set_plugin_basename( self::$_settings[ $addon_name ]['plugin_basename'] );
662
-		$addon->set_main_plugin_file( self::$_settings[ $addon_name ]['main_file_path'] );
663
-		$addon->set_plugin_action_slug( self::$_settings[ $addon_name ]['plugin_action_slug'] );
664
-		$addon->set_plugins_page_row( self::$_settings[ $addon_name ]['plugins_page_row'] );
665
-		$addon->set_version( self::$_settings[ $addon_name ]['version'] );
666
-		$addon->set_min_core_version( self::_effective_version( self::$_settings[ $addon_name ]['min_core_version'] ) );
667
-		$addon->set_config_section( self::$_settings[ $addon_name ]['config_section'] );
668
-		$addon->set_config_class( self::$_settings[ $addon_name ]['config_class'] );
669
-		$addon->set_config_name( self::$_settings[ $addon_name ]['config_name'] );
659
+		$addon->set_name($addon_name);
660
+		$addon->set_plugin_slug(self::$_settings[$addon_name]['plugin_slug']);
661
+		$addon->set_plugin_basename(self::$_settings[$addon_name]['plugin_basename']);
662
+		$addon->set_main_plugin_file(self::$_settings[$addon_name]['main_file_path']);
663
+		$addon->set_plugin_action_slug(self::$_settings[$addon_name]['plugin_action_slug']);
664
+		$addon->set_plugins_page_row(self::$_settings[$addon_name]['plugins_page_row']);
665
+		$addon->set_version(self::$_settings[$addon_name]['version']);
666
+		$addon->set_min_core_version(self::_effective_version(self::$_settings[$addon_name]['min_core_version']));
667
+		$addon->set_config_section(self::$_settings[$addon_name]['config_section']);
668
+		$addon->set_config_class(self::$_settings[$addon_name]['config_class']);
669
+		$addon->set_config_name(self::$_settings[$addon_name]['config_name']);
670 670
 		//unfortunately this can't be hooked in upon construction, because we don't have
671 671
 		//the plugin mainfile's path upon construction.
672
-		register_deactivation_hook( $addon->get_main_plugin_file(), array( $addon, 'deactivation' ) );
672
+		register_deactivation_hook($addon->get_main_plugin_file(), array($addon, 'deactivation'));
673 673
 		return $addon;
674 674
 	}
675 675
 
@@ -682,18 +682,18 @@  discard block
 block discarded – undo
682 682
 	 */
683 683
 	public static function load_pue_update() {
684 684
 		// load PUE client
685
-		require_once EE_THIRD_PARTY . 'pue' . DS . 'pue-client.php';
685
+		require_once EE_THIRD_PARTY.'pue'.DS.'pue-client.php';
686 686
 		// cycle thru settings
687
-		foreach ( self::$_settings as $settings ) {
688
-			if ( ! empty( $settings['pue_options'] ) ) {
687
+		foreach (self::$_settings as $settings) {
688
+			if ( ! empty($settings['pue_options'])) {
689 689
 				// initiate the class and start the plugin update engine!
690 690
 				new PluginUpdateEngineChecker(
691 691
 				// host file URL
692 692
 					'https://eventespresso.com',
693 693
 					// plugin slug(s)
694 694
 					array(
695
-						'premium'    => array( 'p' => $settings['pue_options']['pue_plugin_slug'] ),
696
-						'prerelease' => array( 'beta' => $settings['pue_options']['pue_plugin_slug'] . '-pr' ),
695
+						'premium'    => array('p' => $settings['pue_options']['pue_plugin_slug']),
696
+						'prerelease' => array('beta' => $settings['pue_options']['pue_plugin_slug'].'-pr'),
697 697
 					),
698 698
 					// options
699 699
 					array(
@@ -721,9 +721,9 @@  discard block
 block discarded – undo
721 721
 	 * @throws \EE_Error
722 722
 	 */
723 723
 	public static function register_message_types() {
724
-		foreach ( self::$_settings as $settings ) {
725
-			foreach ( $settings['message_types'] as $message_type => $message_type_settings ) {
726
-				EE_Register_Message_Type::register( $message_type, $message_type_settings );
724
+		foreach (self::$_settings as $settings) {
725
+			foreach ($settings['message_types'] as $message_type => $message_type_settings) {
726
+				EE_Register_Message_Type::register($message_type, $message_type_settings);
727 727
 			}
728 728
 		}
729 729
 	}
@@ -738,73 +738,73 @@  discard block
 block discarded – undo
738 738
 	 * @throws EE_Error
739 739
 	 * @return void
740 740
 	 */
741
-	public static function deregister( $addon_name = null ) {
742
-		if ( isset( self::$_settings[ $addon_name ] ) ) {
743
-			$class_name = self::$_settings[ $addon_name ]['class_name'];
744
-			if ( ! empty( self::$_settings[ $addon_name ]['dms_paths'] ) ) {
741
+	public static function deregister($addon_name = null) {
742
+		if (isset(self::$_settings[$addon_name])) {
743
+			$class_name = self::$_settings[$addon_name]['class_name'];
744
+			if ( ! empty(self::$_settings[$addon_name]['dms_paths'])) {
745 745
 				// setup DMS
746
-				EE_Register_Data_Migration_Scripts::deregister( $addon_name );
746
+				EE_Register_Data_Migration_Scripts::deregister($addon_name);
747 747
 			}
748
-			if ( ! empty( self::$_settings[ $addon_name ]['admin_path'] ) ) {
748
+			if ( ! empty(self::$_settings[$addon_name]['admin_path'])) {
749 749
 				// register admin page
750
-				EE_Register_Admin_Page::deregister( $addon_name );
750
+				EE_Register_Admin_Page::deregister($addon_name);
751 751
 			}
752
-			if ( ! empty( self::$_settings[ $addon_name ]['module_paths'] ) ) {
752
+			if ( ! empty(self::$_settings[$addon_name]['module_paths'])) {
753 753
 				// add to list of modules to be registered
754
-				EE_Register_Module::deregister( $addon_name );
754
+				EE_Register_Module::deregister($addon_name);
755 755
 			}
756
-			if ( ! empty( self::$_settings[ $addon_name ]['shortcode_paths'] ) ) {
756
+			if ( ! empty(self::$_settings[$addon_name]['shortcode_paths'])) {
757 757
 				// add to list of shortcodes to be registered
758
-				EE_Register_Shortcode::deregister( $addon_name );
758
+				EE_Register_Shortcode::deregister($addon_name);
759 759
 			}
760
-			if ( ! empty( self::$_settings[ $addon_name ]['config_class'] ) ) {
760
+			if ( ! empty(self::$_settings[$addon_name]['config_class'])) {
761 761
 				// if config_class present let's register config.
762
-				EE_Register_Config::deregister( self::$_settings[ $addon_name ]['config_class'] );
762
+				EE_Register_Config::deregister(self::$_settings[$addon_name]['config_class']);
763 763
 			}
764
-			if ( ! empty( self::$_settings[ $addon_name ]['widget_paths'] ) ) {
764
+			if ( ! empty(self::$_settings[$addon_name]['widget_paths'])) {
765 765
 				// add to list of widgets to be registered
766
-				EE_Register_Widget::deregister( $addon_name );
766
+				EE_Register_Widget::deregister($addon_name);
767 767
 			}
768
-			if ( ! empty( self::$_settings[ $addon_name ]['model_paths'] )
768
+			if ( ! empty(self::$_settings[$addon_name]['model_paths'])
769 769
 			     ||
770
-			     ! empty( self::$_settings[ $addon_name ]['class_paths'] )
770
+			     ! empty(self::$_settings[$addon_name]['class_paths'])
771 771
 			) {
772 772
 				// add to list of shortcodes to be registered
773
-				EE_Register_Model::deregister( $addon_name );
773
+				EE_Register_Model::deregister($addon_name);
774 774
 			}
775
-			if ( ! empty( self::$_settings[ $addon_name ]['model_extension_paths'] )
775
+			if ( ! empty(self::$_settings[$addon_name]['model_extension_paths'])
776 776
 			     ||
777
-			     ! empty( self::$_settings[ $addon_name ]['class_extension_paths'] )
777
+			     ! empty(self::$_settings[$addon_name]['class_extension_paths'])
778 778
 			) {
779 779
 				// add to list of shortcodes to be registered
780
-				EE_Register_Model_Extensions::deregister( $addon_name );
780
+				EE_Register_Model_Extensions::deregister($addon_name);
781 781
 			}
782
-			if ( ! empty( self::$_settings[ $addon_name ]['message_types'] ) ) {
783
-				foreach ( self::$_settings[ $addon_name ]['message_types'] as $message_type => $message_type_settings )
782
+			if ( ! empty(self::$_settings[$addon_name]['message_types'])) {
783
+				foreach (self::$_settings[$addon_name]['message_types'] as $message_type => $message_type_settings)
784 784
 				{
785
-					EE_Register_Message_Type::deregister( $message_type );
785
+					EE_Register_Message_Type::deregister($message_type);
786 786
 				}
787 787
 			}
788 788
 			//deregister capabilities for addon
789 789
 			if (
790
-				! empty( self::$_settings[ $addon_name ]['capabilities'] )
791
-				|| ! empty( self::$_settings[ $addon_name ]['capability_maps'] )
790
+				! empty(self::$_settings[$addon_name]['capabilities'])
791
+				|| ! empty(self::$_settings[$addon_name]['capability_maps'])
792 792
 			) {
793
-				EE_Register_Capabilities::deregister( $addon_name );
793
+				EE_Register_Capabilities::deregister($addon_name);
794 794
 			}
795 795
 			//deregister custom_post_types for addon
796
-			if ( ! empty( self::$_settings[ $addon_name ]['custom_post_types'] ) ) {
797
-				EE_Register_CPT::deregister( $addon_name );
796
+			if ( ! empty(self::$_settings[$addon_name]['custom_post_types'])) {
797
+				EE_Register_CPT::deregister($addon_name);
798 798
 			}
799 799
 			remove_action(
800
-				'deactivate_' . EE_Registry::instance()->addons->{$class_name}->get_main_plugin_file_basename(),
801
-				array( EE_Registry::instance()->addons->{$class_name}, 'deactivation' )
800
+				'deactivate_'.EE_Registry::instance()->addons->{$class_name}->get_main_plugin_file_basename(),
801
+				array(EE_Registry::instance()->addons->{$class_name}, 'deactivation')
802 802
 			);
803 803
 			remove_action(
804 804
 				'AHEE__EE_System__perform_activations_upgrades_and_migrations',
805
-				array( EE_Registry::instance()->addons->{$class_name}, 'initialize_db_if_no_migrations_required' )
805
+				array(EE_Registry::instance()->addons->{$class_name}, 'initialize_db_if_no_migrations_required')
806 806
 			);
807
-			unset( EE_Registry::instance()->addons->{$class_name}, self::$_settings[ $addon_name ] );
807
+			unset(EE_Registry::instance()->addons->{$class_name}, self::$_settings[$addon_name]);
808 808
 		}
809 809
 	}
810 810
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Recipient_Details_Shortcodes.lib.php 1 patch
Spacing   +66 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -37,24 +37,24 @@  discard block
 block discarded – undo
37 37
 
38 38
 
39 39
 	protected function _init_props() {
40
-		$this->label = esc_html__( 'Recipient Details Shortcodes', 'event_espresso' );
41
-		$this->description = esc_html__( 'All shortcodes specific to recipient registration data', 'event_espresso' );
40
+		$this->label = esc_html__('Recipient Details Shortcodes', 'event_espresso');
41
+		$this->description = esc_html__('All shortcodes specific to recipient registration data', 'event_espresso');
42 42
 		$this->_shortcodes = array(
43
-			'[RECIPIENT_FNAME]' => esc_html__( 'Parses to the first name of the recipient for the message.', 'event_espresso' ),
44
-			'[RECIPIENT_LNAME]' => esc_html__( 'Parses to the last name of the recipient for the message.', 'event_espresso' ),
45
-			'[RECIPIENT_EMAIL]' => esc_html__( 'Parses to the email address of the recipient for the message.', 'event_espresso' ),
46
-			'[RECIPIENT_REGISTRATION_ID]' => esc_html__( 'Parses to the registration ID of the recipient for the message.', 'event_espresso' ),
47
-			'[RECIPIENT_REGISTRATION_CODE]' => esc_html__( 'Parses to the registration code of the recipient for the message.', 'event_espresso' ),
48
-			'[RECIPIENT_EDIT_REGISTRATION_LINK]' => esc_html__( 'Parses to a link for frontend editing of the registration for the recipient.', 'event_espresso' ),
49
-			'[RECIPIENT_PHONE_NUMBER]' => esc_html__( 'The Phone Number for the recipient of the message.', 'event_espresso' ),
50
-			'[RECIPIENT_ADDRESS]' => esc_html__( 'The Address for the recipient of the message.', 'event_espresso' ),
51
-			'[RECIPIENT_ADDRESS2]' => esc_html__( 'Whatever was in the address 2 field for the recipient of the message.', 'event_espresso' ),
52
-			'[RECIPIENT_CITY]' => esc_html__( 'The city for the recipient of the message.', 'event_espresso' ),
53
-			'[RECIPIENT_ZIP_PC]' => esc_html__( 'The ZIP (or Postal) Code for the recipient of the message.', 'event_espresso' ),
54
-			'[RECIPIENT_ADDRESS_STATE]' => esc_html__( 'The state/province for the recipient of the message.', 'event_espresso' ),
55
-			'[RECIPIENT_COUNTRY]' => esc_html__( 'The country for the recipient of the message.', 'event_espresso' ),
56
-			'[RECIPIENT_ANSWER_*]' => esc_html__( 'This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso' ),
57
-			'[RECIPIENT_TOTAL_AMOUNT_PAID]' => esc_html__( 'If a single registration related to the recipient is available, that is used to retrieve the total amount that has been paid for this recipient.  Otherwise the value of 0 is printed.', 'event_espresso' )
43
+			'[RECIPIENT_FNAME]' => esc_html__('Parses to the first name of the recipient for the message.', 'event_espresso'),
44
+			'[RECIPIENT_LNAME]' => esc_html__('Parses to the last name of the recipient for the message.', 'event_espresso'),
45
+			'[RECIPIENT_EMAIL]' => esc_html__('Parses to the email address of the recipient for the message.', 'event_espresso'),
46
+			'[RECIPIENT_REGISTRATION_ID]' => esc_html__('Parses to the registration ID of the recipient for the message.', 'event_espresso'),
47
+			'[RECIPIENT_REGISTRATION_CODE]' => esc_html__('Parses to the registration code of the recipient for the message.', 'event_espresso'),
48
+			'[RECIPIENT_EDIT_REGISTRATION_LINK]' => esc_html__('Parses to a link for frontend editing of the registration for the recipient.', 'event_espresso'),
49
+			'[RECIPIENT_PHONE_NUMBER]' => esc_html__('The Phone Number for the recipient of the message.', 'event_espresso'),
50
+			'[RECIPIENT_ADDRESS]' => esc_html__('The Address for the recipient of the message.', 'event_espresso'),
51
+			'[RECIPIENT_ADDRESS2]' => esc_html__('Whatever was in the address 2 field for the recipient of the message.', 'event_espresso'),
52
+			'[RECIPIENT_CITY]' => esc_html__('The city for the recipient of the message.', 'event_espresso'),
53
+			'[RECIPIENT_ZIP_PC]' => esc_html__('The ZIP (or Postal) Code for the recipient of the message.', 'event_espresso'),
54
+			'[RECIPIENT_ADDRESS_STATE]' => esc_html__('The state/province for the recipient of the message.', 'event_espresso'),
55
+			'[RECIPIENT_COUNTRY]' => esc_html__('The country for the recipient of the message.', 'event_espresso'),
56
+			'[RECIPIENT_ANSWER_*]' => esc_html__('This is a special dynamic shortcode.  After the "*", add the exact text of an existing question, and if there is an answer for that question for this recipient, then it will be output in place of this shortcode.', 'event_espresso'),
57
+			'[RECIPIENT_TOTAL_AMOUNT_PAID]' => esc_html__('If a single registration related to the recipient is available, that is used to retrieve the total amount that has been paid for this recipient.  Otherwise the value of 0 is printed.', 'event_espresso')
58 58
 			);
59 59
 	}
60 60
 
@@ -65,36 +65,35 @@  discard block
 block discarded – undo
65 65
 	 * @param  string $shortcode the shortcode to be parsed.
66 66
 	 * @return string parsed shortcode
67 67
 	 */
68
-	protected function _parser( $shortcode ) {
68
+	protected function _parser($shortcode) {
69 69
 
70 70
 		//make sure we end up with a copy of the EE_Messages_Addressee object
71 71
 		$this->_recipient = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
72 72
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee
73
-		                    && is_array( $this->_data )
74
-		                    && isset( $this->_data['data'] )
73
+		                    && is_array($this->_data)
74
+		                    && isset($this->_data['data'])
75 75
 		                    && $this->_data['data'] instanceof EE_Messages_Addressee
76
-			? $this->_data['data'] :
77
-			$this->_recipient;
76
+			? $this->_data['data'] : $this->_recipient;
78 77
 		$this->_recipient = ! $this->_recipient instanceof EE_Messages_Addressee
79
-		                    && ! empty( $this->_extra_data['data'] )
78
+		                    && ! empty($this->_extra_data['data'])
80 79
 		                    && $this->_extra_data['data'] instanceof EE_Messages_Addressee
81 80
 			? $this->_extra_data['data']
82 81
 			: $this->_recipient;
83 82
 
84
-		if ( ! $this->_recipient instanceof EE_Messages_Addressee ) {
83
+		if ( ! $this->_recipient instanceof EE_Messages_Addressee) {
85 84
 			return '';
86 85
 		}
87 86
 
88 87
 		$attendee = $this->_recipient->att_obj;
89
-		if ( ! $attendee instanceof EE_Attendee ) {
88
+		if ( ! $attendee instanceof EE_Attendee) {
90 89
 			return '';
91 90
 		}
92 91
 
93
-		$this->_registrations_for_recipient = isset( $this->_recipient->attendees[ $attendee->ID() ]['reg_objs'] )
94
-			? $this->_recipient->attendees[ $attendee->ID() ]['reg_objs']
92
+		$this->_registrations_for_recipient = isset($this->_recipient->attendees[$attendee->ID()]['reg_objs'])
93
+			? $this->_recipient->attendees[$attendee->ID()]['reg_objs']
95 94
 			: array();
96 95
 
97
-		switch ( $shortcode ) {
96
+		switch ($shortcode) {
98 97
 			case '[RECIPIENT_FNAME]' :
99 98
 				return $attendee->fname();
100 99
 				break;
@@ -108,21 +107,21 @@  discard block
 block discarded – undo
108 107
 				break;
109 108
 
110 109
 			case '[RECIPIENT_REGISTRATION_ID]' :
111
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
110
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
112 111
 					return '';
113 112
 				}
114 113
 				return $this->_get_reg_id();
115 114
 				break;
116 115
 
117 116
 			case '[RECIPIENT_REGISTRATION_CODE]' :
118
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
117
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
119 118
 					return '';
120 119
 				}
121 120
 				return $this->_get_reg_code();
122 121
 				break;
123 122
 
124 123
 			case '[RECIPIENT_EDIT_REGISTRATION_LINK]' :
125
-				if ( ! $this->_recipient->reg_obj instanceof EE_Registration ) {
124
+				if ( ! $this->_recipient->reg_obj instanceof EE_Registration) {
126 125
 					return '';
127 126
 				}
128 127
 				return $this->_recipient->reg_obj->edit_attendee_information_url();
@@ -164,23 +163,23 @@  discard block
 block discarded – undo
164 163
 				break;
165 164
 		}
166 165
 
167
-		if ( strpos( $shortcode, '[RECIPIENT_ANSWER_*' ) !== false ) {
168
-			$shortcode = str_replace( '[RECIPIENT_ANSWER_*', '', $shortcode );
169
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
166
+		if (strpos($shortcode, '[RECIPIENT_ANSWER_*') !== false) {
167
+			$shortcode = str_replace('[RECIPIENT_ANSWER_*', '', $shortcode);
168
+			$shortcode = trim(str_replace(']', '', $shortcode));
170 169
 
171 170
 
172 171
 			//now let's figure out what question has this text
173
-			if ( empty( $this->_recipient->questions ) || ! $this->_recipient->reg_obj instanceof EE_Registration ) {
172
+			if (empty($this->_recipient->questions) || ! $this->_recipient->reg_obj instanceof EE_Registration) {
174 173
 				return '';
175 174
 			}
176 175
 
177
-			foreach ( $this->_recipient->questions as $ansid => $question ) {
176
+			foreach ($this->_recipient->questions as $ansid => $question) {
178 177
 				if (
179 178
 					$question instanceof EE_Question
180
-					&& trim( $question->display_text() ) == trim( $shortcode )
181
-					&& isset( $this->_recipient->registrations[ $this->_recipient->reg_obj->ID() ]['ans_objs'][ $ansid ] )
179
+					&& trim($question->display_text()) == trim($shortcode)
180
+					&& isset($this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid])
182 181
 				) {
183
-					return $this->_recipient->registrations[ $this->_recipient->reg_obj->ID() ]['ans_objs'][ $ansid ]->get_pretty( 'ANS_value', 'no_wpautop' );
182
+					return $this->_recipient->registrations[$this->_recipient->reg_obj->ID()]['ans_objs'][$ansid]->get_pretty('ANS_value', 'no_wpautop');
184 183
 				}
185 184
 			}
186 185
 		}
@@ -211,53 +210,53 @@  discard block
 block discarded – undo
211 210
 	protected function _get_reg_code() {
212 211
 
213 212
 		//if only one related registration for the recipient then just return that reg code.
214
-		if ( count( $this->_registrations_for_recipient ) <= 1 )  {
213
+		if (count($this->_registrations_for_recipient) <= 1) {
215 214
 			return $this->_recipient->reg_obj->reg_code();
216 215
 		}
217 216
 
218 217
 		//k more than one registration so let's see if we can get specific to context
219 218
 		//are we parsing event_list?
220
-		if ( $this->_data instanceof EE_Event ) {
219
+		if ($this->_data instanceof EE_Event) {
221 220
 			$reg_code = array();
222 221
 			//loop through registrations for recipient and see if there is a match for this event
223
-			foreach ( $this->_registrations_for_recipient as $reg ) {
224
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID() ) {
222
+			foreach ($this->_registrations_for_recipient as $reg) {
223
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID()) {
225 224
 					$reg_code[] = $reg->reg_code();
226 225
 				}
227 226
 			}
228
-			return implode( ', ', $reg_code );
227
+			return implode(', ', $reg_code);
229 228
 		}
230 229
 
231 230
 		//are we parsing ticket list?
232
-		if ( $this->_data instanceof EE_Ticket ) {
231
+		if ($this->_data instanceof EE_Ticket) {
233 232
 			$reg_code = array();
234 233
 			//loop through each registration for recipient and see if there is a match for this ticket
235
-			foreach ( $this->_registrations_for_recipient as $reg ) {
236
-				if ( $reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID() ) {
234
+			foreach ($this->_registrations_for_recipient as $reg) {
235
+				if ($reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID()) {
237 236
 					$reg_code = $reg->reg_code();
238 237
 				}
239 238
 			}
240
-			return implode( ', ', $reg_code );
239
+			return implode(', ', $reg_code);
241 240
 		}
242 241
 
243 242
 		//do we have a specific reg_obj?  Let's use it
244
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
243
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
245 244
 			return $this->_data->reg_obj->reg_code();
246 245
 		}
247 246
 
248 247
 		//do we have a specific reg_obj?  Let's use it
249
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
248
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
250 249
 			return $this->_data->reg_obj->reg_code();
251 250
 		}
252 251
 
253 252
 		//not able to determine the single reg code so let's return a comma delimited list of reg codes.
254 253
 		$reg_code = array();
255
-		foreach ( $this->_registrations_for_recipient as $reg ) {
256
-			if ( $reg instanceof EE_Registration ) {
254
+		foreach ($this->_registrations_for_recipient as $reg) {
255
+			if ($reg instanceof EE_Registration) {
257 256
 				$reg_code[] = $reg->reg_code();
258 257
 			}
259 258
 		}
260
-		return implode( ', ', $reg_code );
259
+		return implode(', ', $reg_code);
261 260
 	}
262 261
 
263 262
 
@@ -270,48 +269,48 @@  discard block
 block discarded – undo
270 269
 	protected function _get_reg_id() {
271 270
 
272 271
 		//if only one related registration for the recipient then just return that reg code.
273
-		if ( count( $this->_registrations_for_recipient ) <= 1 )  {
272
+		if (count($this->_registrations_for_recipient) <= 1) {
274 273
 			return $this->_recipient->reg_obj->ID();
275 274
 		}
276 275
 
277 276
 		//k more than one registration so let's see if we can get specific to context
278 277
 		//are we parsing event_list?
279
-		if ( $this->_data instanceof EE_Event ) {
278
+		if ($this->_data instanceof EE_Event) {
280 279
 			$registration_ids = array();
281 280
 			//loop through registrations for recipient and see if there is a match for this event
282
-			foreach ( $this->_registrations_for_recipient as $reg ) {
283
-				if ( $reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID() ) {
281
+			foreach ($this->_registrations_for_recipient as $reg) {
282
+				if ($reg instanceof EE_Registration && $reg->event_ID() == $this->_data->ID()) {
284 283
 					$registration_ids[] = $reg->ID();
285 284
 				}
286 285
 			}
287
-			return implode( ', ', $registration_ids );
286
+			return implode(', ', $registration_ids);
288 287
 		}
289 288
 
290 289
 		//are we parsing ticket list?
291
-		if ( $this->_data instanceof EE_Ticket ) {
290
+		if ($this->_data instanceof EE_Ticket) {
292 291
 			$registration_ids = array();
293 292
 			//loop through each registration for recipient and see if there is a match for this ticket
294
-			foreach ( $this->_registrations_for_recipient as $reg ) {
295
-				if ( $reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID() ) {
293
+			foreach ($this->_registrations_for_recipient as $reg) {
294
+				if ($reg instanceof EE_Registration && $reg->ticket_ID() == $this->_data->ID()) {
296 295
 					$registration_ids = $reg->ID();
297 296
 				}
298 297
 			}
299
-			return implode( ', ', $registration_ids );
298
+			return implode(', ', $registration_ids);
300 299
 		}
301 300
 
302 301
 		//do we have a specific reg_obj?  Let's use it
303
-		if ( $this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration ) {
302
+		if ($this->_data instanceof EE_Messages_Addressee && $this->_data->reg_obj instanceof EE_Registration) {
304 303
 			return $this->_data->reg_obj->ID();
305 304
 		}
306 305
 
307 306
 		//not able to determine the single reg code so let's return a comma delimited list of reg codes.
308 307
 		$registration_ids = array();
309
-		foreach ( $this->_registrations_for_recipient as $reg ) {
310
-			if ( $reg instanceof EE_Registration ) {
308
+		foreach ($this->_registrations_for_recipient as $reg) {
309
+			if ($reg instanceof EE_Registration) {
311 310
 				$registration_ids[] = $reg->ID();
312 311
 			}
313 312
 		}
314
-		return implode( ', ', $registration_ids );
313
+		return implode(', ', $registration_ids);
315 314
 	}
316 315
 
317 316
 
Please login to merge, or discard this patch.
admin/extend/transactions/Extend_Transactions_Admin_Page.core.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 * @param bool $routing
43 43
 	 * @return \Extend_Transactions_Admin_Page
44 44
 	 */
45
-	public function __construct( $routing = TRUE ) {
46
-		parent::__construct( $routing );
47
-		define( 'TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/');
48
-		define( 'TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/');
49
-		define( 'TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/');
45
+	public function __construct($routing = TRUE) {
46
+		parent::__construct($routing);
47
+		define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'transactions/templates/');
48
+		define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'transactions/assets/');
49
+		define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'transactions/assets/');
50 50
 	}
51 51
 
52 52
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @return void
59 59
 	 */
60 60
 	protected function _extend_page_config() {
61
-		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions';
61
+		$this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'transactions';
62 62
 
63 63
 		$new_page_routes = array(
64 64
 			'reports' => array(
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			)
68 68
 		);
69 69
 
70
-		$this->_page_routes = array_merge( $this->_page_routes, $new_page_routes );
70
+		$this->_page_routes = array_merge($this->_page_routes, $new_page_routes);
71 71
 
72 72
 		$new_page_config = array(
73 73
 			'reports' => array(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 				'require_nonce' => FALSE
86 86
 			)
87 87
 		);
88
-		$this->_page_config = array_merge( $this->_page_config, $new_page_config );
88
+		$this->_page_config = array_merge($this->_page_config, $new_page_config);
89 89
 	}
90 90
 
91 91
 
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 	 * @return void
98 98
 	 */
99 99
 	public function load_scripts_styles_reports() {
100
-		wp_register_script( 'ee-txn-reports-js', TXN_CAF_ASSETS_URL . 'ee-transaction-admin-reports.js', array( 'google-charts' ), EVENT_ESPRESSO_VERSION, true );
101
-		wp_enqueue_script( 'ee-txn-reports-js' );
100
+		wp_register_script('ee-txn-reports-js', TXN_CAF_ASSETS_URL.'ee-transaction-admin-reports.js', array('google-charts'), EVENT_ESPRESSO_VERSION, true);
101
+		wp_enqueue_script('ee-txn-reports-js');
102 102
 		$this->_transaction_reports_js_setup();
103 103
 		EE_Registry::$i18n_js_strings['currency_format'] = EEH_Money::get_format_for_google_charts();
104 104
 	}
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	* @return void
126 126
 	*/
127 127
 	protected function _transaction_reports() {
128
-		$template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php';
128
+		$template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php';
129 129
 		$this->_admin_page_title = __('Transactions', 'event_espresso');
130
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, TRUE );
130
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_reports_template_data, TRUE);
131 131
 
132 132
 		// the final template wrapper
133 133
 		$this->display_admin_page_with_no_sidebar();
@@ -142,40 +142,40 @@  discard block
 block discarded – undo
142 142
 	 * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated.
143 143
 	 * @return string
144 144
 	 */
145
-	private function _revenue_per_day_report( $period = '-1 month' ) {
145
+	private function _revenue_per_day_report($period = '-1 month') {
146 146
 
147 147
 		$report_ID = 'txn-admin-revenue-per-day-report-dv';
148 148
 
149 149
 		$TXN = EEM_Transaction::instance();
150 150
 
151
-		$results = $TXN->get_revenue_per_day_report( $period );
151
+		$results = $TXN->get_revenue_per_day_report($period);
152 152
 		$results = (array) $results;
153 153
 		$revenue = array();
154 154
 		$subtitle = '';
155 155
 
156
-		if ( $results ) {
157
-			$revenue[] = array( __( 'Date (only shows dates that have a revenue greater than 1)', 'event_espresso' ), __( 'Total Revenue', 'event_espresso' ) );
158
-			foreach ( $results as $result ) {
159
-				$revenue[] = array( $result->txnDate, (float) $result->revenue );
156
+		if ($results) {
157
+			$revenue[] = array(__('Date (only shows dates that have a revenue greater than 1)', 'event_espresso'), __('Total Revenue', 'event_espresso'));
158
+			foreach ($results as $result) {
159
+				$revenue[] = array($result->txnDate, (float) $result->revenue);
160 160
 			}
161 161
 
162 162
 			//setup the date range.
163
-			$beginning_date = new DateTime( 'now' . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
164
-			$ending_date = new DateTime( 'now', new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
165
-			$subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) );
163
+			$beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
164
+			$ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
165
+			$subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d'));
166 166
 		}
167 167
 
168
-		$report_title = esc_html__( 'Total Revenue per Day', 'event_espresso' );
168
+		$report_title = esc_html__('Total Revenue per Day', 'event_espresso');
169 169
 
170 170
 		$report_params = array(
171 171
 			'title' 		=> $report_title,
172 172
 			'subtitle' => $subtitle,
173 173
 			'id' => $report_ID,
174 174
 			'revenue' => $revenue,
175
-			'noResults' => empty( $revenue ) || count( $revenue ) === 1,
176
-			'noTxnMsg'	=> sprintf( __( '%sThere is no revenue to report for the last 30 days.%s', 'event_espresso' ), '<h2>' . $report_title . '</h2><p>', '</p>' )
175
+			'noResults' => empty($revenue) || count($revenue) === 1,
176
+			'noTxnMsg'	=> sprintf(__('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>')
177 177
 		);
178
-		wp_localize_script( 'ee-txn-reports-js', 'txnRevPerDay', $report_params );
178
+		wp_localize_script('ee-txn-reports-js', 'txnRevPerDay', $report_params);
179 179
 
180 180
 		return $report_ID;
181 181
 	}
@@ -189,43 +189,43 @@  discard block
 block discarded – undo
189 189
 	 * @param string $period  The period (acceptable by PHP Datetime constructor) for which the report is generated.
190 190
 	 * @return int
191 191
 	 */
192
-	private function _revenue_per_event_report( $period = '-1 month' ) {
192
+	private function _revenue_per_event_report($period = '-1 month') {
193 193
 
194 194
 		$report_ID = 'txn-admin-revenue-per-event-report-dv';
195 195
 
196 196
 		$TXN = EEM_Transaction::instance();
197
-		$results = $TXN->get_revenue_per_event_report( $period );
197
+		$results = $TXN->get_revenue_per_event_report($period);
198 198
 		$results = (array) $results;
199 199
 		$revenue = array();
200 200
 		$subtitle = '';
201 201
 
202
-		if ( $results ) {
203
-			$revenue[] = array( __( 'Event (only events that have a revenue greater than 1 are shown)', 'event_espresso' ), __( 'Total Revenue', 'event_espresso' ) );
204
-			foreach ( $results as $result ) {
205
-				if ( $result->revenue > 1 ) {
206
-					$event_name = stripslashes( html_entity_decode( $result->event_name, ENT_QUOTES, 'UTF-8' ) );
207
-					$event_name = wp_trim_words( $event_name, 5, '...' );
208
-					$revenue[]  = array( $event_name, (float) $result->revenue );
202
+		if ($results) {
203
+			$revenue[] = array(__('Event (only events that have a revenue greater than 1 are shown)', 'event_espresso'), __('Total Revenue', 'event_espresso'));
204
+			foreach ($results as $result) {
205
+				if ($result->revenue > 1) {
206
+					$event_name = stripslashes(html_entity_decode($result->event_name, ENT_QUOTES, 'UTF-8'));
207
+					$event_name = wp_trim_words($event_name, 5, '...');
208
+					$revenue[]  = array($event_name, (float) $result->revenue);
209 209
 				}
210 210
 			}
211 211
 
212 212
 			//setup the date range.
213
-			$beginning_date = new DateTime( 'now' . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
214
-			$ending_date = new DateTime( 'now', new DateTimeZone( EEH_DTT_Helper::get_timezone() ) );
215
-			$subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) );
213
+			$beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone()));
214
+			$ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone()));
215
+			$subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d'));
216 216
 		}
217 217
 
218
-		$report_title = esc_html__( 'Total Revenue per Event', 'event_espresso' );
218
+		$report_title = esc_html__('Total Revenue per Event', 'event_espresso');
219 219
 
220 220
 		$report_params = array(
221 221
 			'title' 		=> $report_title,
222 222
 			'subtitle' => $subtitle,
223 223
 			'id' 			=> $report_ID,
224 224
 			'revenue' => $revenue,
225
-			'noResults' => empty( $revenue ),
226
-			'noTxnMsg'	=> sprintf( __( '%sThere is no revenue to report for the last 30 days.%s', 'event_espresso' ), '<h2>' . $report_title . '</h2><p>', '</p>' )
225
+			'noResults' => empty($revenue),
226
+			'noTxnMsg'	=> sprintf(__('%sThere is no revenue to report for the last 30 days.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>')
227 227
 		);
228
-		wp_localize_script( 'ee-txn-reports-js', 'txnRevPerEvent', $report_params );
228
+		wp_localize_script('ee-txn-reports-js', 'txnRevPerEvent', $report_params);
229 229
 
230 230
 		return $report_ID;
231 231
 	}
Please login to merge, or discard this patch.