Completed
Branch FET-9593-collection-loader-man... (8bd595)
by
unknown
328:26 queued 314:10
created
modules/event_single/EED_Event_Single.module.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @return EED_Event_Single
41 41
 	 */
42 42
 	public static function instance() {
43
-		return parent::get_instance( __CLASS__ );
43
+		return parent::get_instance(__CLASS__);
44 44
 	}
45 45
 
46 46
 
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	 *  @return 	void
53 53
 	 */
54 54
 	public static function set_hooks() {
55
-		add_filter( 'FHEE_run_EE_wp', '__return_true' );
56
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
57
-		EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' );
55
+		add_filter('FHEE_run_EE_wp', '__return_true');
56
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
57
+		EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run');
58 58
 	}
59 59
 
60 60
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *  @return 	void
65 65
 	 */
66 66
 	public static function set_hooks_admin() {
67
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
67
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
68 68
 	}
69 69
 
70 70
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	 * @return void
79 79
 	 */
80 80
 	public static function set_definitions() {
81
-		define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
82
-		define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS );
81
+		define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
82
+		define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS);
83 83
 	}
84 84
 
85 85
 
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @void
91 91
 	 */
92
-	protected function set_config(){
93
-		$this->set_config_section( 'template_settings' );
94
-		$this->set_config_class( 'EE_Event_Single_Config' );
95
-		$this->set_config_name( 'EED_Event_Single' );
92
+	protected function set_config() {
93
+		$this->set_config_section('template_settings');
94
+		$this->set_config_class('EE_Event_Single_Config');
95
+		$this->set_config_name('EED_Event_Single');
96 96
 	}
97 97
 
98 98
 
@@ -105,35 +105,35 @@  discard block
 block discarded – undo
105 105
 	 * @param \EE_Event_Single_Config $config
106 106
 	 * @return \EE_Template_Part_Manager
107 107
 	 */
108
-	public function initialize_template_parts( EE_Event_Single_Config $config = null ) {
108
+	public function initialize_template_parts(EE_Event_Single_Config $config = null) {
109 109
 		$config = $config instanceof EE_Event_Single_Config ? $config : $this->config();
110 110
 		EEH_Autoloader::instance()->register_template_part_autoloaders();
111 111
 		$template_parts = new EE_Template_Part_Manager();
112 112
 		$template_parts->add_template_part(
113 113
 			'tickets',
114
-			__( 'Ticket Selector', 'event_espresso' ),
114
+			__('Ticket Selector', 'event_espresso'),
115 115
 			'content-espresso_events-tickets.php',
116 116
 			$config->display_order_tickets
117 117
 		);
118 118
 		$template_parts->add_template_part(
119 119
 			'datetimes',
120
-			__( 'Dates and Times', 'event_espresso' ),
120
+			__('Dates and Times', 'event_espresso'),
121 121
 			'content-espresso_events-datetimes.php',
122 122
 			$config->display_order_datetimes
123 123
 		);
124 124
 		$template_parts->add_template_part(
125 125
 			'event',
126
-			__( 'Event Description', 'event_espresso' ),
126
+			__('Event Description', 'event_espresso'),
127 127
 			'content-espresso_events-details.php',
128 128
 			$config->display_order_event
129 129
 		);
130 130
 		$template_parts->add_template_part(
131 131
 			'venue',
132
-			__( 'Venue Information', 'event_espresso' ),
132
+			__('Venue Information', 'event_espresso'),
133 133
 			'content-espresso_events-venues.php',
134 134
 			$config->display_order_venue
135 135
 		);
136
-		do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts );
136
+		do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts);
137 137
 		return $template_parts;
138 138
 	}
139 139
 
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 	 * @param WP $WP
148 148
 	 * @return    void
149 149
 	 */
150
-	public function run( $WP ) {
150
+	public function run($WP) {
151 151
 		// ensure valid EE_Events_Single_Config() object exists
152 152
 		$this->set_config();
153 153
 		// check what template is loaded
154
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
155
-		add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
154
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
155
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
156 156
 		// load css
157
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
157
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
158 158
 	}
159 159
 
160 160
 
@@ -166,27 +166,27 @@  discard block
 block discarded – undo
166 166
 	 * @param 	string $template
167 167
 	 * @return 	string
168 168
 	 */
169
-	public function template_include( $template ) {
169
+	public function template_include($template) {
170 170
 		global $post;
171 171
 		/** @type EE_Event_Single_Config $config */
172 172
 		$config = $this->config();
173
-		if ( $config->display_status_banner_single ) {
174
-			add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 );
173
+		if ($config->display_status_banner_single) {
174
+			add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2);
175 175
 		}
176 176
 		// not a custom template?
177 177
 		if (
178
-			EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'single-espresso_events.php'
179
-			|| apply_filters( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE )
180
-			&& ! post_password_required( $post )
178
+			EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'single-espresso_events.php'
179
+			|| apply_filters('FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE)
180
+			&& ! post_password_required($post)
181 181
 		) {
182 182
 			EEH_Template::load_espresso_theme_functions();
183 183
 			// then add extra event data via hooks
184
-			add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' ));
185
-			add_filter( 'get_the_excerpt', array( 'EED_Event_Single', 'get_the_excerpt' ), 1, 1 );
186
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
187
-			add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' ));
184
+			add_action('loop_start', array('EED_Event_Single', 'loop_start'));
185
+			add_filter('get_the_excerpt', array('EED_Event_Single', 'get_the_excerpt'), 1, 1);
186
+			add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
187
+			add_action('loop_end', array('EED_Event_Single', 'loop_end'));
188 188
 			// don't display entry meta because the existing theme will take car of that
189
-			add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
189
+			add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
190 190
 		}
191 191
 		return $template;
192 192
 	}
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	 * @param 	array $wp_query_array an array containing the WP_Query object
201 201
 	 * @return 	void
202 202
 	 */
203
-	public static function loop_start( $wp_query_array ) {
203
+	public static function loop_start($wp_query_array) {
204 204
 		global $post;
205
-		do_action( 'AHEE_event_details_before_post', $post, $wp_query_array );
205
+		do_action('AHEE_event_details_before_post', $post, $wp_query_array);
206 206
 	}
207 207
 
208 208
 
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 	 * @param 	int 	$id
216 216
 	 * @return 	string
217 217
 	 */
218
-	public static function the_title( $title = '', $id = 0 ) {
218
+	public static function the_title($title = '', $id = 0) {
219 219
 		global $post;
220
-		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title :  $title;
220
+		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title;
221 221
 	}
222 222
 
223 223
 
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 	 * @param        string $excerpt
230 230
 	 * @return        string
231 231
 	 */
232
-	public static function get_the_excerpt( $excerpt = '' ) {
232
+	public static function get_the_excerpt($excerpt = '') {
233 233
 		EED_Event_Single::$using_get_the_excerpt = true;
234
-		add_filter( 'wp_trim_excerpt', array( 'EED_Event_Single', 'end_get_the_excerpt' ), 999, 1 );
234
+		add_filter('wp_trim_excerpt', array('EED_Event_Single', 'end_get_the_excerpt'), 999, 1);
235 235
 		return $excerpt;
236 236
 	}
237 237
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 * @param  string $text
245 245
 	 * @return string
246 246
 	 */
247
-	public static function end_get_the_excerpt( $text = '' ) {
247
+	public static function end_get_the_excerpt($text = '') {
248 248
 		EED_Event_Single::$using_get_the_excerpt = false;
249 249
 		return $text;
250 250
 	}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 * @param 	string 	$content
259 259
 	 * @return 	string
260 260
 	 */
261
-	public static function event_details( $content ) {
261
+	public static function event_details($content) {
262 262
 		global $post;
263 263
 		static $current_post_ID = 0;
264 264
 		if (
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 			// We want to allow those plugins to still do their thing and have access to our content, but depending on
274 274
 			// how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice,
275 275
 			// so the following allows this filter to be applied multiple times, but only once for real
276
-			$current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0;
277
-			if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) {
276
+			$current_post_ID = did_action('loop_start') ? $post->ID : 0;
277
+			if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) {
278 278
 				// we need to first remove this callback from being applied to the_content()
279 279
 				// (otherwise it will recurse and blow up the interweb)
280
-				remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
280
+				remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
281 281
 				EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts();
282
-				$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
283
-				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content );
284
-				add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
282
+				$content = EEH_Template::locate_template('content-espresso_events-details.php');
283
+				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content);
284
+				add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
285 285
 			} else {
286 286
 				$content = EED_Event_Single::use_filterable_display_order();
287 287
 			}
@@ -302,19 +302,19 @@  discard block
 block discarded – undo
302 302
 		// it uses the_content() for displaying the $post->post_content
303 303
 		// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
304 304
 		// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
305
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
305
+		remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
306 306
 		//now add additional content
307
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 );
308
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 );
309
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 );
310
-		do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' );
307
+		add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1);
308
+		add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1);
309
+		add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1);
310
+		do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters');
311 311
 		// now load our template
312
-		$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
312
+		$content = EEH_Template::locate_template('content-espresso_events-details.php');
313 313
 		//now add our filter back in, plus some others
314
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
315
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
316
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
317
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 );
314
+		add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
315
+		remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110);
316
+		remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120);
317
+		remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130);
318 318
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
319 319
 		return $content;
320 320
 	}
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * @param        string $content
329 329
 	 * @return        string
330 330
 	 */
331
-	public static function event_datetimes( $content ) {
332
-		return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content;
331
+	public static function event_datetimes($content) {
332
+		return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content;
333 333
 	}
334 334
 
335 335
 
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 	 * @param        string $content
342 342
 	 * @return        string
343 343
 	 */
344
-	public static function event_tickets( $content ) {
345
-		return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content;
344
+	public static function event_tickets($content) {
345
+		return EEH_Template::locate_template('content-espresso_events-tickets.php').$content;
346 346
 	}
347 347
 
348 348
 
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 	 * @param 	string $content
355 355
 	 * @return 	string
356 356
 	 */
357
-	public static function event_venue( $content ) {
358
-		return EED_Event_Single::event_venues( $content );
357
+	public static function event_venue($content) {
358
+		return EED_Event_Single::event_venues($content);
359 359
 	}
360 360
 
361 361
 
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 	 * @param        string $content
368 368
 	 * @return        string
369 369
 	 */
370
-	public static function event_venues( $content ) {
371
-		return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' );
370
+	public static function event_venues($content) {
371
+		return $content.EEH_Template::locate_template('content-espresso_events-venues.php');
372 372
 	}
373 373
 
374 374
 
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
 	 * 	@param		array 	$wp_query_array an array containing the WP_Query object
381 381
 	 *  	@return 		void
382 382
 	 */
383
-	public static function loop_end( $wp_query_array ) {
383
+	public static function loop_end($wp_query_array) {
384 384
 		global $post;
385
-		do_action( 'AHEE_event_details_after_post', $post, $wp_query_array );
385
+		do_action('AHEE_event_details_after_post', $post, $wp_query_array);
386 386
 	}
387 387
 
388 388
 
@@ -395,16 +395,16 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	public function wp_enqueue_scripts() {
397 397
 		// get some style
398
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) {
398
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) {
399 399
 			// first check uploads folder
400
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
401
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
400
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
401
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
402 402
 			} else {
403
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
403
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
404 404
 			}
405
-			wp_enqueue_script( $this->theme );
406
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
407
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
405
+			wp_enqueue_script($this->theme);
406
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
407
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
408 408
 			}
409 409
 		}
410 410
 	}
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
 	public static function display_venue() {
426 426
 		/** @type EE_Event_Single_Config $config */
427 427
 		$config = EED_Event_Single::instance()->config();
428
-		$display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE;
428
+		$display_venue = isset($config->display_venue) ? $config->display_venue : TRUE;
429 429
 		$venue_name = EEH_Venue_View::venue_name();
430
-		return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE;
430
+		return $display_venue && ! empty($venue_name) ? TRUE : FALSE;
431 431
 	}
432 432
 
433 433
 
Please login to merge, or discard this patch.
modules/ical/EED_Ical.module.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -220,8 +220,8 @@
 block discarded – undo
220 220
 			//Escape spcial chars within the decription
221 221
 			$description = EED_Ical::_escape_ICal_data( $description );
222 222
 
223
-		    //Remove line breaks and output in iCal format
224
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+			//Remove line breaks and output in iCal format
224
+			$description = str_replace( array( "\r\n", "\n"), '\n', $description );
225 225
 
226 226
 		return $description;
227 227
 	}
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @return EED_Ical
33 33
 	 */
34 34
 	public static function instance() {
35
-		return parent::get_instance( __CLASS__ );
35
+		return parent::get_instance(__CLASS__);
36 36
 	}
37 37
 
38 38
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function set_hooks() {
47 47
 		// create download buttons
48
-		add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 );
48
+		add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2);
49 49
 		 // process ics download request
50
-		EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' );
50
+		EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file');
51 51
 	}
52 52
 
53 53
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param    WP $WP
71 71
 	 * @return    void
72 72
 	 */
73
-	public function run( $WP ) {}
73
+	public function run($WP) {}
74 74
 
75 75
 
76 76
 
@@ -82,30 +82,30 @@  discard block
 block discarded – undo
82 82
 	 * @param $datetime
83 83
 	 * @return    string
84 84
 	 */
85
-	public static function generate_add_to_iCal_button( $html, $datetime ) {
85
+	public static function generate_add_to_iCal_button($html, $datetime) {
86 86
 		// first verify a proper datetime object has been received
87
-		if ( $datetime instanceof EE_Datetime ) {
87
+		if ($datetime instanceof EE_Datetime) {
88 88
 			// set whether a link or submit button is shown
89
-			$iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' );
89
+			$iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
90 90
 			// generate a link to the route we registered in set_hooks()
91
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() );
91
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
92 92
 			// what type ?
93
-			switch ( $iCal_type ) {
93
+			switch ($iCal_type) {
94 94
 				// submit buttons appear as buttons and are very compatible with a theme's style
95 95
 				case 'submit' :
96
-					$html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
97
-					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>';
96
+					$html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >';
97
+					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>';
98 98
 					$html .= '</form>';
99 99
 					break;
100 100
 				// buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
101 101
 				case 'button' :
102
-					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
102
+					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
103 103
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
104 104
 					$html .= '</a>';
105 105
 					break;
106 106
 				// links are just links that use the calendar dashicon
107 107
 				case 'icon' :
108
-					$html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
108
+					$html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
109 109
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
110 110
 					$html .= '</a>';
111 111
 					break;
@@ -123,72 +123,72 @@  discard block
 block discarded – undo
123 123
 	 *  @return 	void
124 124
 	 */
125 125
 	public static function download_ics_file() {
126
-		if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) {
127
-			$DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' ));
128
-			$datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID );
129
-			if ( $datetime instanceof EE_Datetime ) {
126
+		if (EE_Registry::instance()->REQ->is_set('ics_id')) {
127
+			$DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id'));
128
+			$datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID);
129
+			if ($datetime instanceof EE_Datetime) {
130 130
 				// get related event, venues, and event categories
131 131
 				$event = $datetime->event();
132 132
 				// get related category Term object and it's name
133 133
 				$category = $event->first_event_category();
134
-				if ( $category instanceof EE_Term ) {
134
+				if ($category instanceof EE_Term) {
135 135
 					$category = $category->name();
136 136
 				}
137 137
 				$location = '';
138 138
 				// get first related venue and convert to CSV string
139
-				$venue = $event->venues(array( 'limit'=>1 ));
140
-				if ( is_array( $venue ) && ! empty( $venue )) {
141
-					$venue = array_shift( $venue );
142
-					if ( $venue instanceof EE_Venue ) {
143
-						$location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE );
139
+				$venue = $event->venues(array('limit'=>1));
140
+				if (is_array($venue) && ! empty($venue)) {
141
+					$venue = array_shift($venue);
142
+					if ($venue instanceof EE_Venue) {
143
+						$location = espresso_venue_raw_address('inline', $venue->ID(), FALSE);
144 144
 					}
145 145
 				}
146 146
 				// set variables, escape strings, convert timestamps to ics format, etc
147
-				$filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics';
148
-				$organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name );
149
-				$UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() ));
150
-				$org_email = EED_Ical::_escape_ICal_data( $datetime->ID() );
151
-				$timestamp = date( EED_Ical::iCal_datetime_format );
152
-				$location = EED_Ical::_escape_ICal_data( $location );
153
-				$summary = EED_Ical::_escape_ICal_data( $event->name() );
154
-				$description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() ));
147
+				$filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics';
148
+				$organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name);
149
+				$UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID()));
150
+				$org_email = EED_Ical::_escape_ICal_data($datetime->ID());
151
+				$timestamp = date(EED_Ical::iCal_datetime_format);
152
+				$location = EED_Ical::_escape_ICal_data($location);
153
+				$summary = EED_Ical::_escape_ICal_data($event->name());
154
+				$description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description()));
155 155
 				$status = $datetime->get_active_status();
156 156
 				$status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed';
157
-				$status = EED_Ical::_escape_ICal_data( $status );
158
-				$categories = EED_Ical::_escape_ICal_data( $category );
159
-				$url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() ));
160
-				$dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() ));
161
-				$dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() ));
157
+				$status = EED_Ical::_escape_ICal_data($status);
158
+				$categories = EED_Ical::_escape_ICal_data($category);
159
+				$url = EED_Ical::_escape_ICal_data(get_permalink($event->ID()));
160
+				$dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start()));
161
+				$dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end()));
162 162
 				// set headers
163
-				header( 'Content-type: text/calendar; charset=utf-8' );
164
-				header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
165
-				header( 'Cache-Control: private, max-age=0, must-revalidate' );
166
-				header( 'Pragma: public' );
167
-				header( 'Content-Type: application/octet-stream' );
168
-				header( 'Content-Type: application/force-download' );
169
-				header( 'Cache-Control: no-cache, must-revalidate' );
170
-				header( 'Content-Transfer-Encoding: binary' );
171
-				header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date
172
-				ini_set( 'zlib.output_compression', '0' );
163
+				header('Content-type: text/calendar; charset=utf-8');
164
+				header('Content-Disposition: attachment; filename="'.$filename.'"');
165
+				header('Cache-Control: private, max-age=0, must-revalidate');
166
+				header('Pragma: public');
167
+				header('Content-Type: application/octet-stream');
168
+				header('Content-Type: application/force-download');
169
+				header('Cache-Control: no-cache, must-revalidate');
170
+				header('Content-Transfer-Encoding: binary');
171
+				header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date
172
+				ini_set('zlib.output_compression', '0');
173 173
 				// echo the output
174
-				echo "BEGIN:VCALENDAR" . PHP_EOL;
175
-				echo "VERSION:2.0" . PHP_EOL;
176
-				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL;
177
-				echo "CALSCALE:GREGORIAN" . PHP_EOL;
178
-				echo "BEGIN:VEVENT" . PHP_EOL;
179
-				echo "UID:{$UID}" . PHP_EOL;
180
-				echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL;
181
-				echo "DTSTAMP:{$timestamp}" . PHP_EOL;
182
-				echo "LOCATION:{$location}" . PHP_EOL;
183
-				echo "SUMMARY:{$summary}" . PHP_EOL;
184
-				echo "DESCRIPTION:{$description}" . PHP_EOL;
185
-				echo "STATUS:{$status}" . PHP_EOL;
186
-				echo "CATEGORIES:{$categories}" . PHP_EOL;
187
-				echo "URL;VALUE=URI:{$url}" . PHP_EOL;
188
-				echo "DTSTART:{$dtt_start}" . PHP_EOL;
189
-				echo "DTEND:{$dtt_end}" . PHP_EOL;
190
-				echo "END:VEVENT" . PHP_EOL;
191
-				echo "END:VCALENDAR" . PHP_EOL;
174
+				echo "BEGIN:VCALENDAR".PHP_EOL;
175
+				echo "VERSION:2.0".PHP_EOL;
176
+				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL;
177
+				echo "CALSCALE:GREGORIAN".PHP_EOL;
178
+				echo "BEGIN:VEVENT".PHP_EOL;
179
+				echo "UID:{$UID}".PHP_EOL;
180
+				echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL;
181
+				echo "DTSTAMP:{$timestamp}".PHP_EOL;
182
+				echo "LOCATION:{$location}".PHP_EOL;
183
+				echo "SUMMARY:{$summary}".PHP_EOL;
184
+				echo "DESCRIPTION:{$description}".PHP_EOL;
185
+				echo "STATUS:{$status}".PHP_EOL;
186
+				echo "CATEGORIES:{$categories}".PHP_EOL;
187
+				echo "URL;VALUE=URI:{$url}".PHP_EOL;
188
+				echo "DTSTART:{$dtt_start}".PHP_EOL;
189
+				echo "DTEND:{$dtt_end}".PHP_EOL;
190
+				echo "END:VEVENT".PHP_EOL;
191
+				echo "END:VCALENDAR".PHP_EOL;
192 192
 			}
193 193
 		}
194 194
 		die();
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	 *  	@param	string $string
204 204
 	 *  	@return	string
205 205
 	 */
206
-	private static function _escape_ICal_data( $string = '' ) {
207
-		return preg_replace( '/([\,;])/', '\\\$1', $string );
206
+	private static function _escape_ICal_data($string = '') {
207
+		return preg_replace('/([\,;])/', '\\\$1', $string);
208 208
 	}
209 209
 
210 210
 	/**
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 	 *  	@param	string $description
215 215
 	 *  	@return	string
216 216
 	 */
217
-	private static function _escape_ICal_description( $description = '' ) {
217
+	private static function _escape_ICal_description($description = '') {
218 218
 			
219 219
 			//Escape spcial chars within the decription
220
-			$description = EED_Ical::_escape_ICal_data( $description );
220
+			$description = EED_Ical::_escape_ICal_data($description);
221 221
 
222 222
 		    //Remove line breaks and output in iCal format
223
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+		    $description = str_replace(array("\r\n", "\n"), '\n', $description);
224 224
 
225 225
 		return $description;
226 226
 	}
Please login to merge, or discard this patch.
attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 4 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -808,7 +808,7 @@
 block discarded – undo
808 808
 
809 809
 				} // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) {
810 810
 
811
-			}  else {
811
+			} else {
812 812
 				EE_Error::add_error( __( 'An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
813 813
 				// remove malformed data
814 814
 				unset( $valid_data[ $reg_url_link ] );
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	 * _auto_copy_attendee_info
349 349
 	 *
350 350
 	 * @access public
351
-	 * @return 	EE_Form_Section_Proper
351
+	 * @return 	EE_Form_Section_HTML
352 352
 	 */
353 353
 	private function _auto_copy_attendee_info() {
354 354
 		return new EE_Form_Section_HTML(
@@ -462,6 +462,7 @@  discard block
 block discarded – undo
462 462
 	 * @param EE_Registration $registration
463 463
 	 * @param EE_Question     $question
464 464
 	 * @param mixed EE_Answer|NULL      $answer
465
+	 * @param EE_Answer $answer
465 466
 	 * @return EE_Form_Input_Base
466 467
 	 */
467 468
 	private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Reg_Step_Attendee_Information
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_Attendee_Information
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_SPCO_Reg_Step_Attendee_Information extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 				// generate hidden input
172 172
 				if (
173 173
 					isset( $subsections[ $primary_registrant ] )
174
-				     && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper
174
+					 && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper
175 175
 				) {
176 176
 					$subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false );
177 177
 				}
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 					if ( isset( $valid_data[ $reg_url_link ] ) ) {
903 903
 						// do we need to copy basic info from primary attendee ?
904 904
 						$copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] )
905
-						                && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0
905
+										&& absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0
906 906
 							? true
907 907
 							: false;
908 908
 						// filter form input data for this registration
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
 			? $form_input
1080 1080
 			: $form_input . '-' . $registration->reg_url_link();
1081 1081
 		$answer_is_obj = isset( $this->_registration_answers[ $answer_cache_id ] )
1082
-		                 && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer
1082
+						 && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer
1083 1083
 			? true
1084 1084
 			: false;
1085 1085
 		//rename form_inputs if they are EE_Attendee properties
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 		}
1320 1320
 		foreach ( $critical_attendee_details as $critical_attendee_detail ) {
1321 1321
 			if ( ! isset( $attendee_data[ $critical_attendee_detail ] )
1322
-			     || empty( $attendee_data[ $critical_attendee_detail ] )
1322
+				 || empty( $attendee_data[ $critical_attendee_detail ] )
1323 1323
 			) {
1324 1324
 				$attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get(
1325 1325
 					$critical_attendee_detail
Please login to merge, or discard this patch.
Spacing   +233 added lines, -234 removed lines patch added patch discarded remove patch
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
 	 * @param    EE_Checkout $checkout
43 43
 	 * @return    \EE_SPCO_Reg_Step_Attendee_Information
44 44
 	 */
45
-	public function __construct( EE_Checkout $checkout ) {
45
+	public function __construct(EE_Checkout $checkout) {
46 46
 		$this->_slug = 'attendee_information';
47 47
 		$this->_name = __('Attendee Information', 'event_espresso');
48
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_main.template.php';
48
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_main.template.php';
49 49
 		$this->checkout = $checkout;
50 50
 		$this->_reset_success_message();
51 51
 		$this->set_instructions(
52
-			__( 'Please answer the following registration questions before proceeding.', 'event_espresso' )
52
+			__('Please answer the following registration questions before proceeding.', 'event_espresso')
53 53
 		);
54 54
 	}
55 55
 
56 56
 
57 57
 
58 58
 	public function translate_js_strings() {
59
-		EE_Registry::$i18n_js_strings['required_field'] = __( ' is a required question.', 'event_espresso' );
59
+		EE_Registry::$i18n_js_strings['required_field'] = __(' is a required question.', 'event_espresso');
60 60
 		EE_Registry::$i18n_js_strings['required_multi_field'] = __(
61 61
 			' is a required question. Please enter a value for at least one of the options.',
62 62
 			'event_espresso'
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		// calculate taxes
117 117
 		$Line_Item_Display->display_line_item(
118 118
 			$this->checkout->cart->get_grand_total(),
119
-			array( 'set_tax_rate' => true )
119
+			array('set_tax_rate' => true)
120 120
 		);
121 121
 		/** @var $subsections EE_Form_Section_Proper[] */
122 122
 		$subsections = array(
@@ -128,51 +128,51 @@  discard block
 block discarded – undo
128 128
 			'ticket_count' 	=> array()
129 129
 		);
130 130
 		// grab the saved registrations from the transaction
131
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
132
-		if ( $registrations ) {
133
-			foreach ( $registrations as $registration ) {
131
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
132
+		if ($registrations) {
133
+			foreach ($registrations as $registration) {
134 134
 				// can this registration be processed during this visit ?
135 135
 				if (
136 136
 					$registration instanceof EE_Registration
137
-					&& $this->checkout->visit_allows_processing_of_this_registration( $registration )
137
+					&& $this->checkout->visit_allows_processing_of_this_registration($registration)
138 138
 				) {
139
-					$subsections[ $registration->reg_url_link() ] = $this->_registrations_reg_form( $registration );
140
-					if ( ! $this->checkout->admin_request ) {
141
-						$template_args['registrations'][ $registration->reg_url_link() ] = $registration;
142
-						$template_args['ticket_count'][ $registration->ticket()->ID() ] = isset(
143
-							$template_args['ticket_count'][ $registration->ticket()->ID() ]
139
+					$subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration);
140
+					if ( ! $this->checkout->admin_request) {
141
+						$template_args['registrations'][$registration->reg_url_link()] = $registration;
142
+						$template_args['ticket_count'][$registration->ticket()->ID()] = isset(
143
+							$template_args['ticket_count'][$registration->ticket()->ID()]
144 144
 						)
145
-							? $template_args['ticket_count'][ $registration->ticket()->ID() ] + 1
145
+							? $template_args['ticket_count'][$registration->ticket()->ID()] + 1
146 146
 							: 1;
147 147
 						$ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs(
148 148
 							$this->checkout->cart->get_grand_total(),
149 149
 							'Ticket',
150
-							array( $registration->ticket()->ID() )
150
+							array($registration->ticket()->ID())
151 151
 						);
152
-						$ticket_line_item = is_array( $ticket_line_item )
153
-							? reset( $ticket_line_item )
152
+						$ticket_line_item = is_array($ticket_line_item)
153
+							? reset($ticket_line_item)
154 154
 							: $ticket_line_item;
155
-						$template_args['ticket_line_item'][ $registration->ticket()->ID() ] = $Line_Item_Display->display_line_item(
155
+						$template_args['ticket_line_item'][$registration->ticket()->ID()] = $Line_Item_Display->display_line_item(
156 156
 							$ticket_line_item
157 157
 						);
158 158
 					}
159
-					if ( $registration->is_primary_registrant() ) {
159
+					if ($registration->is_primary_registrant()) {
160 160
 						$primary_registrant = $registration->reg_url_link();
161 161
 					}
162 162
 				}
163 163
 			}
164 164
 			// print_copy_info ?
165
-			if ( $primary_registrant && ! $this->checkout->admin_request && count( $registrations ) > 1 ) {
165
+			if ($primary_registrant && ! $this->checkout->admin_request && count($registrations) > 1) {
166 166
 				// TODO: add admin option for toggling copy attendee info, then use that value to change $this->_print_copy_info
167 167
 				$copy_options['spco_copy_attendee_chk'] = $this->_print_copy_info
168 168
 					? $this->_copy_attendee_info_form()
169 169
 					: $this->_auto_copy_attendee_info();
170 170
 				// generate hidden input
171 171
 				if (
172
-					isset( $subsections[ $primary_registrant ] )
173
-				     && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper
172
+					isset($subsections[$primary_registrant])
173
+				     && $subsections[$primary_registrant] instanceof EE_Form_Section_Proper
174 174
 				) {
175
-					$subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false );
175
+					$subsections[$primary_registrant]->add_subsections($copy_options, 'primary_registrant', false);
176 176
 				}
177 177
 			}
178 178
 
@@ -184,8 +184,7 @@  discard block
 block discarded – undo
184 184
 				'html_id' 					=> $this->reg_form_name(),
185 185
 				'subsections' 			=> $subsections,
186 186
 				'layout_strategy'		=> $this->checkout->admin_request ?
187
-					new EE_Div_Per_Section_Layout() :
188
-					new EE_Template_Layout(
187
+					new EE_Div_Per_Section_Layout() : new EE_Template_Layout(
189 188
 						array(
190 189
 							'layout_template_file' 	=> $this->_template, // layout_template
191 190
 							'template_args' 				=> $template_args
@@ -203,11 +202,11 @@  discard block
 block discarded – undo
203 202
 	 * @return EE_Form_Section_Proper
204 203
 	 * @throws \EE_Error
205 204
 	 */
206
-	private function _registrations_reg_form( EE_Registration $registration ) {
205
+	private function _registrations_reg_form(EE_Registration $registration) {
207 206
 		static $attendee_nmbr = 1;
208 207
 		// array of params to pass to parent constructor
209 208
 		$form_args = array(
210
-			'html_id'         => 'ee-registration-' . $registration->reg_url_link(),
209
+			'html_id'         => 'ee-registration-'.$registration->reg_url_link(),
211 210
 			'html_class'      => 'ee-reg-form-attendee-dv',
212 211
 			'html_style'      => $this->checkout->admin_request
213 212
 				? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;'
@@ -216,24 +215,24 @@  discard block
 block discarded – undo
216 215
 			'layout_strategy' => new EE_Fieldset_Section_Layout(
217 216
 				array(
218 217
 					'legend_class' => 'spco-attendee-lgnd smaller-text lt-grey-text',
219
-					'legend_text'  => sprintf( __( 'Attendee %d', 'event_espresso' ), $attendee_nmbr )
218
+					'legend_text'  => sprintf(__('Attendee %d', 'event_espresso'), $attendee_nmbr)
220 219
 				)
221 220
 			)
222 221
 		);
223 222
 		// verify that registration has valid event
224
-		if ( $registration->event() instanceof EE_Event ) {
223
+		if ($registration->event() instanceof EE_Event) {
225 224
 			$query_params = array(
226 225
 				array(
227 226
 					'Event.EVT_ID' => $registration->event()->ID(),
228 227
 					'Event_Question_Group.EQG_primary' => $registration->count() === 1 ? true : false
229 228
 				),
230
-				'order_by'=>array( 'QSG_order'=>'ASC' )
229
+				'order_by'=>array('QSG_order'=>'ASC')
231 230
 			);
232
-			$question_groups = $registration->event()->question_groups( $query_params );
233
-			if ( $question_groups ) {
234
-				foreach ( $question_groups as $question_group ) {
235
-					if ( $question_group instanceof EE_Question_Group ) {
236
-						$form_args['subsections'][ $question_group->identifier() ] = $this->_question_group_reg_form(
231
+			$question_groups = $registration->event()->question_groups($query_params);
232
+			if ($question_groups) {
233
+				foreach ($question_groups as $question_group) {
234
+					if ($question_group instanceof EE_Question_Group) {
235
+						$form_args['subsections'][$question_group->identifier()] = $this->_question_group_reg_form(
237 236
 							$registration,
238 237
 							$question_group
239 238
 						);
@@ -246,10 +245,10 @@  discard block
 block discarded – undo
246 245
 				// if we have question groups for additional attendees, then display the copy options
247 246
 				$this->_print_copy_info = $attendee_nmbr > 1 ? true : $this->_print_copy_info;
248 247
 			} else {
249
-				$form_args['subsections'][ 'attendee_info_not_required_' . $registration->reg_url_link(
250
-				) ] = new EE_Form_Section_HTML(
248
+				$form_args['subsections']['attendee_info_not_required_'.$registration->reg_url_link(
249
+				)] = new EE_Form_Section_HTML(
251 250
 					EEH_Template::locate_template(
252
-						SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_not_required.template.php',
251
+						SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_not_required.template.php',
253 252
 						apply_filters(
254 253
 							'FHEE__EE_SPCO_Reg_Step_Attendee_Information___registrations_reg_form__attendee_info_not_required_template_args',
255 254
 							array()
@@ -265,12 +264,12 @@  discard block
 block discarded – undo
265 264
 				);
266 265
 			}
267 266
 		}
268
-		if ( $registration->is_primary_registrant() ) {
267
+		if ($registration->is_primary_registrant()) {
269 268
 			// generate hidden input
270
-			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs( $registration );
269
+			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs($registration);
271 270
 		}
272 271
 		$attendee_nmbr++;
273
-		return new EE_Form_Section_Proper( $form_args );
272
+		return new EE_Form_Section_Proper($form_args);
274 273
 	}
275 274
 
276 275
 
@@ -291,7 +290,7 @@  discard block
 block discarded – undo
291 290
 		// generate hidden input
292 291
 		return new EE_Hidden_Input(
293 292
 			array(
294
-				'html_id' => 'additional-attendee-reg-info-' . $registration->reg_url_link(),
293
+				'html_id' => 'additional-attendee-reg-info-'.$registration->reg_url_link(),
295 294
 				'default' => $additional_attendee_reg_info
296 295
 			)
297 296
 		);
@@ -305,26 +304,26 @@  discard block
 block discarded – undo
305 304
 	 * @return EE_Form_Section_Proper
306 305
 	 * @throws \EE_Error
307 306
 	 */
308
-	private function _question_group_reg_form( EE_Registration $registration, EE_Question_Group $question_group ){
307
+	private function _question_group_reg_form(EE_Registration $registration, EE_Question_Group $question_group) {
309 308
 		// array of params to pass to parent constructor
310 309
 		$form_args = array(
311
-			'html_id'         => 'ee-reg-form-qstn-grp-' . $question_group->identifier(),
310
+			'html_id'         => 'ee-reg-form-qstn-grp-'.$question_group->identifier(),
312 311
 			'html_class'      => $this->checkout->admin_request
313 312
 				? 'form-table ee-reg-form-qstn-grp-dv'
314 313
 				: 'ee-reg-form-qstn-grp-dv',
315
-			'html_label_id'   => 'ee-reg-form-qstn-grp-' . $question_group->identifier() . '-lbl',
314
+			'html_label_id'   => 'ee-reg-form-qstn-grp-'.$question_group->identifier().'-lbl',
316 315
 			'subsections'     => array(
317
-				'reg_form_qstn_grp_hdr' => $this->_question_group_header( $question_group )
316
+				'reg_form_qstn_grp_hdr' => $this->_question_group_header($question_group)
318 317
 			),
319 318
 			'layout_strategy' => $this->checkout->admin_request
320 319
 				? new EE_Admin_Two_Column_Layout()
321 320
 				: new EE_Div_Per_Section_Layout()
322 321
 		);
323 322
 		// where params
324
-		$query_params = array( 'QST_deleted' => 0 );
323
+		$query_params = array('QST_deleted' => 0);
325 324
 		// don't load admin only questions on the frontend
326
-		if ( ! $this->checkout->admin_request ) {
327
-			$query_params['QST_admin_only'] = array( '!=', true );
325
+		if ( ! $this->checkout->admin_request) {
326
+			$query_params['QST_admin_only'] = array('!=', true);
328 327
 		}
329 328
 		$questions = $question_group->get_many_related(
330 329
 			'Question',
@@ -346,10 +345,10 @@  discard block
 block discarded – undo
346 345
 			)
347 346
 		);
348 347
 		// loop thru questions
349
-		foreach ( $questions as $question ) {
350
-			if( $question instanceof EE_Question ){
348
+		foreach ($questions as $question) {
349
+			if ($question instanceof EE_Question) {
351 350
 				$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
352
-				$form_args['subsections'][ $identifier ] = $this->reg_form_question( $registration, $question );
351
+				$form_args['subsections'][$identifier] = $this->reg_form_question($registration, $question);
353 352
 			}
354 353
 		}
355 354
 		$form_args['subsections'] = apply_filters(
@@ -370,7 +369,7 @@  discard block
 block discarded – undo
370 369
 			)
371 370
 		);
372 371
 //		d( $form_args );
373
-		$question_group_reg_form = new EE_Form_Section_Proper( $form_args );
372
+		$question_group_reg_form = new EE_Form_Section_Proper($form_args);
374 373
 		return apply_filters(
375 374
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form',
376 375
 			$question_group_reg_form,
@@ -387,11 +386,11 @@  discard block
 block discarded – undo
387 386
 	 * @param EE_Question_Group $question_group
388 387
 	 * @return 	EE_Form_Section_HTML
389 388
 	 */
390
-	private function _question_group_header( EE_Question_Group $question_group ){
389
+	private function _question_group_header(EE_Question_Group $question_group) {
391 390
 		$html = '';
392 391
 		// group_name
393
-		if ( $question_group->show_group_name() && $question_group->name() !== '' ) {
394
-			if ( $this->checkout->admin_request ) {
392
+		if ($question_group->show_group_name() && $question_group->name() !== '') {
393
+			if ($this->checkout->admin_request) {
395 394
 				$html .= EEH_HTML::br();
396 395
 				$html .= EEH_HTML::h3(
397 396
 					$question_group->name(),
@@ -405,7 +404,7 @@  discard block
 block discarded – undo
405 404
 			}
406 405
 		}
407 406
 		// group_desc
408
-		if ( $question_group->show_group_desc() && $question_group->desc() !== '' ) {
407
+		if ($question_group->show_group_desc() && $question_group->desc() !== '') {
409 408
 			$html .= EEH_HTML::p(
410 409
 				$question_group->desc(),
411 410
 				'',
@@ -415,7 +414,7 @@  discard block
 block discarded – undo
415 414
 			);
416 415
 
417 416
 		}
418
-		return new EE_Form_Section_HTML( $html );
417
+		return new EE_Form_Section_HTML($html);
419 418
 	}
420 419
 
421 420
 
@@ -425,7 +424,7 @@  discard block
 block discarded – undo
425 424
 	 * @return    EE_Form_Section_Proper
426 425
 	 * @throws \EE_Error
427 426
 	 */
428
-	private function _copy_attendee_info_form(){
427
+	private function _copy_attendee_info_form() {
429 428
 		// array of params to pass to parent constructor
430 429
 		return new EE_Form_Section_Proper(
431 430
 			array(
@@ -454,7 +453,7 @@  discard block
 block discarded – undo
454 453
 	private function _auto_copy_attendee_info() {
455 454
 		return new EE_Form_Section_HTML(
456 455
 			EEH_Template::locate_template(
457
-				SPCO_REG_STEPS_PATH . $this->_slug . DS . '_auto_copy_attendee_info.template.php',
456
+				SPCO_REG_STEPS_PATH.$this->_slug.DS.'_auto_copy_attendee_info.template.php',
458 457
 				apply_filters(
459 458
 					'FHEE__EE_SPCO_Reg_Step_Attendee_Information__auto_copy_attendee_info__template_args',
460 459
 					array()
@@ -478,32 +477,32 @@  discard block
 block discarded – undo
478 477
 		$copy_attendee_info_inputs = array();
479 478
 		$prev_ticket = NULL;
480 479
 		// grab the saved registrations from the transaction
481
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
482
-		foreach ( $registrations as $registration ) {
480
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
481
+		foreach ($registrations as $registration) {
483 482
 			// for all  attendees other than the primary attendee
484
-			if ( $registration instanceof EE_Registration && ! $registration->is_primary_registrant() ) {
483
+			if ($registration instanceof EE_Registration && ! $registration->is_primary_registrant()) {
485 484
 				// if this is a new ticket OR if this is the very first additional attendee after the primary attendee
486
-				if ( $registration->ticket()->ID() !== $prev_ticket ) {
485
+				if ($registration->ticket()->ID() !== $prev_ticket) {
487 486
 					$item_name = $registration->ticket()->name();
488 487
 					$item_name .= $registration->ticket()->description() !== ''
489
-						? ' - ' . $registration->ticket()->description()
488
+						? ' - '.$registration->ticket()->description()
490 489
 						: '';
491
-					$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[ticket-' . $registration->ticket()->ID() . ']' ] = new EE_Form_Section_HTML(
492
-						'<h6 class="spco-copy-attendee-event-hdr">' . $item_name . '</h6>'
490
+					$copy_attendee_info_inputs['spco_copy_attendee_chk[ticket-'.$registration->ticket()->ID().']'] = new EE_Form_Section_HTML(
491
+						'<h6 class="spco-copy-attendee-event-hdr">'.$item_name.'</h6>'
493 492
 					);
494 493
 					$prev_ticket = $registration->ticket()->ID();
495 494
 				}
496 495
 
497
-				$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[' . $registration->ID() . ']' ] = new
496
+				$copy_attendee_info_inputs['spco_copy_attendee_chk['.$registration->ID().']'] = new
498 497
 				EE_Checkbox_Multi_Input(
499 498
 					array(
500 499
 						$registration->ID() => sprintf(
501
-							__( 'Attendee #%s', 'event_espresso' ),
500
+							__('Attendee #%s', 'event_espresso'),
502 501
 							$registration->count()
503 502
 						)
504 503
 					),
505 504
 					array(
506
-						'html_id'                 => 'spco-copy-attendee-chk-' . $registration->reg_url_link(),
505
+						'html_id'                 => 'spco-copy-attendee-chk-'.$registration->reg_url_link(),
507 506
 						'html_class'              => 'spco-copy-attendee-chk ee-do-not-validate',
508 507
 						'display_html_label_text' => false
509 508
 					)
@@ -523,7 +522,7 @@  discard block
 block discarded – undo
523 522
 	 * @return    EE_Form_Input_Base
524 523
 	 * @throws \EE_Error
525 524
 	 */
526
-	private function _additional_primary_registrant_inputs( EE_Registration $registration ){
525
+	private function _additional_primary_registrant_inputs(EE_Registration $registration) {
527 526
 		// generate hidden input
528 527
 		return new EE_Hidden_Input(
529 528
 			array(
@@ -542,7 +541,7 @@  discard block
 block discarded – undo
542 541
 	 * @return    EE_Form_Input_Base
543 542
 	 * @throws \EE_Error
544 543
 	 */
545
-	public function reg_form_question( EE_Registration $registration, EE_Question $question ){
544
+	public function reg_form_question(EE_Registration $registration, EE_Question $question) {
546 545
 
547 546
 		// if this question was for an attendee detail, then check for that answer
548 547
 		$answer_value = EEM_Answer::instance()->get_attendee_property_answer_value(
@@ -551,32 +550,32 @@  discard block
 block discarded – undo
551 550
 		);
552 551
 		$answer = $answer_value === null
553 552
 			? EEM_Answer::instance()->get_one(
554
-				array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) )
553
+				array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID()))
555 554
 			)
556 555
 			: null;
557 556
 		// if NOT returning to edit an existing registration
558 557
 		// OR if this question is for an attendee property
559 558
 		// OR we still don't have an EE_Answer object
560
-		if( $answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link() ) {
559
+		if ($answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link()) {
561 560
 			// create an EE_Answer object for storing everything in
562
-			$answer = EE_Answer::new_instance ( array(
561
+			$answer = EE_Answer::new_instance(array(
563 562
 				'QST_ID'=> $question->ID(),
564 563
 				'REG_ID'=> $registration->ID()
565 564
 			));
566 565
 		}
567 566
 		// verify instance
568
-		if( $answer instanceof EE_Answer ){
569
-			if ( ! empty( $answer_value )) {
570
-				$answer->set( 'ANS_value', $answer_value );
567
+		if ($answer instanceof EE_Answer) {
568
+			if ( ! empty($answer_value)) {
569
+				$answer->set('ANS_value', $answer_value);
571 570
 			}
572
-			$answer->cache( 'Question', $question );
571
+			$answer->cache('Question', $question);
573 572
 			//remember system ID had a bug where sometimes it could be null
574
-			$answer_cache_id =$question->is_system_question()
575
-				? $question->system_ID() . '-' . $registration->reg_url_link()
576
-				: $question->ID() . '-' . $registration->reg_url_link();			
577
-			$registration->cache( 'Answer', $answer, $answer_cache_id );
573
+			$answer_cache_id = $question->is_system_question()
574
+				? $question->system_ID().'-'.$registration->reg_url_link()
575
+				: $question->ID().'-'.$registration->reg_url_link();			
576
+			$registration->cache('Answer', $answer, $answer_cache_id);
578 577
 		}
579
-		return $this->_generate_question_input( $registration, $question, $answer );
578
+		return $this->_generate_question_input($registration, $question, $answer);
580 579
 
581 580
 	}
582 581
 
@@ -589,46 +588,46 @@  discard block
 block discarded – undo
589 588
 	 * @return EE_Form_Input_Base
590 589
 	 * @throws \EE_Error
591 590
 	 */
592
-	private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){
591
+	private function _generate_question_input(EE_Registration $registration, EE_Question $question, $answer) {
593 592
 		$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
594
-		$this->_required_questions[ $identifier ] = $question->required() ? true : false;
593
+		$this->_required_questions[$identifier] = $question->required() ? true : false;
595 594
 		add_filter(
596 595
 			'FHEE__EE_Question__generate_form_input__country_options',
597
-			array( $this, 'use_cached_countries_for_form_input' ),
596
+			array($this, 'use_cached_countries_for_form_input'),
598 597
 			10,
599 598
 			4
600 599
 		);
601 600
 		add_filter(
602 601
 			'FHEE__EE_Question__generate_form_input__state_options',
603
-			array( $this, 'use_cached_states_for_form_input' ),
602
+			array($this, 'use_cached_states_for_form_input'),
604 603
 			10,
605 604
 			4
606 605
 		);
607 606
 		$input_constructor_args = array(
608
-			'html_name'     => 'ee_reg_qstn[' . $registration->ID() . '][' . $identifier . ']',
609
-			'html_id'       => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
610
-			'html_class'    => 'ee-reg-qstn ee-reg-qstn-' . $identifier,
611
-			'html_label_id' => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
607
+			'html_name'     => 'ee_reg_qstn['.$registration->ID().']['.$identifier.']',
608
+			'html_id'       => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
609
+			'html_class'    => 'ee-reg-qstn ee-reg-qstn-'.$identifier,
610
+			'html_label_id' => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
612 611
 			'html_label_class'	=> 'ee-reg-qstn',
613 612
 		);
614
-		$input_constructor_args['html_label_id'] 	.= '-lbl';
615
-		if ( $answer instanceof EE_Answer && $answer->ID() ) {
616
-			$input_constructor_args[ 'html_name' ] .= '[' . $answer->ID() . ']';
617
-			$input_constructor_args[ 'html_id' ] .= '-' . $answer->ID();
618
-			$input_constructor_args[ 'html_label_id' ] .= '-' . $answer->ID();
613
+		$input_constructor_args['html_label_id'] .= '-lbl';
614
+		if ($answer instanceof EE_Answer && $answer->ID()) {
615
+			$input_constructor_args['html_name'] .= '['.$answer->ID().']';
616
+			$input_constructor_args['html_id'] .= '-'.$answer->ID();
617
+			$input_constructor_args['html_label_id'] .= '-'.$answer->ID();
619 618
 		}
620
-		$form_input =  $question->generate_form_input(
619
+		$form_input = $question->generate_form_input(
621 620
 			$registration,
622 621
 			$answer,
623 622
 			$input_constructor_args
624 623
 		);
625 624
 		remove_filter(
626 625
 			'FHEE__EE_Question__generate_form_input__country_options',
627
-			array( $this, 'use_cached_countries_for_form_input' )
626
+			array($this, 'use_cached_countries_for_form_input')
628 627
 		);
629 628
 		remove_filter(
630 629
 			'FHEE__EE_Question__generate_form_input__state_options',
631
-			array( $this, 'use_cached_states_for_form_input' )
630
+			array($this, 'use_cached_states_for_form_input')
632 631
 		);
633 632
 		return $form_input;
634 633
 	}
@@ -642,23 +641,23 @@  discard block
 block discarded – undo
642 641
 	 * @return array 2d keys are country IDs, values are their names
643 642
 	 * @throws \EE_Error
644 643
 	 */
645
-	public function use_cached_countries_for_form_input( $countries_list, $question, $registration, $answer ) {
646
-		$country_options = array( '' => '' );
644
+	public function use_cached_countries_for_form_input($countries_list, $question, $registration, $answer) {
645
+		$country_options = array('' => '');
647 646
 		// get possibly cached list of countries
648 647
 		$countries = $this->checkout->action === 'process_reg_step'
649 648
 			? EEM_Country::instance()->get_all_countries()
650 649
 			: EEM_Country::instance()->get_all_active_countries();
651
-		if ( ! empty( $countries )) {
652
-			foreach( $countries as $country ){
653
-				if ( $country instanceof EE_Country ) {
654
-					$country_options[ $country->ID() ] = $country->name();
650
+		if ( ! empty($countries)) {
651
+			foreach ($countries as $country) {
652
+				if ($country instanceof EE_Country) {
653
+					$country_options[$country->ID()] = $country->name();
655 654
 				}
656 655
 			}
657 656
 		}
658
-		if( $question instanceof EE_Question
659
-			&& $registration instanceof EE_Registration ) {
657
+		if ($question instanceof EE_Question
658
+			&& $registration instanceof EE_Registration) {
660 659
 			$answer = EEM_Answer::instance()->get_one(
661
-				array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) )
660
+				array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID()))
662 661
 			);
663 662
 		} else {
664 663
 			$answer = EE_Answer::new_instance();
@@ -685,15 +684,15 @@  discard block
 block discarded – undo
685 684
 	 * @return array 2d keys are state IDs, values are their names
686 685
 	 * @throws \EE_Error
687 686
 	 */
688
-	public function use_cached_states_for_form_input( $states_list, $question, $registration, $answer ) {
689
-		$state_options = array( '' => array( '' => ''));
687
+	public function use_cached_states_for_form_input($states_list, $question, $registration, $answer) {
688
+		$state_options = array('' => array('' => ''));
690 689
 		$states = $this->checkout->action === 'process_reg_step'
691 690
 			? EEM_State::instance()->get_all_states()
692 691
 			: EEM_State::instance()->get_all_active_states();
693
-		if ( ! empty( $states )) {
694
-			foreach( $states as $state ){
695
-				if ( $state instanceof EE_State ) {
696
-					$state_options[ $state->country()->name() ][ $state->ID() ] = $state->name();
692
+		if ( ! empty($states)) {
693
+			foreach ($states as $state) {
694
+				if ($state instanceof EE_State) {
695
+					$state_options[$state->country()->name()][$state->ID()] = $state->name();
697 696
 				}
698 697
 			}
699 698
 		}
@@ -721,24 +720,24 @@  discard block
 block discarded – undo
721 720
 	 * @throws \EE_Error
722 721
 	 */
723 722
 	public function process_reg_step() {
724
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
723
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
725 724
 		// grab validated data from form
726 725
 		$valid_data = $this->checkout->current_step->valid_data();
727 726
 		// EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
728 727
 		// EEH_Debug_Tools::printr( $valid_data, '$valid_data', __FILE__, __LINE__ );
729 728
 		// if we don't have any $valid_data then something went TERRIBLY WRONG !!!
730
-		if ( empty( $valid_data ))  {
729
+		if (empty($valid_data)) {
731 730
 			EE_Error::add_error(
732
-				__( 'No valid question responses were received.', 'event_espresso' ),
731
+				__('No valid question responses were received.', 'event_espresso'),
733 732
 				__FILE__,
734 733
 				__FUNCTION__,
735 734
 				__LINE__
736 735
 			);
737 736
 			return false;
738 737
 		}
739
-		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg ) {
738
+		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg) {
740 739
 			EE_Error::add_error(
741
-				__( 'A valid transaction could not be initiated for processing your registrations.', 'event_espresso' ),
740
+				__('A valid transaction could not be initiated for processing your registrations.', 'event_espresso'),
742 741
 				__FILE__,
743 742
 				__FUNCTION__,
744 743
 				__LINE__
@@ -746,11 +745,11 @@  discard block
 block discarded – undo
746 745
 			return false;
747 746
 		}
748 747
 		// get cached registrations
749
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
748
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
750 749
 		// verify we got the goods
751
-		if ( empty( $registrations )) {
750
+		if (empty($registrations)) {
752 751
 			EE_Error::add_error(
753
-				__( 'Your form data could not be applied to any valid registrations.', 'event_espresso' ),
752
+				__('Your form data could not be applied to any valid registrations.', 'event_espresso'),
754 753
 				__FILE__,
755 754
 				__FUNCTION__,
756 755
 				__LINE__
@@ -758,15 +757,15 @@  discard block
 block discarded – undo
758 757
 			return false;
759 758
 		}
760 759
 		// extract attendee info from form data and save to model objects
761
-		$registrations_processed = $this->_process_registrations( $registrations, $valid_data );
760
+		$registrations_processed = $this->_process_registrations($registrations, $valid_data);
762 761
 		// if first pass thru SPCO,
763 762
 		// then let's check processed registrations against the total number of tickets in the cart
764
-		if ( $registrations_processed === false ) {
763
+		if ($registrations_processed === false) {
765 764
 			// but return immediately if the previous step exited early due to errors
766 765
 			return false;
767
-		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count ) {
766
+		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count) {
768 767
 			// generate a correctly translated string for all possible singular/plural combinations
769
-			if ( $this->checkout->total_ticket_count === 1 && $registrations_processed !== 1 ) {
768
+			if ($this->checkout->total_ticket_count === 1 && $registrations_processed !== 1) {
770 769
 				$error_msg = sprintf(
771 770
 					__(
772 771
 						'There was %1$d ticket in the Event Queue, but %2$ds registrations were processed',
@@ -775,7 +774,7 @@  discard block
 block discarded – undo
775 774
 					$this->checkout->total_ticket_count,
776 775
 					$registrations_processed
777 776
 				);
778
-			} else if ( $this->checkout->total_ticket_count !== 1 && $registrations_processed === 1 ) {
777
+			} else if ($this->checkout->total_ticket_count !== 1 && $registrations_processed === 1) {
779 778
 				$error_msg = sprintf(
780 779
 					__(
781 780
 						'There was a total of %1$d tickets in the Event Queue, but only %2$ds registration was processed',
@@ -794,17 +793,17 @@  discard block
 block discarded – undo
794 793
 					$registrations_processed
795 794
 				);
796 795
 			}
797
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
796
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
798 797
 			return false;
799 798
 		}
800 799
 		// mark this reg step as completed
801 800
 		$this->set_completed();
802 801
 		$this->_set_success_message(
803
-			__( 'The Attendee Information Step has been successfully completed.', 'event_espresso' )
802
+			__('The Attendee Information Step has been successfully completed.', 'event_espresso')
804 803
 		);
805 804
 		//do action in case a plugin wants to do something with the data submitted in step 1.
806 805
 		//passes EE_Single_Page_Checkout, and it's posted data
807
-		do_action( 'AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data );
806
+		do_action('AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data);
808 807
 		return true;
809 808
 	}
810 809
 
@@ -818,9 +817,9 @@  discard block
 block discarded – undo
818 817
 	 * @return boolean | int
819 818
 	 * @throws \EE_Error
820 819
 	 */
821
-	private function _process_registrations( $registrations = array(), $valid_data = array() ) {
820
+	private function _process_registrations($registrations = array(), $valid_data = array()) {
822 821
 		// load resources and set some defaults
823
-		EE_Registry::instance()->load_model( 'Attendee' );
822
+		EE_Registry::instance()->load_model('Attendee');
824 823
 		// holder for primary registrant attendee object
825 824
 		$this->checkout->primary_attendee_obj = NULL;
826 825
 		// array for tracking reg form data for the primary registrant
@@ -837,9 +836,9 @@  discard block
 block discarded – undo
837 836
 		// attendee counter
838 837
 		$att_nmbr = 0;
839 838
 		// grab the saved registrations from the transaction
840
-		foreach ( $registrations  as $registration ) {
839
+		foreach ($registrations  as $registration) {
841 840
 			// verify EE_Registration object
842
-			if ( ! $registration instanceof EE_Registration ) {
841
+			if ( ! $registration instanceof EE_Registration) {
843 842
 				EE_Error::add_error(
844 843
 					__(
845 844
 						'An invalid Registration object was discovered when attempting to process your registration information.',
@@ -854,12 +853,12 @@  discard block
 block discarded – undo
854 853
 			/** @var string $reg_url_link */
855 854
 			$reg_url_link = $registration->reg_url_link();
856 855
 			// reg_url_link exists ?
857
-			if ( ! empty( $reg_url_link ) ) {
856
+			if ( ! empty($reg_url_link)) {
858 857
 				// should this registration be processed during this visit ?
859
-				if ( $this->checkout->visit_allows_processing_of_this_registration( $registration ) ) {
858
+				if ($this->checkout->visit_allows_processing_of_this_registration($registration)) {
860 859
 					// if NOT revisiting, then let's save the registration now,
861 860
 					// so that we have a REG_ID to use when generating other objects
862
-					if ( ! $this->checkout->revisit ) {
861
+					if ( ! $this->checkout->revisit) {
863 862
 						$registration->save();
864 863
 					}
865 864
 					/**
@@ -869,7 +868,7 @@  discard block
 block discarded – undo
869 868
 					 * @var bool   if true is returned by the plugin then the
870 869
 					 *      		registration processing is halted.
871 870
 					 */
872
-					if ( apply_filters(
871
+					if (apply_filters(
873 872
 						'FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process',
874 873
 						false,
875 874
 						$att_nmbr,
@@ -877,38 +876,38 @@  discard block
 block discarded – undo
877 876
 						$registrations,
878 877
 						$valid_data,
879 878
 						$this
880
-					) ) {
879
+					)) {
881 880
 						return false;
882 881
 					}
883 882
 
884 883
 					// Houston, we have a registration!
885 884
 					$att_nmbr++;
886
-					$this->_attendee_data[ $reg_url_link ] = array();
885
+					$this->_attendee_data[$reg_url_link] = array();
887 886
 					// grab any existing related answer objects
888 887
 					$this->_registration_answers = $registration->answers();
889 888
 					// unset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] );
890
-					if ( isset( $valid_data[ $reg_url_link ] ) ) {
889
+					if (isset($valid_data[$reg_url_link])) {
891 890
 						// do we need to copy basic info from primary attendee ?
892
-						$copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] )
893
-						                && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0
891
+						$copy_primary = isset($valid_data[$reg_url_link]['additional_attendee_reg_info'])
892
+						                && absint($valid_data[$reg_url_link]['additional_attendee_reg_info']) === 0
894 893
 							? true
895 894
 							: false;
896 895
 						// filter form input data for this registration
897
-						$valid_data[ $reg_url_link ] = (array)apply_filters(
896
+						$valid_data[$reg_url_link] = (array) apply_filters(
898 897
 							'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item',
899
-							$valid_data[ $reg_url_link ]
898
+							$valid_data[$reg_url_link]
900 899
 						);
901 900
 						// EEH_Debug_Tools::printr( $valid_data[ $reg_url_link ], '$valid_data[ $reg_url_link ]', __FILE__, __LINE__ );
902
-						if ( isset( $valid_data['primary_attendee'] )) {
903
-							$primary_registrant['line_item_id'] =  ! empty( $valid_data['primary_attendee'] )
901
+						if (isset($valid_data['primary_attendee'])) {
902
+							$primary_registrant['line_item_id'] = ! empty($valid_data['primary_attendee'])
904 903
 								? $valid_data['primary_attendee']
905 904
 								: false;
906
-							unset( $valid_data['primary_attendee'] );
905
+							unset($valid_data['primary_attendee']);
907 906
 						}
908 907
 						// now loop through our array of valid post data && process attendee reg forms
909
-						foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs ) {
910
-							if ( ! in_array( $form_section, $non_input_form_sections )) {
911
-								foreach ( $form_inputs as $form_input => $input_value ) {
908
+						foreach ($valid_data[$reg_url_link] as $form_section => $form_inputs) {
909
+							if ( ! in_array($form_section, $non_input_form_sections)) {
910
+								foreach ($form_inputs as $form_input => $input_value) {
912 911
 									// \EEH_Debug_Tools::printr( $input_value, $form_input, __FILE__, __LINE__ );
913 912
 									// check for critical inputs
914 913
 									if (
@@ -922,16 +921,16 @@  discard block
 block discarded – undo
922 921
 									// store a bit of data about the primary attendee
923 922
 									if (
924 923
 										$att_nmbr === 1
925
-										&& ! empty( $input_value )
924
+										&& ! empty($input_value)
926 925
 										&& $reg_url_link === $primary_registrant['line_item_id']
927 926
 									) {
928
-										$primary_registrant[ $form_input ] = $input_value;
927
+										$primary_registrant[$form_input] = $input_value;
929 928
 									} else if (
930 929
 										$copy_primary
931 930
 										&& $input_value === null
932
-										&& isset( $primary_registrant[ $form_input ] )
931
+										&& isset($primary_registrant[$form_input])
933 932
 									) {
934
-										$input_value = $primary_registrant[ $form_input ];
933
+										$input_value = $primary_registrant[$form_input];
935 934
 									}
936 935
 									// now attempt to save the input data
937 936
 									if (
@@ -973,57 +972,57 @@  discard block
 block discarded – undo
973 972
 						// have we met before?
974 973
 						$attendee = $this->_find_existing_attendee(
975 974
 							$registration,
976
-							$this->_attendee_data[ $reg_url_link ]
975
+							$this->_attendee_data[$reg_url_link]
977 976
 						);
978 977
 						// did we find an already existing record for this attendee ?
979
-						if ( $attendee instanceof EE_Attendee ) {
978
+						if ($attendee instanceof EE_Attendee) {
980 979
 							$attendee = $this->_update_existing_attendee_data(
981 980
 								$attendee,
982
-								$this->_attendee_data[ $reg_url_link ]
981
+								$this->_attendee_data[$reg_url_link]
983 982
 							);
984 983
 						} else {
985 984
 							// ensure critical details are set for additional attendees
986
-							$this->_attendee_data[ $reg_url_link ] = $att_nmbr > 1
985
+							$this->_attendee_data[$reg_url_link] = $att_nmbr > 1
987 986
 								? $this->_copy_critical_attendee_details_from_primary_registrant(
988
-									$this->_attendee_data[ $reg_url_link ]
987
+									$this->_attendee_data[$reg_url_link]
989 988
 								)
990
-								: $this->_attendee_data[ $reg_url_link ];
989
+								: $this->_attendee_data[$reg_url_link];
991 990
 							$attendee = $this->_create_new_attendee(
992 991
 								$registration,
993
-								$this->_attendee_data[ $reg_url_link ]
992
+								$this->_attendee_data[$reg_url_link]
994 993
 							);
995 994
 						}
996 995
 						// who's #1 ?
997
-						if ( $att_nmbr === 1 ) {
996
+						if ($att_nmbr === 1) {
998 997
 							$this->checkout->primary_attendee_obj = $attendee;
999 998
 						}
1000 999
 					}
1001 1000
 					// EEH_Debug_Tools::printr( $attendee, '$attendee', __FILE__, __LINE__ );
1002 1001
 					// add relation to registration, set attendee ID, and cache attendee
1003
-					$this->_associate_attendee_with_registration( $registration, $attendee );
1002
+					$this->_associate_attendee_with_registration($registration, $attendee);
1004 1003
 					// \EEH_Debug_Tools::printr( $registration, '$registration', __FILE__, __LINE__ );
1005
-					if ( ! $registration->attendee() instanceof EE_Attendee ) {
1006
-						EE_Error::add_error( sprintf( __( 'Registration %s has an invalid or missing Attendee object.', 'event_espresso' ), $reg_url_link ), __FILE__, __FUNCTION__, __LINE__ );
1004
+					if ( ! $registration->attendee() instanceof EE_Attendee) {
1005
+						EE_Error::add_error(sprintf(__('Registration %s has an invalid or missing Attendee object.', 'event_espresso'), $reg_url_link), __FILE__, __FUNCTION__, __LINE__);
1007 1006
 						return false;
1008 1007
 					}
1009 1008
 					/** @type EE_Registration_Processor $registration_processor */
1010
-					$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1009
+					$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1011 1010
 					// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1012
-					$registration_processor->toggle_incomplete_registration_status_to_default( $registration, false );
1011
+					$registration_processor->toggle_incomplete_registration_status_to_default($registration, false);
1013 1012
 					/** @type EE_Transaction_Processor $transaction_processor */
1014
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1013
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1015 1014
 					// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1016
-					$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1015
+					$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1017 1016
 					// if we've gotten this far, then let's save what we have
1018 1017
 					$registration->save();
1019 1018
 					// add relation between TXN and registration
1020
-					$this->_associate_registration_with_transaction( $registration );
1019
+					$this->_associate_registration_with_transaction($registration);
1021 1020
 				} // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) {
1022 1021
 
1023
-			}  else {
1024
-				EE_Error::add_error( __( 'An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1022
+			} else {
1023
+				EE_Error::add_error(__('An invalid or missing line item ID was encountered while attempting to process the registration form.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1025 1024
 				// remove malformed data
1026
-				unset( $valid_data[ $reg_url_link ] );
1025
+				unset($valid_data[$reg_url_link]);
1027 1026
 				return false;
1028 1027
 			}
1029 1028
 
@@ -1052,26 +1051,26 @@  discard block
 block discarded – undo
1052 1051
 		// \EEH_Debug_Tools::printr( $input_value, '$input_value', __FILE__, __LINE__ );
1053 1052
 		// allow for plugins to hook in and do their own processing of the form input.
1054 1053
 		// For plugins to bypass normal processing here, they just need to return a boolean value.
1055
-		if ( apply_filters(
1054
+		if (apply_filters(
1056 1055
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information___save_registration_form_input',
1057 1056
 			false,
1058 1057
 			$registration,
1059 1058
 			$form_input,
1060 1059
 			$input_value,
1061 1060
 			$this
1062
-		) ) {
1061
+		)) {
1063 1062
 			return true;
1064 1063
 		}
1065 1064
 		// $answer_cache_id is the key used to find the EE_Answer we want
1066 1065
 		$answer_cache_id = $this->checkout->reg_url_link
1067 1066
 			? $form_input
1068
-			: $form_input . '-' . $registration->reg_url_link();
1069
-		$answer_is_obj = isset( $this->_registration_answers[ $answer_cache_id ] )
1070
-		                 && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer
1067
+			: $form_input.'-'.$registration->reg_url_link();
1068
+		$answer_is_obj = isset($this->_registration_answers[$answer_cache_id])
1069
+		                 && $this->_registration_answers[$answer_cache_id] instanceof EE_Answer
1071 1070
 			? true
1072 1071
 			: false;
1073 1072
 		//rename form_inputs if they are EE_Attendee properties
1074
-		switch( (string)$form_input ) {
1073
+		switch ((string) $form_input) {
1075 1074
 
1076 1075
 			case 'state' :
1077 1076
 			case 'STA_ID' :
@@ -1086,32 +1085,32 @@  discard block
 block discarded – undo
1086 1085
 				break;
1087 1086
 
1088 1087
 			default :
1089
-				$ATT_input = 'ATT_' . $form_input;
1088
+				$ATT_input = 'ATT_'.$form_input;
1090 1089
 				//EEH_Debug_Tools::printr( $ATT_input, '$ATT_input', __FILE__, __LINE__ );
1091
-				$attendee_property = EEM_Attendee::instance()->has_field( $ATT_input ) ? true : false;
1092
-				$form_input = $attendee_property ? 'ATT_' . $form_input : $form_input;
1090
+				$attendee_property = EEM_Attendee::instance()->has_field($ATT_input) ? true : false;
1091
+				$form_input = $attendee_property ? 'ATT_'.$form_input : $form_input;
1093 1092
 		}
1094 1093
 		// EEH_Debug_Tools::printr( $answer_cache_id, '$answer_cache_id', __FILE__, __LINE__ );
1095 1094
 		// EEH_Debug_Tools::printr( $attendee_property, '$attendee_property', __FILE__, __LINE__ );
1096 1095
 		// EEH_Debug_Tools::printr( $answer_is_obj, '$answer_is_obj', __FILE__, __LINE__ );
1097 1096
 		// if this form input has a corresponding attendee property
1098
-		if ( $attendee_property ) {
1099
-			$this->_attendee_data[ $registration->reg_url_link() ][ $form_input ] = $input_value;
1100
-			if ( $answer_is_obj ) {
1097
+		if ($attendee_property) {
1098
+			$this->_attendee_data[$registration->reg_url_link()][$form_input] = $input_value;
1099
+			if ($answer_is_obj) {
1101 1100
 				// and delete the corresponding answer since we won't be storing this data in that object
1102
-				$registration->_remove_relation_to( $this->_registration_answers[ $answer_cache_id ], 'Answer' );
1103
-				$this->_registration_answers[ $answer_cache_id ]->delete_permanently();
1101
+				$registration->_remove_relation_to($this->_registration_answers[$answer_cache_id], 'Answer');
1102
+				$this->_registration_answers[$answer_cache_id]->delete_permanently();
1104 1103
 			}
1105 1104
 			return true;
1106
-		} elseif ( $answer_is_obj ) {
1105
+		} elseif ($answer_is_obj) {
1107 1106
 			// save this data to the answer object
1108
-			$this->_registration_answers[ $answer_cache_id ]->set_value( $input_value );
1109
-			$result = $this->_registration_answers[ $answer_cache_id ]->save();
1107
+			$this->_registration_answers[$answer_cache_id]->set_value($input_value);
1108
+			$result = $this->_registration_answers[$answer_cache_id]->save();
1110 1109
 			return $result !== false ? true : false;
1111 1110
 		} else {
1112
-			foreach ( $this->_registration_answers as $answer ) {
1113
-				if ( $answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id ) {
1114
-					$answer->set_value( $input_value );
1111
+			foreach ($this->_registration_answers as $answer) {
1112
+				if ($answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id) {
1113
+					$answer->set_value($input_value);
1115 1114
 					$result = $answer->save();
1116 1115
 					return $result !== false ? true : false;
1117 1116
 				}
@@ -1133,15 +1132,15 @@  discard block
 block discarded – undo
1133 1132
 		$form_input = '',
1134 1133
 		$input_value = ''
1135 1134
 	) {
1136
-		if ( empty( $input_value ) ) {
1135
+		if (empty($input_value)) {
1137 1136
 			// if the form input isn't marked as being required, then just return
1138
-			if ( ! isset( $this->_required_questions[ $form_input ] ) || ! $this->_required_questions[ $form_input ] ) {
1137
+			if ( ! isset($this->_required_questions[$form_input]) || ! $this->_required_questions[$form_input]) {
1139 1138
 				return true;
1140 1139
 			}
1141
-			switch ( $form_input ) {
1140
+			switch ($form_input) {
1142 1141
 				case 'fname' :
1143 1142
 					EE_Error::add_error(
1144
-						__( 'First Name is a required value.', 'event_espresso' ),
1143
+						__('First Name is a required value.', 'event_espresso'),
1145 1144
 						__FILE__,
1146 1145
 						__FUNCTION__,
1147 1146
 						__LINE__
@@ -1150,7 +1149,7 @@  discard block
 block discarded – undo
1150 1149
 					break;
1151 1150
 				case 'lname' :
1152 1151
 					EE_Error::add_error(
1153
-						__( 'Last Name is a required value.', 'event_espresso' ),
1152
+						__('Last Name is a required value.', 'event_espresso'),
1154 1153
 						__FILE__,
1155 1154
 						__FUNCTION__,
1156 1155
 						__LINE__
@@ -1159,7 +1158,7 @@  discard block
 block discarded – undo
1159 1158
 					break;
1160 1159
 				case 'email' :
1161 1160
 					EE_Error::add_error(
1162
-						__( 'Please enter a valid email address.', 'event_espresso' ),
1161
+						__('Please enter a valid email address.', 'event_espresso'),
1163 1162
 						__FILE__,
1164 1163
 						__FUNCTION__,
1165 1164
 						__LINE__
@@ -1192,21 +1191,21 @@  discard block
 block discarded – undo
1192 1191
 	 * @param array           $attendee_data
1193 1192
 	 * @return boolean
1194 1193
 	 */
1195
-	private function _find_existing_attendee( EE_Registration $registration, $attendee_data = array() ) {
1194
+	private function _find_existing_attendee(EE_Registration $registration, $attendee_data = array()) {
1196 1195
 		$existing_attendee = null;
1197 1196
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1198
-		$ATT_fname = isset( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_fname'] )
1197
+		$ATT_fname = isset($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_fname'])
1199 1198
 			? $attendee_data['ATT_fname']
1200 1199
 			: '';
1201
-		$ATT_lname = isset( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_lname'] )
1200
+		$ATT_lname = isset($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_lname'])
1202 1201
 			? $attendee_data['ATT_lname']
1203 1202
 			: '';
1204
-		$ATT_email = isset( $attendee_data['ATT_email'] ) && ! empty( $attendee_data['ATT_email'] )
1203
+		$ATT_email = isset($attendee_data['ATT_email']) && ! empty($attendee_data['ATT_email'])
1205 1204
 			? $attendee_data['ATT_email']
1206 1205
 			: '';
1207 1206
 		// but only if those have values
1208
-		if ( $ATT_fname && $ATT_lname && $ATT_email ) {
1209
-			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( array(
1207
+		if ($ATT_fname && $ATT_lname && $ATT_email) {
1208
+			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(array(
1210 1209
 				'ATT_fname' => $ATT_fname,
1211 1210
 				'ATT_lname' => $ATT_lname,
1212 1211
 				'ATT_email' => $ATT_email
@@ -1230,13 +1229,13 @@  discard block
 block discarded – undo
1230 1229
 	 * @return \EE_Attendee
1231 1230
 	 * @throws \EE_Error
1232 1231
 	 */
1233
-	private function _update_existing_attendee_data( EE_Attendee $existing_attendee, $attendee_data = array() ) {
1232
+	private function _update_existing_attendee_data(EE_Attendee $existing_attendee, $attendee_data = array()) {
1234 1233
 		// first remove fname, lname, and email from attendee data
1235
-		$dont_set = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
1234
+		$dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
1236 1235
 		// now loop thru what's left and add to attendee CPT
1237
-		foreach ( $attendee_data as $property_name => $property_value ) {
1238
-			if ( ! in_array( $property_name, $dont_set ) && EEM_Attendee::instance()->has_field( $property_name )) {
1239
-				$existing_attendee->set( $property_name, $property_value );
1236
+		foreach ($attendee_data as $property_name => $property_value) {
1237
+			if ( ! in_array($property_name, $dont_set) && EEM_Attendee::instance()->has_field($property_name)) {
1238
+				$existing_attendee->set($property_name, $property_value);
1240 1239
 			}
1241 1240
 		}
1242 1241
 		// better save that now
@@ -1254,11 +1253,11 @@  discard block
 block discarded – undo
1254 1253
 	 * @return void
1255 1254
 	 * @throws \EE_Error
1256 1255
 	 */
1257
-	private function _associate_attendee_with_registration( EE_Registration $registration, EE_Attendee $attendee ) {
1256
+	private function _associate_attendee_with_registration(EE_Registration $registration, EE_Attendee $attendee) {
1258 1257
 		// add relation to attendee
1259
-		$registration->_add_relation_to( $attendee, 'Attendee' );
1260
-		$registration->set_attendee_id( $attendee->ID() );
1261
-		$registration->update_cache_after_object_save( 'Attendee', $attendee );
1258
+		$registration->_add_relation_to($attendee, 'Attendee');
1259
+		$registration->set_attendee_id($attendee->ID());
1260
+		$registration->update_cache_after_object_save('Attendee', $attendee);
1262 1261
 	}
1263 1262
 
1264 1263
 
@@ -1270,10 +1269,10 @@  discard block
 block discarded – undo
1270 1269
 	 * @return void
1271 1270
 	 * @throws \EE_Error
1272 1271
 	 */
1273
-	private function _associate_registration_with_transaction( EE_Registration $registration ) {
1272
+	private function _associate_registration_with_transaction(EE_Registration $registration) {
1274 1273
 		// add relation to attendee
1275
-		$this->checkout->transaction->_add_relation_to( $registration, 'Registration' );
1276
-		$this->checkout->transaction->update_cache_after_object_save( 'Registration', $registration );
1274
+		$this->checkout->transaction->_add_relation_to($registration, 'Registration');
1275
+		$this->checkout->transaction->update_cache_after_object_save('Registration', $registration);
1277 1276
 	}
1278 1277
 
1279 1278
 
@@ -1286,14 +1285,14 @@  discard block
 block discarded – undo
1286 1285
 	 * @return array
1287 1286
 	 * @throws \EE_Error
1288 1287
 	 */
1289
-	private function _copy_critical_attendee_details_from_primary_registrant( $attendee_data = array() ) {
1288
+	private function _copy_critical_attendee_details_from_primary_registrant($attendee_data = array()) {
1290 1289
 		// bare minimum critical details include first name, last name, email address
1291
-		$critical_attendee_details = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
1290
+		$critical_attendee_details = array('ATT_fname', 'ATT_lname', 'ATT_email');
1292 1291
 		// add address info to critical details?
1293
-		if ( apply_filters(
1292
+		if (apply_filters(
1294 1293
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information__merge_address_details_with_critical_attendee_details',
1295 1294
 			false
1296
-		) ) {
1295
+		)) {
1297 1296
 			$address_details = array(
1298 1297
 				'ATT_address',
1299 1298
 				'ATT_address2',
@@ -1303,13 +1302,13 @@  discard block
 block discarded – undo
1303 1302
 				'ATT_zip',
1304 1303
 				'ATT_phone'
1305 1304
 			);
1306
-			$critical_attendee_details = array_merge( $critical_attendee_details, $address_details );
1305
+			$critical_attendee_details = array_merge($critical_attendee_details, $address_details);
1307 1306
 		}
1308
-		foreach ( $critical_attendee_details as $critical_attendee_detail ) {
1309
-			if ( ! isset( $attendee_data[ $critical_attendee_detail ] )
1310
-			     || empty( $attendee_data[ $critical_attendee_detail ] )
1307
+		foreach ($critical_attendee_details as $critical_attendee_detail) {
1308
+			if ( ! isset($attendee_data[$critical_attendee_detail])
1309
+			     || empty($attendee_data[$critical_attendee_detail])
1311 1310
 			) {
1312
-				$attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get(
1311
+				$attendee_data[$critical_attendee_detail] = $this->checkout->primary_attendee_obj->get(
1313 1312
 					$critical_attendee_detail
1314 1313
 				);
1315 1314
 			}
@@ -1327,11 +1326,11 @@  discard block
 block discarded – undo
1327 1326
 	 * @return \EE_Attendee
1328 1327
 	 * @throws \EE_Error
1329 1328
 	 */
1330
-	private function _create_new_attendee( EE_Registration $registration, $attendee_data = array() ) {
1329
+	private function _create_new_attendee(EE_Registration $registration, $attendee_data = array()) {
1331 1330
 		// create new attendee object
1332
-		$new_attendee = EE_Attendee::new_instance( $attendee_data );
1331
+		$new_attendee = EE_Attendee::new_instance($attendee_data);
1333 1332
 		// set author to event creator
1334
-		$new_attendee->set( 'ATT_author', $registration->event()->wp_user() );
1333
+		$new_attendee->set('ATT_author', $registration->event()->wp_user());
1335 1334
 		$new_attendee->save();
1336 1335
 		return $new_attendee;
1337 1336
 	}
@@ -1348,7 +1347,7 @@  discard block
 block discarded – undo
1348 1347
 	 */
1349 1348
 	public function update_reg_step() {
1350 1349
 		// save everything
1351
-		if ( $this->process_reg_step() ) {
1350
+		if ($this->process_reg_step()) {
1352 1351
 			$this->checkout->redirect = true;
1353 1352
 			$this->checkout->redirect_url = add_query_arg(
1354 1353
 				array(
@@ -1357,7 +1356,7 @@  discard block
 block discarded – undo
1357 1356
 				),
1358 1357
 				$this->checkout->thank_you_page_url
1359 1358
 			);
1360
-			$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1359
+			$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1361 1360
 			return true;
1362 1361
 		}
1363 1362
 		return false;
Please login to merge, or discard this patch.
modules/venue_single/EED_Venue_Single.module.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venue_Single
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venue', 'Venue_Single', 'run' );
40
+		EE_Config::register_route('venue', 'Venue_Single', 'run');
41 41
 //		EE_Config::register_view( 'venue', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'single-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'single-espresso_venues.php' ) {
78
+		if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'single-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
82
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82
+			add_filter('the_content', array($this, 'venue_details'), 100);
83 83
 			// don't display entry meta because the existing theme will take car of that
84
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
84
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
85 85
 		}
86 86
 		return $template;
87 87
 	}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @param  string $title
96 96
 	 * @return string
97 97
 	 */
98
-	public function the_title( $title = '' ) {
98
+	public function the_title($title = '') {
99 99
 		return $title;
100 100
 	}
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @param  string $content
108 108
 	 * @return string
109 109
 	 */
110
-	public function venue_details( $content ) {
110
+	public function venue_details($content) {
111 111
 		global $post;
112 112
 		if (
113 113
 			$post->post_type == 'espresso_venues'
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
 			// it uses the_content() for displaying the $post->post_content
118 118
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
119 119
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
120
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
120
+			remove_filter('the_content', array($this, 'venue_details'), 100);
121 121
 			// add filters we want
122
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
122
+			add_filter('the_content', array($this, 'venue_location'), 110);
123 123
 			// now load our template
124
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
124
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
125 125
 			// remove other filters we added so they won't get applied to the next post
126
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
126
+			remove_filter('the_content', array($this, 'venue_location'), 110);
127 127
 		}
128 128
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
129
-		return ! empty( $template ) ? $template : $content;
129
+		return ! empty($template) ? $template : $content;
130 130
 	}
131 131
 
132 132
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 * @param  string $content
139 139
 	 * @return string
140 140
 	 */
141
-	public function venue_location( $content ) {
142
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
141
+	public function venue_location($content) {
142
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
143 143
 	}
144 144
 
145 145
 
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function wp_enqueue_scripts() {
154 154
 		// get some style
155
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_single() ) {
155
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_single()) {
156 156
 			// first check theme folder
157
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
158
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
159
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
160
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
157
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
158
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
159
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
160
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
161 161
 			}
162
-			wp_enqueue_style( $this->theme );
163
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
164
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
162
+			wp_enqueue_style($this->theme);
163
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
164
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
165 165
 			}
166 166
 		}
167 167
 	}
Please login to merge, or discard this patch.
modules/venues_archive/EED_Venues_Archive.module.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @return EED_Venues_Archive
28 28
 	 */
29 29
 	public static function instance() {
30
-		return parent::get_instance( __CLASS__ );
30
+		return parent::get_instance(__CLASS__);
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *  @return 	void
38 38
 	 */
39 39
 	public static function set_hooks() {
40
-		EE_Config::register_route( 'venues', 'Venues_Archive', 'run' );
40
+		EE_Config::register_route('venues', 'Venues_Archive', 'run');
41 41
 //		EE_Config::register_view( 'venues', 0, EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_venues.php' );
42 42
 	}
43 43
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * @access    public
59 59
 	 * @param \WP $WP
60 60
 	 */
61
-	public function run( $WP ) {
61
+	public function run($WP) {
62 62
 		// check what template is loaded
63
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
64
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
63
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
64
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
65 65
 	}
66 66
 
67 67
 
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 	 * @param  string $template
74 74
 	 * @return string
75 75
 	 */
76
-	public function template_include( $template ) {
76
+	public function template_include($template) {
77 77
 		// not a custom template?
78
-		if ( EE_Registry::instance()->load_core( 'Front_Controller', array(), false, true )->get_selected_template() != 'archive-espresso_venues.php' ) {
78
+		if (EE_Registry::instance()->load_core('Front_Controller', array(), false, true)->get_selected_template() != 'archive-espresso_venues.php') {
79 79
 			EEH_Template::load_espresso_theme_functions();
80 80
 			// then add extra event data via hooks
81
-			add_filter( 'the_title', array( $this, 'the_title' ), 100, 1 );
81
+			add_filter('the_title', array($this, 'the_title'), 100, 1);
82 82
 			// don't know if theme uses the_excerpt
83
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
83
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
84 84
 			// or the_content
85
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
85
+			add_filter('the_content', array($this, 'venue_details'), 100);
86 86
 			// don't display entry meta because the existing theme will take care of that
87
-			add_filter( 'FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false' );
87
+			add_filter('FHEE__content_espresso_venues_details_template__display_entry_meta', '__return_false');
88 88
 		}
89 89
 		return $template;
90 90
 	}
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @param  string $title
99 99
 	 * @return string
100 100
 	 */
101
-	public function the_title( $title = '' ) {
101
+	public function the_title($title = '') {
102 102
 		return $title;
103 103
 	}
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @param  string $content
111 111
 	 * @return string
112 112
 	 */
113
-	public function venue_details( $content ) {
113
+	public function venue_details($content) {
114 114
 		global $post;
115 115
 		if (
116 116
 			$post->post_type == 'espresso_venues'
@@ -120,22 +120,22 @@  discard block
 block discarded – undo
120 120
 			// it uses the_content() for displaying the $post->post_content
121 121
 			// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
122 122
 			// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
123
-			remove_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
124
-			remove_filter( 'the_content', array( $this, 'venue_details' ), 100 );
123
+			remove_filter('the_excerpt', array($this, 'venue_details'), 100);
124
+			remove_filter('the_content', array($this, 'venue_details'), 100);
125 125
 			// add filters we want
126
-			add_filter( 'the_content', array( $this, 'venue_location' ), 110 );
127
-			add_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
126
+			add_filter('the_content', array($this, 'venue_location'), 110);
127
+			add_filter('the_excerpt', array($this, 'venue_location'), 110);
128 128
 			// now load our template
129
-			$template = EEH_Template::locate_template( 'content-espresso_venues-details.php' );
129
+			$template = EEH_Template::locate_template('content-espresso_venues-details.php');
130 130
 			//now add our filter back in, plus some others
131
-			add_filter( 'the_excerpt', array( $this, 'venue_details' ), 100 );
132
-			add_filter( 'the_content', array( $this, 'venue_details' ), 100 );
131
+			add_filter('the_excerpt', array($this, 'venue_details'), 100);
132
+			add_filter('the_content', array($this, 'venue_details'), 100);
133 133
 			// remove other filters we added so they won't get applied to the next post
134
-			remove_filter( 'the_content', array( $this, 'venue_location' ), 110 );
135
-			remove_filter( 'the_excerpt', array( $this, 'venue_location' ), 110 );
134
+			remove_filter('the_content', array($this, 'venue_location'), 110);
135
+			remove_filter('the_excerpt', array($this, 'venue_location'), 110);
136 136
 			// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
137 137
 		}
138
-		return ! empty( $template ) ? $template : $content;
138
+		return ! empty($template) ? $template : $content;
139 139
 	}
140 140
 
141 141
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param  string $content
148 148
 	 * @return string
149 149
 	 */
150
-	public function venue_location( $content ) {
151
-		return $content . EEH_Template::locate_template( 'content-espresso_venues-location.php' );
150
+	public function venue_location($content) {
151
+		return $content.EEH_Template::locate_template('content-espresso_venues-location.php');
152 152
 	}
153 153
 
154 154
 
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function wp_enqueue_scripts() {
164 164
 		// get some style
165
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && is_archive() ) {
165
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && is_archive()) {
166 166
 			// first check theme folder
167
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
168
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
169
-			} else if ( is_readable( EE_TEMPLATES . $this->theme . DS . 'style.css' )) {
170
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ) );
167
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
168
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
169
+			} else if (is_readable(EE_TEMPLATES.$this->theme.DS.'style.css')) {
170
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
171 171
 			}
172
-			wp_enqueue_style( $this->theme );
172
+			wp_enqueue_style($this->theme);
173 173
 		}
174 174
 	}
175 175
 
Please login to merge, or discard this patch.
payment_methods/Bank/EE_PMT_Bank.pm.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_PMT_Bank extends EE_PMT_Base{
28
+class EE_PMT_Bank extends EE_PMT_Base {
29 29
 
30 30
 
31 31
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		$this->_pretty_name = __("Bank", 'event_espresso');
39 39
 		parent::__construct($pm_instance);
40 40
 		$this->_default_button_url = $this->file_url().'lib'.DS.'bank-logo.png';
41
-		$this->_default_description = __( 'Make payment using an electronic funds transfer from your bank.', 'event_espresso' );
41
+		$this->_default_description = __('Make payment using an electronic funds transfer from your bank.', 'event_espresso');
42 42
 	}
43 43
 
44 44
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @param \EE_Transaction $transaction
49 49
 	 * @return NULL
50 50
 	 */
51
-	public function generate_new_billing_form( EE_Transaction $transaction = NULL ) {
51
+	public function generate_new_billing_form(EE_Transaction $transaction = NULL) {
52 52
 		return NULL;
53 53
 	}
54 54
 
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
 		return new EE_Payment_Method_Form(array(
63 63
 			'extra_meta_inputs'=>array(
64 64
 				'page_title'=>new EE_Text_Input(array(
65
-					'html_label_text'=>  sprintf(__("Title %s", "event_espresso"),  $this->get_help_tab_link()),
65
+					'html_label_text'=>  sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()),
66 66
 					'default'=>  __("Electronic Funds Transfers", 'event_espresso')
67 67
 				)),
68
-				'payment_instructions'=>new EE_Text_Area_Input( array(
69
-					'html_label_text'=>  sprintf(__("Payment Instructions %s", "event_espresso"),  $this->get_help_tab_link()),
70
-					'html_help_text' => __( 'Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso' ),
68
+				'payment_instructions'=>new EE_Text_Area_Input(array(
69
+					'html_label_text'=>  sprintf(__("Payment Instructions %s", "event_espresso"), $this->get_help_tab_link()),
70
+					'html_help_text' => __('Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso'),
71 71
 					'default'=> sprintf(
72 72
 						__('Please initiate an electronic payment using the following bank information: %1$sAccount Owner: Luke Skywalker%1$sBank Account # 1234567890%1$sBank Name: Rebellion Bank%1$sRouting Number: 12345%1$sBank Address: 12345 Wookie Rd., Planet Corellian.%1$sPayment must be received within 48 hours of event date.', 'event_espresso'),
73 73
 						"\n"
74 74
 					),
75
-					'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ),
75
+					'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()),
76 76
 				)),
77 77
 			),
78 78
 			'exclude'=>array('PMD_debug_mode')
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 * @see EE_PMT_Base::help_tabs_config()
87 87
 	 * @return array
88 88
 	 */
89
-	public function help_tabs_config(){
89
+	public function help_tabs_config() {
90 90
 		return array(
91 91
 			$this->get_help_tab_name() => array(
92 92
 						'title' => __('Bank Draft Settings', 'event_espresso'),
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 * Other gateways may want to override this, such as offline gateways.
104 104
 	 * @return string
105 105
 	 */
106
-	public function payment_overview_content(EE_Payment $payment){
106
+	public function payment_overview_content(EE_Payment $payment) {
107 107
 		EE_Registry::instance()->load_helper('Template');
108 108
 		$extra_meta_for_payment_method = $this->_pm_instance->all_extra_meta_array();
109 109
 		$template_vars = array_merge(
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 							),
116 116
 						$extra_meta_for_payment_method);
117 117
 		return EEH_Template::locate_template(
118
-				'payment_methods' . DS . 'Bank'. DS . 'templates' . DS . 'bank_payment_details_content.template.php',
118
+				'payment_methods'.DS.'Bank'.DS.'templates'.DS.'bank_payment_details_content.template.php',
119 119
 				$template_vars);
120 120
 	}
121 121
 
Please login to merge, or discard this patch.
payment_methods/Invoice/EE_PMT_Invoice.pm.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_PMT_Invoice extends EE_PMT_Base{
28
+class EE_PMT_Invoice extends EE_PMT_Base {
29 29
 
30 30
 
31 31
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function __construct($pm_instance = NULL) {
38 38
 		$this->_pretty_name = __("Invoice", 'event_espresso');
39
-		$this->_default_description = __( 'After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso' );
39
+		$this->_default_description = __('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso');
40 40
 		parent::__construct($pm_instance);
41 41
 		$this->_default_button_url = $this->file_url().'lib'.DS.'invoice-logo.png';
42 42
 	}
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @param \EE_Transaction $transaction
49 49
 	 * @return NULL
50 50
 	 */
51
-	public function generate_new_billing_form( EE_Transaction $transaction = NULL ) {
51
+	public function generate_new_billing_form(EE_Transaction $transaction = NULL) {
52 52
 		return NULL;
53 53
 	}
54 54
 
@@ -61,53 +61,53 @@  discard block
 block discarded – undo
61 61
 	public function generate_new_settings_form() {
62 62
 		$pdf_payee_input_name = 'pdf_payee_name';
63 63
 		$confirmation_text_input_name = 'page_confirmation_text';
64
-		$form =  new EE_Payment_Method_Form(array(
64
+		$form = new EE_Payment_Method_Form(array(
65 65
 //				'payment_method_type' => $this,
66 66
 				'extra_meta_inputs'=>array(
67 67
 					$pdf_payee_input_name => new EE_Text_Input(array(
68
-						'html_label_text' => sprintf( __( 'Payee Name %s', 'event_espresso' ), $this->get_help_tab_link())
68
+						'html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link())
69 69
 					)),
70 70
 					'pdf_payee_email' => new EE_Email_Input(array(
71
-						'html_label_text' => sprintf( __( 'Payee Email %s', 'event_espresso' ), $this->get_help_tab_link()),
71
+						'html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()),
72 72
 					)),
73 73
 					'pdf_payee_tax_number' => new EE_Text_Input(array(
74
-						'html_label_text' => sprintf( __( 'Payee Tax Number %s', 'event_espresso' ), $this->get_help_tab_link()),
74
+						'html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()),
75 75
 						)),
76
-					'pdf_payee_address' => new EE_Text_Area_Input( array(
77
-						'html_label_text' => sprintf( __( 'Payee Address %s', 'event_espresso' ), $this->get_help_tab_link() ),
78
-						'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ),
76
+					'pdf_payee_address' => new EE_Text_Area_Input(array(
77
+						'html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()),
78
+						'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()),
79 79
 					)),
80 80
 					'pdf_instructions'=>new EE_Text_Area_Input(array(
81
-						'html_label_text'=>  sprintf(__("Instructions %s", "event_espresso"),  $this->get_help_tab_link()),
81
+						'html_label_text'=>  sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()),
82 82
 						'default'=>  __("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso'),
83
-						'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ),
83
+						'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()),
84 84
 					)),
85 85
 					'pdf_logo_image'=>new EE_Admin_File_Uploader_Input(array(
86
-						'html_label_text'=>  sprintf(__("Logo Image %s", "event_espresso"),  $this->get_help_tab_link()),
86
+						'html_label_text'=>  sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()),
87 87
 						'default'=>  EE_Config::instance()->organization->logo_url,
88 88
 						'html_help_text'=>  __("(Logo for the top left of the invoice)", 'event_espresso'),
89 89
 					)),
90 90
 					$confirmation_text_input_name =>new EE_Text_Area_Input(array(
91
-						'html_label_text'=>  sprintf(__("Confirmation Text %s", "event_espresso"),  $this->get_help_tab_link()),
91
+						'html_label_text'=>  sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()),
92 92
 						'default'=>  __("Payment must be received within 48 hours of event date.  Details about where to send payment is included on the invoice.", 'event_espresso'),
93
-						'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ),
93
+						'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()),
94 94
 					)),
95 95
 					'page_extra_info'=>new EE_Text_Area_Input(array(
96
-						'html_label_text'=>  sprintf(__("Extra Info %s", "event_espresso"),  $this->get_help_tab_link()),
97
-						'validation_strategies' => array( new EE_Full_HTML_Validation_Strategy() ),
96
+						'html_label_text'=>  sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()),
97
+						'validation_strategies' => array(new EE_Full_HTML_Validation_Strategy()),
98 98
 					)),
99 99
 				),
100 100
 				'include'=>array(
101
-					'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency','PMD_order',
102
-					$pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image',
101
+					'PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', 'PMD_order',
102
+					$pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image',
103 103
 					$confirmation_text_input_name, 'page_extra_info'),
104 104
 			));
105 105
 		$form->add_subsections(
106
-			array( 'header1' => new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_display.template.php' )),
106
+			array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')),
107 107
 			$pdf_payee_input_name
108 108
 		);
109 109
 		$form->add_subsections(
110
-			array( 'header2'=>new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php' )),
110
+			array('header2'=>new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')),
111 111
 			$confirmation_text_input_name
112 112
 		);
113 113
 		return $form;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 * @see EE_PMT_Base::help_tabs_config()
121 121
 	 * @return array
122 122
 	 */
123
-	public function help_tabs_config(){
123
+	public function help_tabs_config() {
124 124
 		return array(
125 125
 			$this->get_help_tab_name() => array(
126 126
 				'title' => __('Invoice Settings', 'event_espresso'),
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 	 * @param \EE_Payment $payment
139 139
 	 * @return string
140 140
 	 */
141
-	public function payment_overview_content( EE_Payment $payment ){
141
+	public function payment_overview_content(EE_Payment $payment) {
142 142
 		EE_Registry::instance()->load_helper('Template');
143 143
 		return EEH_Template::locate_template(
144
-			'payment_methods' . DS . 'Invoice'. DS . 'templates'.DS.'invoice_payment_details_content.template.php',
144
+			'payment_methods'.DS.'Invoice'.DS.'templates'.DS.'invoice_payment_details_content.template.php',
145 145
 			array_merge(
146 146
 				array(
147 147
 					'payment_method'			=> $this->_pm_instance,
148 148
 					'payment'						=> $payment,
149 149
 					'page_confirmation_text'					=> '',
150 150
 					'page_extra_info'	=> '',
151
-					'invoice_url' 					=> $payment->transaction()->primary_registration()->invoice_url( 'html' )
151
+					'invoice_url' 					=> $payment->transaction()->primary_registration()->invoice_url('html')
152 152
 				),
153 153
 				$this->_pm_instance->all_extra_meta_array()
154 154
 			)
Please login to merge, or discard this patch.
shortcodes/espresso_checkout/EES_Espresso_Checkout.shortcode.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 	 * @param WP $WP
52 52
 	 * @return    void
53 53
 	 */
54
-	public function run( WP $WP ) {
55
-		if ( did_action( 'pre_get_posts' ) && did_action( 'send_headers' ) ) {
54
+	public function run(WP $WP) {
55
+		if (did_action('pre_get_posts') && did_action('send_headers')) {
56 56
 			global $wp_query;
57 57
 			EED_Single_Page_Checkout::load_reg_steps();
58
-			EED_Single_Page_Checkout::init( $wp_query );
58
+			EED_Single_Page_Checkout::init($wp_query);
59 59
 		} else {
60 60
 			// 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
61
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
61
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
62 62
 			// this will trigger the EED_Single_Page_Checkout module's run() method during the pre_get_posts hook point,
63 63
 			// this allows us to initialize things, enqueue assets, etc,
64
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'init' ), 10, 1 );
64
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'init'), 10, 1);
65 65
 		}
66 66
 	}
67 67
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 *  @param		array 	$attributes
75 75
 	 *  @return 	string
76 76
 	 */
77
-	public function process_shortcode( $attributes = array() ) {
77
+	public function process_shortcode($attributes = array()) {
78 78
 		return EE_Registry::instance()->REQ->get_output();
79 79
 	}
80 80
 
Please login to merge, or discard this patch.
modules/single_page_checkout/EED_Single_Page_Checkout.module.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 *    process_registration_from_admin
281 281
 	 *
282 282
 	 * @access    public
283
-	 * @return    int
283
+	 * @return    EE_Transaction
284 284
 	 */
285 285
 	public static function process_registration_from_admin() {
286 286
 		EED_Single_Page_Checkout::load_reg_steps();
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	 * _get_transaction_and_cart_for_previous_visit
609 609
 	 *
610 610
 	 * @access private
611
-	 * 	@return mixed EE_Transaction|NULL
611
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
612 612
 	 */
613 613
 	private function _get_transaction_and_cart_for_previous_visit() {
614 614
 		/** @var $TXN_model EEM_Transaction */
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 * 	generates a new EE_Transaction object and adds it to the $_transaction property.
678 678
 	 *
679 679
 	 * 	@access private
680
-	 * 	@return mixed EE_Transaction|NULL
680
+	 * 	@return EE_Transaction|null EE_Transaction|NULL
681 681
 	 */
682 682
 	private function _initialize_transaction() {
683 683
 		try {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -817,12 +817,12 @@
 block discarded – undo
817 817
 			if ( $registration instanceof EE_Registration ) {
818 818
 				// we display all attendee info for the primary registrant
819 819
 				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
820
-				     && $registration->is_primary_registrant()
820
+					 && $registration->is_primary_registrant()
821 821
 				) {
822 822
 					$this->checkout->primary_revisit = true;
823 823
 					break;
824 824
 				} else if ( $this->checkout->revisit
825
-				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
825
+							&& $this->checkout->reg_url_link !== $registration->reg_url_link()
826 826
 				) {
827 827
 					// but hide info if it doesn't belong to you
828 828
 					$transaction->clear_cache( 'Registration', $registration->ID() );
Please login to merge, or discard this patch.
Spacing   +262 added lines, -262 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed');}
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {exit('No direct script access allowed'); }
2 2
 /**
3 3
  * Single Page Checkout (SPCO)
4 4
  *
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @return EED_Single_Page_Checkout
48 48
 	 */
49 49
 	public static function instance() {
50
-		add_filter( 'EED_Single_Page_Checkout__SPCO_active', '__return_true' );
51
-		return parent::get_instance( __CLASS__ );
50
+		add_filter('EED_Single_Page_Checkout__SPCO_active', '__return_true');
51
+		return parent::get_instance(__CLASS__);
52 52
 	}
53 53
 
54 54
 
@@ -93,22 +93,22 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public static function set_hooks_admin() {
95 95
 		EED_Single_Page_Checkout::set_definitions();
96
-		if ( defined( 'DOING_AJAX' )) {
96
+		if (defined('DOING_AJAX')) {
97 97
 			// going to start an output buffer in case anything gets accidentally output that might disrupt our JSON response
98 98
 			ob_start();
99 99
 			EED_Single_Page_Checkout::load_request_handler();
100 100
 			EED_Single_Page_Checkout::load_reg_steps();
101 101
 		} else {
102 102
 			// 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
103
-			add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 );
103
+			add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1);
104 104
 		}
105 105
 		// set ajax hooks
106
-		add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
107
-		add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' ));
108
-		add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
109
-		add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' ));
110
-		add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
111
-		add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' ));
106
+		add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
107
+		add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step'));
108
+		add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
109
+		add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step'));
110
+		add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
111
+		add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step'));
112 112
 	}
113 113
 
114 114
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	 * @param string $ajax_action
120 120
 	 * @throws \EE_Error
121 121
 	 */
122
-	public static function process_ajax_request( $ajax_action ) {
123
-		EE_Registry::instance()->REQ->set( 'action', $ajax_action );
122
+	public static function process_ajax_request($ajax_action) {
123
+		EE_Registry::instance()->REQ->set('action', $ajax_action);
124 124
 		EED_Single_Page_Checkout::instance()->_initialize();
125 125
 	}
126 126
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @throws \EE_Error
133 133
 	 */
134 134
 	public static function display_reg_step() {
135
-		EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' );
135
+		EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step');
136 136
 	}
137 137
 
138 138
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @throws \EE_Error
144 144
 	 */
145 145
 	public static function process_reg_step() {
146
-		EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' );
146
+		EED_Single_Page_Checkout::process_ajax_request('process_reg_step');
147 147
 	}
148 148
 
149 149
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 * @throws \EE_Error
155 155
 	 */
156 156
 	public static function update_reg_step() {
157
-		EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' );
157
+		EED_Single_Page_Checkout::process_ajax_request('update_reg_step');
158 158
 	}
159 159
 
160 160
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @throws \EE_Error
168 168
 	 */
169 169
 	public static function update_checkout() {
170
-		EED_Single_Page_Checkout::process_ajax_request( 'update_checkout' );
170
+		EED_Single_Page_Checkout::process_ajax_request('update_checkout');
171 171
 	}
172 172
 
173 173
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	public static function load_request_handler() {
182 182
 		// load core Request_Handler class
183
-		if ( ! isset( EE_Registry::instance()->REQ )) {
184
-			EE_Registry::instance()->load_core( 'Request_Handler' );
183
+		if ( ! isset(EE_Registry::instance()->REQ)) {
184
+			EE_Registry::instance()->load_core('Request_Handler');
185 185
 		}
186 186
 	}
187 187
 
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
 	 * @throws \EE_Error
196 196
 	 */
197 197
 	public static function set_definitions() {
198
-		define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS );
199
-		define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS );
200
-		define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS );
201
-		define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS );
202
-		define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS );
203
-		define( 'SPCO_REG_STEPS_PATH', SPCO_BASE_PATH . 'reg_steps' . DS );
204
-		define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS );
205
-		EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE );
198
+		define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS);
199
+		define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS);
200
+		define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS);
201
+		define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS);
202
+		define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS);
203
+		define('SPCO_REG_STEPS_PATH', SPCO_BASE_PATH.'reg_steps'.DS);
204
+		define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS);
205
+		EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE);
206 206
 	}
207 207
 
208 208
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 */
218 218
 	public static function load_reg_steps() {
219 219
 		static $reg_steps_loaded = FALSE;
220
-		if ( $reg_steps_loaded ) {
220
+		if ($reg_steps_loaded) {
221 221
 			return;
222 222
 		}
223 223
 		// filter list of reg_steps
@@ -226,24 +226,24 @@  discard block
 block discarded – undo
226 226
 			EED_Single_Page_Checkout::get_reg_steps()
227 227
 		);
228 228
 		// sort by key (order)
229
-		ksort( $reg_steps_to_load );
229
+		ksort($reg_steps_to_load);
230 230
 		// loop through folders
231
-		foreach ( $reg_steps_to_load as $order => $reg_step ) {
231
+		foreach ($reg_steps_to_load as $order => $reg_step) {
232 232
 			// we need a
233
-			if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
233
+			if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
234 234
 				// copy over to the reg_steps_array
235
-				EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step;
235
+				EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step;
236 236
 				// register custom key route for each reg step
237 237
 				// ie: step=>"slug" - this is the entire reason we load the reg steps array now
238
-				EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' );
238
+				EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step');
239 239
 				// add AJAX or other hooks
240
-				if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) {
240
+				if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) {
241 241
 					// setup autoloaders if necessary
242
-					if ( ! class_exists( $reg_step['class_name'] )) {
243
-						EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE );
242
+					if ( ! class_exists($reg_step['class_name'])) {
243
+						EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE);
244 244
 					}
245
-					if ( is_callable( $reg_step['class_name'], 'set_hooks' )) {
246
-						call_user_func( array( $reg_step['class_name'], 'set_hooks' ));
245
+					if (is_callable($reg_step['class_name'], 'set_hooks')) {
246
+						call_user_func(array($reg_step['class_name'], 'set_hooks'));
247 247
 					}
248 248
 				}
249 249
 			}
@@ -262,28 +262,28 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	public static function get_reg_steps() {
264 264
 		$reg_steps = EE_Registry::instance()->CFG->registration->reg_steps;
265
-		if ( empty( $reg_steps )) {
265
+		if (empty($reg_steps)) {
266 266
 			$reg_steps = array(
267 267
 				10 => array(
268
-					'file_path' => SPCO_REG_STEPS_PATH . 'attendee_information',
268
+					'file_path' => SPCO_REG_STEPS_PATH.'attendee_information',
269 269
 					'class_name' => 'EE_SPCO_Reg_Step_Attendee_Information',
270 270
 					'slug' => 'attendee_information',
271 271
 					'has_hooks' => FALSE
272 272
 				),
273 273
 				20 => array(
274
-					'file_path' => SPCO_REG_STEPS_PATH . 'registration_confirmation',
274
+					'file_path' => SPCO_REG_STEPS_PATH.'registration_confirmation',
275 275
 					'class_name' => 'EE_SPCO_Reg_Step_Registration_Confirmation',
276 276
 					'slug' => 'registration_confirmation',
277 277
 					'has_hooks' => FALSE
278 278
 				),
279 279
 				30 => array(
280
-					'file_path' => SPCO_REG_STEPS_PATH . 'payment_options',
280
+					'file_path' => SPCO_REG_STEPS_PATH.'payment_options',
281 281
 					'class_name' => 'EE_SPCO_Reg_Step_Payment_Options',
282 282
 					'slug' => 'payment_options',
283 283
 					'has_hooks' => TRUE
284 284
 				),
285 285
 				999 => array(
286
-					'file_path' => SPCO_REG_STEPS_PATH . 'finalize_registration',
286
+					'file_path' => SPCO_REG_STEPS_PATH.'finalize_registration',
287 287
 					'class_name' => 'EE_SPCO_Reg_Step_Finalize_Registration',
288 288
 					'slug' => 'finalize_registration',
289 289
 					'has_hooks' => FALSE
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 	 */
305 305
 	public static function registration_checkout_for_admin() {
306 306
 		EED_Single_Page_Checkout::load_reg_steps();
307
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
308
-		EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' );
309
-		EE_Registry::instance()->REQ->set( 'process_form_submission', false );
307
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
308
+		EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step');
309
+		EE_Registry::instance()->REQ->set('process_form_submission', false);
310 310
 		EED_Single_Page_Checkout::instance()->_initialize();
311 311
 		EED_Single_Page_Checkout::instance()->_display_spco_reg_form();
312 312
 		return EE_Registry::instance()->REQ->get_output();
@@ -323,15 +323,15 @@  discard block
 block discarded – undo
323 323
 	 */
324 324
 	public static function process_registration_from_admin() {
325 325
 		EED_Single_Page_Checkout::load_reg_steps();
326
-		EE_Registry::instance()->REQ->set( 'step', 'attendee_information' );
327
-		EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' );
328
-		EE_Registry::instance()->REQ->set( 'process_form_submission', true );
326
+		EE_Registry::instance()->REQ->set('step', 'attendee_information');
327
+		EE_Registry::instance()->REQ->set('action', 'process_reg_step');
328
+		EE_Registry::instance()->REQ->set('process_form_submission', true);
329 329
 		EED_Single_Page_Checkout::instance()->_initialize();
330
-		if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) {
331
-			$final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps );
332
-			if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
333
-				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated( $final_reg_step );
334
-				if ( $final_reg_step->process_reg_step() ) {
330
+		if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) {
331
+			$final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps);
332
+			if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
333
+				EED_Single_Page_Checkout::instance()->checkout->set_reg_step_initiated($final_reg_step);
334
+				if ($final_reg_step->process_reg_step()) {
335 335
 					$final_reg_step->set_completed();
336 336
 					EED_Single_Page_Checkout::instance()->checkout->update_txn_reg_steps_array();
337 337
 					return EED_Single_Page_Checkout::instance()->checkout->transaction;
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
 	 * @return    void
352 352
 	 * @throws \EE_Error
353 353
 	 */
354
-	public function run( $WP_Query ) {
354
+	public function run($WP_Query) {
355 355
 		if (
356 356
 			$WP_Query instanceof WP_Query
357 357
 			&& $WP_Query->is_main_query()
358
-			&& apply_filters( 'FHEE__EED_Single_Page_Checkout__run', true )
358
+			&& apply_filters('FHEE__EED_Single_Page_Checkout__run', true)
359 359
 		) {
360 360
 			$this->_initialize();
361 361
 		}
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 	 * @return    void
372 372
 	 * @throws \EE_Error
373 373
 	 */
374
-	public static function init( $WP_Query ) {
375
-		EED_Single_Page_Checkout::instance()->run( $WP_Query );
374
+	public static function init($WP_Query) {
375
+		EED_Single_Page_Checkout::instance()->run($WP_Query);
376 376
 	}
377 377
 
378 378
 
@@ -386,34 +386,34 @@  discard block
 block discarded – undo
386 386
 	 */
387 387
 	private function _initialize() {
388 388
 		// ensure SPCO doesn't run twice
389
-		if ( EED_Single_Page_Checkout::$_initialized ) {
389
+		if (EED_Single_Page_Checkout::$_initialized) {
390 390
 			return;
391 391
 		}
392 392
 		try {
393 393
 			// setup the EE_Checkout object
394 394
 			$this->checkout = $this->_initialize_checkout();
395 395
 			// filter checkout
396
-			$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout );
396
+			$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize__checkout', $this->checkout);
397 397
 			// get the $_GET
398 398
 			$this->_get_request_vars();
399 399
 			// filter continue_reg
400
-			$this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout );
400
+			$this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout);
401 401
 			// load the reg steps array
402
-			if ( ! $this->_load_and_instantiate_reg_steps() ) {
402
+			if ( ! $this->_load_and_instantiate_reg_steps()) {
403 403
 				EED_Single_Page_Checkout::$_initialized = true;
404 404
 				return;
405 405
 			}
406 406
 			// set the current step
407
-			$this->checkout->set_current_step( $this->checkout->step );
407
+			$this->checkout->set_current_step($this->checkout->step);
408 408
 			// and the next step
409 409
 			$this->checkout->set_next_step();
410 410
 			// was there already a valid transaction in the checkout from the session ?
411
-			if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
411
+			if ( ! $this->checkout->transaction instanceof EE_Transaction) {
412 412
 				// get transaction from db or session
413 413
 				$this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin()
414 414
 					? $this->_get_transaction_and_cart_for_previous_visit()
415 415
 					: $this->_get_cart_for_current_session_and_setup_new_transaction();
416
-				if ( ! $this->checkout->transaction instanceof EE_Transaction ) {
416
+				if ( ! $this->checkout->transaction instanceof EE_Transaction) {
417 417
 					// add some style and make it dance
418 418
 					$this->checkout->transaction = EE_Transaction::new_instance();
419 419
 					$this->add_styles_and_scripts();
@@ -421,10 +421,10 @@  discard block
 block discarded – undo
421 421
 					return;
422 422
 				}
423 423
 				// and the registrations for the transaction
424
-				$this->_get_registrations( $this->checkout->transaction );
424
+				$this->_get_registrations($this->checkout->transaction);
425 425
 			}
426 426
 			// verify that everything has been setup correctly
427
-			if ( ! $this->_final_verifications() ) {
427
+			if ( ! $this->_final_verifications()) {
428 428
 				EED_Single_Page_Checkout::$_initialized = true;
429 429
 				return;
430 430
 			}
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
 			// set no cache headers and constants
450 450
 			EE_System::do_not_cache();
451 451
 			// add anchor
452
-			add_action( 'loop_start', array( $this, 'set_checkout_anchor' ), 1 );
453
-		} catch ( Exception $e ) {
454
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__ );
452
+			add_action('loop_start', array($this, 'set_checkout_anchor'), 1);
453
+		} catch (Exception $e) {
454
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
455 455
 		}
456 456
 	}
457 457
 
@@ -469,20 +469,20 @@  discard block
 block discarded – undo
469 469
 		// look in session for existing checkout
470 470
 		$checkout = EE_Registry::instance()->SSN->checkout();
471 471
 		// verify
472
-		if ( ! $checkout instanceof EE_Checkout ) {
472
+		if ( ! $checkout instanceof EE_Checkout) {
473 473
 			// instantiate EE_Checkout object for handling the properties of the current checkout process
474
-			$checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE  );
474
+			$checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE);
475 475
 		} else {
476
-			if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true )  {
476
+			if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) {
477 477
 				$this->unlock_transaction();
478
-				wp_safe_redirect( $checkout->redirect_url );
478
+				wp_safe_redirect($checkout->redirect_url);
479 479
 				exit();
480 480
 			}
481 481
 		}
482
-		$checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout );
482
+		$checkout = apply_filters('FHEE__EED_Single_Page_Checkout___initialize_checkout__checkout', $checkout);
483 483
 		// verify again
484
-		if ( ! $checkout instanceof EE_Checkout ) {
485
-			throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) );
484
+		if ( ! $checkout instanceof EE_Checkout) {
485
+			throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso'));
486 486
 		}
487 487
 		// reset anything that needs a clean slate for each request
488 488
 		$checkout->reset_for_current_request();
@@ -502,24 +502,24 @@  discard block
 block discarded – undo
502 502
 		// load classes
503 503
 		EED_Single_Page_Checkout::load_request_handler();
504 504
 		//make sure this request is marked as belonging to EE
505
-		EE_Registry::instance()->REQ->set_espresso_page( TRUE );
505
+		EE_Registry::instance()->REQ->set_espresso_page(TRUE);
506 506
 		// which step is being requested ?
507
-		$this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() );
507
+		$this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step());
508 508
 		// which step is being edited ?
509
-		$this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' );
509
+		$this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', '');
510 510
 		// and what we're doing on the current step
511
-		$this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' );
511
+		$this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step');
512 512
 		// returning to edit ?
513
-		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' );
513
+		$this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', '');
514 514
 		// or some other kind of revisit ?
515
-		$this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE );
515
+		$this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE);
516 516
 		// and whether or not to generate a reg form for this request
517
-		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); 		// TRUE 	FALSE
517
+		$this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE 	FALSE
518 518
 		// and whether or not to process a reg form submission for this request
519
-		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); 		// TRUE 	FALSE
519
+		$this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE 	FALSE
520 520
 		$this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step'
521 521
 			? $this->checkout->process_form_submission
522
-			: FALSE; 		// TRUE 	FALSE
522
+			: FALSE; // TRUE 	FALSE
523 523
 		// $this->_display_request_vars();
524 524
 	}
525 525
 
@@ -532,17 +532,17 @@  discard block
 block discarded – undo
532 532
 	 * @return    void
533 533
 	 */
534 534
 	protected function _display_request_vars() {
535
-		if ( ! WP_DEBUG ) {
535
+		if ( ! WP_DEBUG) {
536 536
 			return;
537 537
 		}
538
-		EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
539
-		EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ );
540
-		EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ );
541
-		EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ );
542
-		EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ );
543
-		EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ );
544
-		EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ );
545
-		EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ );
538
+		EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__);
539
+		EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__);
540
+		EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__);
541
+		EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__);
542
+		EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__);
543
+		EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__);
544
+		EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__);
545
+		EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__);
546 546
 	}
547 547
 
548 548
 
@@ -556,8 +556,8 @@  discard block
 block discarded – undo
556 556
 	 * @return    array
557 557
 	 */
558 558
 	private function _get_first_step() {
559
-		$first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array );
560
-		return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information';
559
+		$first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array);
560
+		return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information';
561 561
 	}
562 562
 
563 563
 
@@ -573,27 +573,27 @@  discard block
 block discarded – undo
573 573
 	private function _load_and_instantiate_reg_steps() {
574 574
 		// have reg_steps already been instantiated ?
575 575
 		if (
576
-			empty( $this->checkout->reg_steps ) ||
577
-			apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout )
576
+			empty($this->checkout->reg_steps) ||
577
+			apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reload_reg_steps', false, $this->checkout)
578 578
 		) {
579 579
 			// if not, then loop through raw reg steps array
580
-			foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) {
581
-				if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) {
580
+			foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) {
581
+				if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) {
582 582
 					return false;
583 583
 				}
584 584
 			}
585 585
 			EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE;
586 586
 			EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE;
587 587
 			// skip the registration_confirmation page ?
588
-			if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) {
588
+			if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) {
589 589
 				// just remove it from the reg steps array
590
-				$this->checkout->remove_reg_step( 'registration_confirmation', false );
590
+				$this->checkout->remove_reg_step('registration_confirmation', false);
591 591
 			} else if (
592
-				isset( $this->checkout->reg_steps['registration_confirmation'] )
592
+				isset($this->checkout->reg_steps['registration_confirmation'])
593 593
 				&& EE_Registry::instance()->CFG->registration->reg_confirmation_last
594 594
 			) {
595 595
 				// set the order to something big like 100
596
-				$this->checkout->set_reg_step_order( 'registration_confirmation', 100 );
596
+				$this->checkout->set_reg_step_order('registration_confirmation', 100);
597 597
 			}
598 598
 			// filter the array for good luck
599 599
 			$this->checkout->reg_steps = apply_filters(
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
 			// finally re-sort based on the reg step class order properties
604 604
 			$this->checkout->sort_reg_steps();
605 605
 		} else {
606
-			foreach ( $this->checkout->reg_steps as $reg_step ) {
606
+			foreach ($this->checkout->reg_steps as $reg_step) {
607 607
 				// set all current step stati to FALSE
608
-				$reg_step->set_is_current_step( FALSE );
608
+				$reg_step->set_is_current_step(FALSE);
609 609
 			}
610 610
 		}
611
-		if ( empty( $this->checkout->reg_steps )) {
612
-			EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
611
+		if (empty($this->checkout->reg_steps)) {
612
+			EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
613 613
 			return false;
614 614
 		}
615 615
 			// make reg step details available to JS
@@ -627,10 +627,10 @@  discard block
 block discarded – undo
627 627
 	 * @param int   $order
628 628
 	 * @return bool
629 629
 	 */
630
-	private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) {
630
+	private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) {
631 631
 
632 632
 		// we need a file_path, class_name, and slug to add a reg step
633
-		if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) {
633
+		if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) {
634 634
 			// if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step)
635 635
 			if (
636 636
 				$this->checkout->reg_url_link
@@ -648,26 +648,26 @@  discard block
 block discarded – undo
648 648
 				FALSE
649 649
 			);
650 650
 			// did we gets the goods ?
651
-			if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) {
651
+			if ($reg_step_obj instanceof EE_SPCO_Reg_Step) {
652 652
 				// set reg step order based on config
653
-				$reg_step_obj->set_order( $order );
653
+				$reg_step_obj->set_order($order);
654 654
 				// add instantiated reg step object to the master reg steps array
655
-				$this->checkout->add_reg_step( $reg_step_obj );
655
+				$this->checkout->add_reg_step($reg_step_obj);
656 656
 			} else {
657 657
 				EE_Error::add_error(
658
-					__( 'The current step could not be set.', 'event_espresso' ),
658
+					__('The current step could not be set.', 'event_espresso'),
659 659
 					__FILE__, __FUNCTION__, __LINE__
660 660
 				);
661 661
 				return false;
662 662
 			}
663 663
 		} else {
664
-			if ( WP_DEBUG ) {
664
+			if (WP_DEBUG) {
665 665
 				EE_Error::add_error(
666 666
 					sprintf(
667
-						__( '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' ),
668
-						isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '',
669
-						isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '',
670
-						isset( $reg_step['slug'] ) ? $reg_step['slug'] : '',
667
+						__('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'),
668
+						isset($reg_step['file_path']) ? $reg_step['file_path'] : '',
669
+						isset($reg_step['class_name']) ? $reg_step['class_name'] : '',
670
+						isset($reg_step['slug']) ? $reg_step['slug'] : '',
671 671
 						'<ul>',
672 672
 						'<li>',
673 673
 						'</li>',
@@ -691,16 +691,16 @@  discard block
 block discarded – undo
691 691
 	 */
692 692
 	private function _get_transaction_and_cart_for_previous_visit() {
693 693
 		/** @var $TXN_model EEM_Transaction */
694
-		$TXN_model = EE_Registry::instance()->load_model( 'Transaction' );
694
+		$TXN_model = EE_Registry::instance()->load_model('Transaction');
695 695
 		// 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
696
-		$transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link );
696
+		$transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link);
697 697
 		// verify transaction
698
-		if ( $transaction instanceof EE_Transaction ) {
698
+		if ($transaction instanceof EE_Transaction) {
699 699
 			// and get the cart that was used for that transaction
700
-			$this->checkout->cart = $this->_get_cart_for_transaction( $transaction );
700
+			$this->checkout->cart = $this->_get_cart_for_transaction($transaction);
701 701
 			return $transaction;
702 702
 		} else {
703
-			EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
703
+			EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
704 704
 			return NULL;
705 705
 		}
706 706
 	}
@@ -714,8 +714,8 @@  discard block
 block discarded – undo
714 714
 	 * @param EE_Transaction $transaction
715 715
 	 * @return EE_Cart
716 716
 	 */
717
-	private function _get_cart_for_transaction( $transaction ) {
718
-		return $this->checkout->get_cart_for_transaction( $transaction );
717
+	private function _get_cart_for_transaction($transaction) {
718
+		return $this->checkout->get_cart_for_transaction($transaction);
719 719
 	}
720 720
 
721 721
 
@@ -727,8 +727,8 @@  discard block
 block discarded – undo
727 727
 	 * @param EE_Transaction $transaction
728 728
 	 * @return EE_Cart
729 729
 	 */
730
-	public function get_cart_for_transaction( EE_Transaction $transaction ) {
731
-		return $this->checkout->get_cart_for_transaction( $transaction );
730
+	public function get_cart_for_transaction(EE_Transaction $transaction) {
731
+		return $this->checkout->get_cart_for_transaction($transaction);
732 732
 	}
733 733
 
734 734
 
@@ -744,17 +744,17 @@  discard block
 block discarded – undo
744 744
 	private function _get_cart_for_current_session_and_setup_new_transaction() {
745 745
 		//  if there's no transaction, then this is the FIRST visit to SPCO
746 746
 		// so load up the cart ( passing nothing for the TXN because it doesn't exist yet )
747
-		$this->checkout->cart = $this->_get_cart_for_transaction( NULL );
747
+		$this->checkout->cart = $this->_get_cart_for_transaction(NULL);
748 748
 		// and then create a new transaction
749 749
 		$transaction = $this->_initialize_transaction();
750 750
 		// verify transaction
751
-		if ( $transaction instanceof EE_Transaction ) {
751
+		if ($transaction instanceof EE_Transaction) {
752 752
 			// save it so that we have an ID for other objects to use
753 753
 			$transaction->save();
754 754
 			// and save TXN data to the cart
755
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() );
755
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID());
756 756
 		} else {
757
-			EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
757
+			EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
758 758
 		}
759 759
 		return $transaction;
760 760
 	}
@@ -774,15 +774,15 @@  discard block
 block discarded – undo
774 774
 			// grab the cart grand total
775 775
 			$cart_total = $this->checkout->cart->get_cart_grand_total();
776 776
 			// create new TXN
777
-			return EE_Transaction::new_instance( array(
777
+			return EE_Transaction::new_instance(array(
778 778
 				'TXN_timestamp' 	=> time(),
779 779
 				'TXN_reg_steps' 		=> $this->checkout->initialize_txn_reg_steps_array(),
780 780
 				'TXN_total' 				=> $cart_total > 0 ? $cart_total : 0,
781 781
 				'TXN_paid' 				=> 0,
782 782
 				'STS_ID' 					=> EEM_Transaction::failed_status_code,
783 783
 			));
784
-		} catch( Exception $e ) {
785
-			EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
784
+		} catch (Exception $e) {
785
+			EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__);
786 786
 		}
787 787
 		return NULL;
788 788
 	}
@@ -797,38 +797,38 @@  discard block
 block discarded – undo
797 797
 	 * @return EE_Cart
798 798
 	 * @throws \EE_Error
799 799
 	 */
800
-	private function _get_registrations( EE_Transaction $transaction ) {
800
+	private function _get_registrations(EE_Transaction $transaction) {
801 801
 		// first step: grab the registrants  { : o
802
-		$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, true );
802
+		$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, true);
803 803
 		// verify registrations have been set
804
-		if ( empty( $registrations )) {
804
+		if (empty($registrations)) {
805 805
 			// if no cached registrations, then check the db
806
-			$registrations = $transaction->registrations( $this->checkout->reg_cache_where_params, false );
806
+			$registrations = $transaction->registrations($this->checkout->reg_cache_where_params, false);
807 807
 			// still nothing ? well as long as this isn't a revisit
808
-			if ( empty( $registrations ) && ! $this->checkout->revisit ) {
808
+			if (empty($registrations) && ! $this->checkout->revisit) {
809 809
 				// generate new registrations from scratch
810
-				$registrations = $this->_initialize_registrations( $transaction );
810
+				$registrations = $this->_initialize_registrations($transaction);
811 811
 			}
812 812
 		}
813 813
 		// sort by their original registration order
814
-		usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' ));
814
+		usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count'));
815 815
 		// then loop thru the array
816
-		foreach ( $registrations as $registration ) {
816
+		foreach ($registrations as $registration) {
817 817
 			// verify each registration
818
-			if ( $registration instanceof EE_Registration ) {
818
+			if ($registration instanceof EE_Registration) {
819 819
 				// we display all attendee info for the primary registrant
820
-				if ( $this->checkout->reg_url_link === $registration->reg_url_link()
820
+				if ($this->checkout->reg_url_link === $registration->reg_url_link()
821 821
 				     && $registration->is_primary_registrant()
822 822
 				) {
823 823
 					$this->checkout->primary_revisit = true;
824 824
 					break;
825
-				} else if ( $this->checkout->revisit
825
+				} else if ($this->checkout->revisit
826 826
 				            && $this->checkout->reg_url_link !== $registration->reg_url_link()
827 827
 				) {
828 828
 					// but hide info if it doesn't belong to you
829
-					$transaction->clear_cache( 'Registration', $registration->ID() );
829
+					$transaction->clear_cache('Registration', $registration->ID());
830 830
 				}
831
-				$this->checkout->set_reg_status_updated( $registration->ID(), false );
831
+				$this->checkout->set_reg_status_updated($registration->ID(), false);
832 832
 			}
833 833
 		}
834 834
 	}
@@ -843,17 +843,17 @@  discard block
 block discarded – undo
843 843
 	 * @return    array
844 844
 	 * @throws \EE_Error
845 845
 	 */
846
-	private function _initialize_registrations( EE_Transaction $transaction ) {
846
+	private function _initialize_registrations(EE_Transaction $transaction) {
847 847
 		$att_nmbr = 0;
848 848
 		$registrations = array();
849
-		if ( $transaction instanceof EE_Transaction ) {
849
+		if ($transaction instanceof EE_Transaction) {
850 850
 			/** @type EE_Registration_Processor $registration_processor */
851
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
851
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
852 852
 			$this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count();
853 853
 			// now let's add the cart items to the $transaction
854
-			foreach ( $this->checkout->cart->get_tickets() as $line_item ) {
854
+			foreach ($this->checkout->cart->get_tickets() as $line_item) {
855 855
 				//do the following for each ticket of this type they selected
856
-				for ( $x = 1; $x <= $line_item->quantity(); $x++ ) {
856
+				for ($x = 1; $x <= $line_item->quantity(); $x++) {
857 857
 					$att_nmbr++;
858 858
 					$registration = $registration_processor->generate_ONE_registration_from_line_item(
859 859
 						$line_item,
@@ -861,12 +861,12 @@  discard block
 block discarded – undo
861 861
 						$att_nmbr,
862 862
 						$this->checkout->total_ticket_count
863 863
 					);
864
-					if ( $registration instanceof EE_Registration ) {
865
-						$registrations[ $registration->ID() ] = $registration;
864
+					if ($registration instanceof EE_Registration) {
865
+						$registrations[$registration->ID()] = $registration;
866 866
 					}
867 867
 				}
868 868
 			}
869
-			$registration_processor->fix_reg_final_price_rounding_issue( $transaction );
869
+			$registration_processor->fix_reg_final_price_rounding_issue($transaction);
870 870
 		}
871 871
 		return $registrations;
872 872
 	}
@@ -881,12 +881,12 @@  discard block
 block discarded – undo
881 881
 	 * @param EE_Registration $reg_B
882 882
 	 * @return array()
883 883
 	 */
884
-	public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) {
884
+	public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) {
885 885
 		// this shouldn't ever happen within the same TXN, but oh well
886
-		if ( $reg_A->count() === $reg_B->count() ) {
886
+		if ($reg_A->count() === $reg_B->count()) {
887 887
 			return 0;
888 888
 		}
889
-		return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1;
889
+		return ($reg_A->count() > $reg_B->count()) ? 1 : -1;
890 890
 	}
891 891
 
892 892
 
@@ -901,21 +901,21 @@  discard block
 block discarded – undo
901 901
 	 */
902 902
 	private function _final_verifications() {
903 903
 		// filter checkout
904
-		$this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout );
904
+		$this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
905 905
 		//verify that current step is still set correctly
906
-		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) {
907
-			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__ );
906
+		if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
907
+			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__);
908 908
 			return false;
909 909
 		}
910 910
 		// if returning to SPCO, then verify that primary registrant is set
911
-		if ( ! empty( $this->checkout->reg_url_link )) {
911
+		if ( ! empty($this->checkout->reg_url_link)) {
912 912
 			$valid_registrant = $this->checkout->transaction->primary_registration();
913
-			if ( ! $valid_registrant instanceof EE_Registration ) {
914
-				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__ );
913
+			if ( ! $valid_registrant instanceof EE_Registration) {
914
+				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__);
915 915
 				return false;
916 916
 			}
917 917
 			$valid_registrant = null;
918
-			foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) {
918
+			foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
919 919
 				if (
920 920
 					$registration instanceof EE_Registration
921 921
 					&& $registration->reg_url_link() === $this->checkout->reg_url_link
@@ -923,9 +923,9 @@  discard block
 block discarded – undo
923 923
 					$valid_registrant = $registration;
924 924
 				}
925 925
 			}
926
-			if ( ! $valid_registrant instanceof EE_Registration ) {
926
+			if ( ! $valid_registrant instanceof EE_Registration) {
927 927
 				// hmmm... maybe we have the wrong session because the user is opening multiple tabs ?
928
-				if ( EED_Single_Page_Checkout::$_checkout_verified ) {
928
+				if (EED_Single_Page_Checkout::$_checkout_verified) {
929 929
 					// clear the session, mark the checkout as unverified, and try again
930 930
 					EE_Registry::instance()->SSN->clear_session();
931 931
 					EED_Single_Page_Checkout::$_initialized = false;
@@ -934,13 +934,13 @@  discard block
 block discarded – undo
934 934
 					EE_Error::reset_notices();
935 935
 					return false;
936 936
 				}
937
-				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__ );
937
+				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__);
938 938
 				return false;
939 939
 			}
940 940
 		}
941 941
 		// now that things have been kinda sufficiently verified,
942 942
 		// let's add the checkout to the session so that's available other systems
943
-		EE_Registry::instance()->SSN->set_checkout( $this->checkout );
943
+		EE_Registry::instance()->SSN->set_checkout($this->checkout);
944 944
 		return true;
945 945
 	}
946 946
 
@@ -955,28 +955,28 @@  discard block
 block discarded – undo
955 955
 	 * @param bool $reinitializing
956 956
 	 * @throws \EE_Error
957 957
 	 */
958
-	private function _initialize_reg_steps( $reinitializing = false ) {
959
-		$this->checkout->set_reg_step_initiated( $this->checkout->current_step );
958
+	private function _initialize_reg_steps($reinitializing = false) {
959
+		$this->checkout->set_reg_step_initiated($this->checkout->current_step);
960 960
 		// loop thru all steps to call their individual "initialize" methods and set i18n strings for JS
961
-		foreach ( $this->checkout->reg_steps as $reg_step ) {
962
-			if ( ! $reg_step->initialize_reg_step() ) {
961
+		foreach ($this->checkout->reg_steps as $reg_step) {
962
+			if ( ! $reg_step->initialize_reg_step()) {
963 963
 				// if not initialized then maybe this step is being removed...
964
-				if ( ! $reinitializing && $reg_step->is_current_step() ) {
964
+				if ( ! $reinitializing && $reg_step->is_current_step()) {
965 965
 					// if it was the current step, then we need to start over here
966
-					$this->_initialize_reg_steps( true );
966
+					$this->_initialize_reg_steps(true);
967 967
 					return;
968 968
 				}
969 969
 				continue;
970 970
 			}
971 971
 			// i18n
972 972
 			$reg_step->translate_js_strings();
973
-			if ( $reg_step->is_current_step() ) {
973
+			if ($reg_step->is_current_step()) {
974 974
 				// the text that appears on the reg step form submit button
975 975
 				$reg_step->set_submit_button_text();
976 976
 			}
977 977
 		}
978 978
 		// dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information
979
-		do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step );
979
+		do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step);
980 980
 	}
981 981
 
982 982
 
@@ -989,43 +989,43 @@  discard block
 block discarded – undo
989 989
 	 */
990 990
 	private function _check_form_submission() {
991 991
 		//does this request require the reg form to be generated ?
992
-		if ( $this->checkout->generate_reg_form ) {
992
+		if ($this->checkout->generate_reg_form) {
993 993
 			// ever heard that song by Blue Rodeo ?
994 994
 			try {
995 995
 				$this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form();
996 996
 				// if not displaying a form, then check for form submission
997
-				if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) {
997
+				if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) {
998 998
 					// clear out any old data in case this step is being run again
999
-					$this->checkout->current_step->set_valid_data( array() );
999
+					$this->checkout->current_step->set_valid_data(array());
1000 1000
 					// capture submitted form data
1001 1001
 					$this->checkout->current_step->reg_form->receive_form_submission(
1002
-						apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout )
1002
+						apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout)
1003 1003
 					);
1004 1004
 					// validate submitted form data
1005
-					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid() ) {
1005
+					if ( ! $this->checkout->continue_reg && ! $this->checkout->current_step->reg_form->is_valid()) {
1006 1006
 						// thou shall not pass !!!
1007 1007
 						$this->checkout->continue_reg = FALSE;
1008 1008
 						// any form validation errors?
1009
-						if ( $this->checkout->current_step->reg_form->submission_error_message() !== '' ) {
1009
+						if ($this->checkout->current_step->reg_form->submission_error_message() !== '') {
1010 1010
 							$submission_error_messages = array();
1011 1011
 							// bad, bad, bad registrant
1012
-							foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){
1013
-								if ( $validation_error instanceof EE_Validation_Error ) {
1012
+							foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) {
1013
+								if ($validation_error instanceof EE_Validation_Error) {
1014 1014
 									$submission_error_messages[] = sprintf(
1015
-										__( '%s : %s', 'event_espresso' ),
1015
+										__('%s : %s', 'event_espresso'),
1016 1016
 										$validation_error->get_form_section()->html_label_text(),
1017 1017
 										$validation_error->getMessage()
1018 1018
 									);
1019 1019
 								}
1020 1020
 							}
1021
-							EE_Error::add_error( implode( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ );
1021
+							EE_Error::add_error(implode('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__);
1022 1022
 						}
1023 1023
 						// well not really... what will happen is we'll just get redirected back to redo the current step
1024 1024
 						$this->go_to_next_step();
1025 1025
 						return;
1026 1026
 					}
1027 1027
 				}
1028
-			} catch( EE_Error $e ) {
1028
+			} catch (EE_Error $e) {
1029 1029
 				$e->get_error();
1030 1030
 			}
1031 1031
 		}
@@ -1042,22 +1042,22 @@  discard block
 block discarded – undo
1042 1042
 	 */
1043 1043
 	private function _process_form_action() {
1044 1044
 		// what cha wanna do?
1045
-		switch( $this->checkout->action ) {
1045
+		switch ($this->checkout->action) {
1046 1046
 			// AJAX next step reg form
1047 1047
 			case 'display_spco_reg_step' :
1048 1048
 				$this->checkout->redirect = FALSE;
1049
-				if ( EE_Registry::instance()->REQ->ajax ) {
1050
-					$this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() );
1049
+				if (EE_Registry::instance()->REQ->ajax) {
1050
+					$this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form());
1051 1051
 				}
1052 1052
 				break;
1053 1053
 
1054 1054
 			default :
1055 1055
 				// meh... do one of those other steps first
1056
-				if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) {
1056
+				if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) {
1057 1057
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step
1058
-					do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1058
+					do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1059 1059
 					// call action on current step
1060
-					if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) {
1060
+					if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) {
1061 1061
 						// good registrant, you get to proceed
1062 1062
 						if (
1063 1063
 							$this->checkout->current_step->success_message() !== ''
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 						) {
1069 1069
 								EE_Error::add_success(
1070 1070
 									$this->checkout->current_step->success_message()
1071
-									. '<br />' . $this->checkout->next_step->_instructions()
1071
+									. '<br />'.$this->checkout->next_step->_instructions()
1072 1072
 								);
1073 1073
 
1074 1074
 						}
@@ -1076,12 +1076,12 @@  discard block
 block discarded – undo
1076 1076
 						$this->_setup_redirect();
1077 1077
 					}
1078 1078
 					// dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step
1079
-					do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step );
1079
+					do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step);
1080 1080
 
1081 1081
 				} else {
1082 1082
 					EE_Error::add_error(
1083 1083
 						sprintf(
1084
-							__( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ),
1084
+							__('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'),
1085 1085
 							$this->checkout->action,
1086 1086
 							$this->checkout->current_step->name()
1087 1087
 						),
@@ -1107,10 +1107,10 @@  discard block
 block discarded – undo
1107 1107
 	public function add_styles_and_scripts() {
1108 1108
 		// i18n
1109 1109
 		$this->translate_js_strings();
1110
-		if ( $this->checkout->admin_request ) {
1111
-			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 );
1110
+		if ($this->checkout->admin_request) {
1111
+			add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1112 1112
 		} else {
1113
-			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 );
1113
+			add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10);
1114 1114
 		}
1115 1115
 	}
1116 1116
 
@@ -1126,42 +1126,42 @@  discard block
 block discarded – undo
1126 1126
 		EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit;
1127 1127
 		EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link;
1128 1128
 		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');
1129
-		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' );
1130
-		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' );
1131
-		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' );
1129
+		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');
1130
+		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');
1131
+		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');
1132 1132
 		EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso');
1133 1133
 		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');
1134
-		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/>' );
1135
-		EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' );
1134
+		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/>');
1135
+		EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language');
1136 1136
 		EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id();
1137 1137
 		EE_Registry::$i18n_js_strings['currency'] = EE_Registry::instance()->CFG->currency;
1138 1138
 		EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20';
1139
-		EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' );
1140
-		EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' );
1141
-		EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' );
1142
-		EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' );
1143
-		EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' );
1144
-		EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' );
1145
-		EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' );
1146
-		EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' );
1147
-		EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' );
1148
-		EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' );
1149
-		EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' );
1150
-		EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' );
1151
-		EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' );
1152
-		EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' );
1139
+		EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso');
1140
+		EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso');
1141
+		EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso');
1142
+		EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso');
1143
+		EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso');
1144
+		EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso');
1145
+		EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso');
1146
+		EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso');
1147
+		EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso');
1148
+		EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso');
1149
+		EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso');
1150
+		EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso');
1151
+		EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso');
1152
+		EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso');
1153 1153
 		EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf(
1154
-			__( '%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' ),
1154
+			__('%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'),
1155 1155
 			'<h4 class="important-notice">',
1156 1156
 			'</h4>',
1157 1157
 			'<br />',
1158 1158
 			'<p>',
1159
-			'<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="',
1159
+			'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1160 1160
 			'">',
1161 1161
 			'</a>',
1162 1162
 			'</p>'
1163 1163
 		);
1164
-		EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true );
1164
+		EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true);
1165 1165
 	}
1166 1166
 
1167 1167
 
@@ -1174,25 +1174,25 @@  discard block
 block discarded – undo
1174 1174
 	 */
1175 1175
 	public function enqueue_styles_and_scripts() {
1176 1176
 		// load css
1177
-		wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION );
1178
-		wp_enqueue_style( 'single_page_checkout' );
1177
+		wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION);
1178
+		wp_enqueue_style('single_page_checkout');
1179 1179
 		// load JS
1180
-		wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery	.plugin.min.js', array( 'jquery' ), '1.0.1', TRUE );
1181
-		wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery	.countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE );
1182
-		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 );
1183
-		wp_enqueue_script( 'single_page_checkout' );
1180
+		wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery	.plugin.min.js', array('jquery'), '1.0.1', TRUE);
1181
+		wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery	.countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE);
1182
+		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);
1183
+		wp_enqueue_script('single_page_checkout');
1184 1184
 
1185 1185
 		/**
1186 1186
 		 * global action hook for enqueueing styles and scripts with
1187 1187
 		 * spco calls.
1188 1188
 		 */
1189
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this );
1189
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this);
1190 1190
 
1191 1191
 		/**
1192 1192
 		 * dynamic action hook for enqueueing styles and scripts with spco calls.
1193 1193
 		 * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information
1194 1194
 		 */
1195
-		do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this );
1195
+		do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this);
1196 1196
 
1197 1197
 		// add css and JS for current step
1198 1198
 		$this->checkout->current_step->enqueue_styles_and_scripts();
@@ -1209,19 +1209,19 @@  discard block
 block discarded – undo
1209 1209
 	 */
1210 1210
 	private function _display_spco_reg_form() {
1211 1211
 		// if registering via the admin, just display the reg form for the current step
1212
-		if ( $this->checkout->admin_request ) {
1213
-			EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() );
1212
+		if ($this->checkout->admin_request) {
1213
+			EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form());
1214 1214
 		} else {
1215 1215
 			// add powered by EE msg
1216
-			add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' ));
1216
+			add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer'));
1217 1217
 
1218
-			$empty_cart = count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) ) < 1 ? true : false;
1218
+			$empty_cart = count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? true : false;
1219 1219
 			$cookies_not_set_msg = '';
1220
-			if ( $empty_cart && ! isset( $_COOKIE[ 'ee_cookie_test' ] ) ) {
1220
+			if ($empty_cart && ! isset($_COOKIE['ee_cookie_test'])) {
1221 1221
 				$cookies_not_set_msg = apply_filters(
1222 1222
 					'FHEE__Single_Page_Checkout__display_spco_reg_form__cookies_not_set_msg',
1223 1223
 					sprintf(
1224
-						__( '%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' ),
1224
+						__('%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'),
1225 1225
 						'<div class="ee-attention">',
1226 1226
 						'</div>',
1227 1227
 						'<h6 class="important-notice">',
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
 					'layout_strategy' =>
1242 1242
 						new EE_Template_Layout(
1243 1243
 							array(
1244
-								'layout_template_file' 			=> SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php',
1244
+								'layout_template_file' 			=> SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php',
1245 1245
 								'template_args' => array(
1246 1246
 									'empty_cart' 		=> $empty_cart,
1247 1247
 									'revisit' 				=> $this->checkout->revisit,
@@ -1250,8 +1250,8 @@  discard block
 block discarded – undo
1250 1250
 									'empty_msg' 		=> apply_filters(
1251 1251
 										'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
1252 1252
 										sprintf(
1253
-											__( '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' ),
1254
-											'<a href="' . get_post_type_archive_link( 'espresso_events' ) . '" title="',
1253
+											__('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'),
1254
+											'<a href="'.get_post_type_archive_link('espresso_events').'" title="',
1255 1255
 											'">',
1256 1256
 											'</a>'
1257 1257
 										)
@@ -1259,14 +1259,14 @@  discard block
 block discarded – undo
1259 1259
 									'cookies_not_set_msg' 		=> $cookies_not_set_msg,
1260 1260
 									'registration_time_limit' 	=> $this->checkout->get_registration_time_limit(),
1261 1261
 									'session_expiration' 			=>
1262
-										gmdate( 'M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) )
1262
+										gmdate('M d, Y H:i:s', EE_Registry::instance()->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS))
1263 1263
 							)
1264 1264
 						)
1265 1265
 					)
1266 1266
 				)
1267 1267
 			);
1268 1268
 			// load template and add to output sent that gets filtered into the_content()
1269
-			EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() );
1269
+			EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js());
1270 1270
 		}
1271 1271
 	}
1272 1272
 
@@ -1280,8 +1280,8 @@  discard block
 block discarded – undo
1280 1280
 	 * @internal  param string $label
1281 1281
 	 * @return        string
1282 1282
 	 */
1283
-	public function add_extra_finalize_registration_inputs( $next_step ) {
1284
-		if ( $next_step === 'finalize_registration' ) {
1283
+	public function add_extra_finalize_registration_inputs($next_step) {
1284
+		if ($next_step === 'finalize_registration') {
1285 1285
 			echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>';
1286 1286
 		}
1287 1287
 	}
@@ -1295,18 +1295,18 @@  discard block
 block discarded – undo
1295 1295
 	 *  @return 	string
1296 1296
 	 */
1297 1297
 	public static function display_registration_footer() {
1298
-		if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) {
1299
-			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1300
-			$url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'https://eventespresso.com/' );
1301
-			$url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url );
1298
+		if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) {
1299
+			EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default';
1300
+			$url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'https://eventespresso.com/');
1301
+			$url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url);
1302 1302
 			echo apply_filters(
1303 1303
 				'FHEE__EE_Front_Controller__display_registration_footer',
1304 1304
 				sprintf(
1305
-					__( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ),
1306
-					'<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="',
1305
+					__('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'),
1306
+					'<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="',
1307 1307
 					'" target="_blank">',
1308 1308
 					'</a>',
1309
-					'<a href="' . $url . '" title="',
1309
+					'<a href="'.$url.'" title="',
1310 1310
 					'" target="_blank">',
1311 1311
 					'</a></div>'
1312 1312
 				)
@@ -1337,12 +1337,12 @@  discard block
 block discarded – undo
1337 1337
 	 * @return 	array
1338 1338
 	 */
1339 1339
 	private function _setup_redirect() {
1340
-		if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
1340
+		if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
1341 1341
 			$this->checkout->redirect = TRUE;
1342
-			if ( empty( $this->checkout->redirect_url )) {
1342
+			if (empty($this->checkout->redirect_url)) {
1343 1343
 				$this->checkout->redirect_url = $this->checkout->next_step->reg_step_url();
1344 1344
 			}
1345
-			$this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout );
1345
+			$this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout);
1346 1346
 		}
1347 1347
 	}
1348 1348
 
@@ -1356,9 +1356,9 @@  discard block
 block discarded – undo
1356 1356
 	 * @throws \EE_Error
1357 1357
 	 */
1358 1358
 	public function go_to_next_step() {
1359
-		if ( EE_Registry::instance()->REQ->ajax ) {
1359
+		if (EE_Registry::instance()->REQ->ajax) {
1360 1360
 			// capture contents of output buffer we started earlier in the request, and insert into JSON response
1361
-			$this->checkout->json_response->set_unexpected_errors( ob_get_clean() );
1361
+			$this->checkout->json_response->set_unexpected_errors(ob_get_clean());
1362 1362
 		}
1363 1363
 		$this->unlock_transaction();
1364 1364
 		// just return for these conditions
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 	 */
1388 1388
 	protected function _handle_json_response() {
1389 1389
 		// if this is an ajax request
1390
-		if ( EE_Registry::instance()->REQ->ajax ) {
1390
+		if (EE_Registry::instance()->REQ->ajax) {
1391 1391
 			// DEBUG LOG
1392 1392
 			//$this->checkout->log(
1393 1393
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 			$this->checkout->json_response->set_registration_time_limit(
1401 1401
 				$this->checkout->get_registration_time_limit()
1402 1402
 			);
1403
-			$this->checkout->json_response->set_payment_amount( $this->checkout->amount_owing );
1403
+			$this->checkout->json_response->set_payment_amount($this->checkout->amount_owing);
1404 1404
 			// just send the ajax (
1405 1405
 			$json_response = apply_filters(
1406 1406
 				'FHEE__EE_Single_Page_Checkout__JSON_response',
@@ -1421,9 +1421,9 @@  discard block
 block discarded – undo
1421 1421
 	 */
1422 1422
 	protected function _handle_html_redirects() {
1423 1423
 		// going somewhere ?
1424
-		if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) {
1424
+		if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) {
1425 1425
 			// store notices in a transient
1426
-			EE_Error::get_notices( false, true, true );
1426
+			EE_Error::get_notices(false, true, true);
1427 1427
 			// DEBUG LOG
1428 1428
 			//$this->checkout->log(
1429 1429
 			//	__CLASS__, __FUNCTION__, __LINE__,
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
 			//		'headers_list'    => headers_list(),
1434 1434
 			//	)
1435 1435
 			//);
1436
-			wp_safe_redirect( $this->checkout->redirect_url );
1436
+			wp_safe_redirect($this->checkout->redirect_url);
1437 1437
 			exit();
1438 1438
 		}
1439 1439
 	}
Please login to merge, or discard this patch.