Completed
Branch BUG-8623-translation-cleanup (8188b8)
by
unknown
1227:42 queued 1214:34
created
modules/events_archive_filters/EED_Events_Archive_Filters.module.php 3 patches
Doc Comments   +14 added lines, -13 removed lines patch added patch discarded remove patch
@@ -271,6 +271,7 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 *  @access 	public
273 273
 	 *  @param	mixed boolean|string	$join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet
274
+	 * @param string $join_terms
274 275
 	 *  @return 	string
275 276
 	 */
276 277
 	public static function posts_join_sql_for_terms( $join_terms = NULL ) {
@@ -423,7 +424,7 @@  discard block
 block discarded – undo
423 424
 	 * 	or else some of the table references below will result in MySQL errors
424 425
 	 *
425 426
 	 *  @access 	public
426
-	 *  @param	boolean	$orderby_params
427
+	 *  @param	string[]	$orderby_params
427 428
 	 *  @return 	string
428 429
 	 */
429 430
 	public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) {
@@ -534,7 +535,7 @@  discard block
 block discarded – undo
534 535
 	 *
535 536
 	 *  	@access 	public
536 537
 	 * 	@param		string 	$content
537
-	 *  	@return 		void
538
+	 *  	@return 		string
538 539
 	 */
539 540
 	public function event_details( $content ) {
540 541
 		return EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', array( 'the_content' => $content ), TRUE );
@@ -546,7 +547,7 @@  discard block
 block discarded – undo
546 547
 	 *
547 548
 	 *  	@access 	public
548 549
 	 * 	@param		string 	$content
549
-	 *  	@return 		void
550
+	 *  	@return 		string
550 551
 	 */
551 552
 	public function event_tickets( $content ) {
552 553
 		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', array(), TRUE );
@@ -557,7 +558,7 @@  discard block
 block discarded – undo
557 558
 	 *
558 559
 	 *  	@access 	public
559 560
 	 * 	@param		string 	$content
560
-	 *  	@return 		void
561
+	 *  	@return 		string
561 562
 	 */
562 563
 	public function event_datetimes( $content ) {
563 564
 		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', array(), TRUE );
@@ -568,7 +569,7 @@  discard block
 block discarded – undo
568 569
 	 *
569 570
 	 *  	@access 	public
570 571
 	 * 	@param		string 	$content
571
-	 *  	@return 		void
572
+	 *  	@return 		string
572 573
 	 */
573 574
 	public function event_venues( $content ) {
574 575
 		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', array(), TRUE );
@@ -618,7 +619,7 @@  discard block
 block discarded – undo
618 619
 	 * 	excerpt_length
619 620
 	 *
620 621
 	 *  @access 	public
621
-	 *  @return 	void
622
+	 *  @return 	integer|null
622 623
 	 */
623 624
 	public function excerpt_length( $length ) {
624 625
 
@@ -648,7 +649,7 @@  discard block
 block discarded – undo
648 649
 	 * 	excerpt_more
649 650
 	 *
650 651
 	 *  @access 	public
651
-	 *  @return 	void
652
+	 *  @return 	string
652 653
 	 */
653 654
 	public function excerpt_more( $more ) {
654 655
 		return '…';
@@ -813,7 +814,7 @@  discard block
 block discarded – undo
813 814
 	 * 	get_template_part
814 815
 	 *
815 816
 	 *  @access 	public
816
-	 *  @return 	void
817
+	 *  @return 	string|null
817 818
 	 */
818 819
 	public static function get_template_part() {
819 820
 		switch ( self::$_type ) {
@@ -857,7 +858,7 @@  discard block
 block discarded – undo
857 858
 	 * 	event_list_css
858 859
 	 *
859 860
 	 *  @access 	public
860
-	 *  @return 	void
861
+	 *  @return 	string
861 862
 	 */
862 863
 	public static function event_list_css( $extra_class = '' ) {
863 864
 		$EE = EE_Registry::instance();
@@ -892,7 +893,7 @@  discard block
 block discarded – undo
892 893
 	 * 	display_description
893 894
 	 *
894 895
 	 *  @access 	public
895
-	 *  @return 	void
896
+	 *  @return 	boolean
896 897
 	 */
897 898
 	public static function display_description( $value ) {
898 899
 		$EE = EE_Registry::instance();
@@ -906,7 +907,7 @@  discard block
 block discarded – undo
906 907
 	 * 	display_venue_details
907 908
 	 *
908 909
 	 *  @access 	public
909
-	 *  @return 	void
910
+	 *  @return 	boolean
910 911
 	 */
911 912
 	public static function display_venue_details() {
912 913
 		$EE = EE_Registry::instance();
@@ -921,7 +922,7 @@  discard block
 block discarded – undo
921 922
 	 * 	display_address
922 923
 	 *
923 924
 	 *  @access 	public
924
-	 *  @return 	void
925
+	 *  @return 	boolean
925 926
 	 */
926 927
 	public static function display_address() {
927 928
 		$EE = EE_Registry::instance();
@@ -937,7 +938,7 @@  discard block
 block discarded – undo
937 938
 	 * 	pagination
938 939
 	 *
939 940
 	 *  @access 	public
940
-	 *  @return 	void
941
+	 *  @return 	string
941 942
 	 */
942 943
 	public static function pagination() {
943 944
 		global $wp_query;
Please login to merge, or discard this patch.
Spacing   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Events_Archive_Filters
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 *	@var 	$_types
72 72
 	 * 	@access 	protected
73 73
 	 */
74
-	protected static $_types = array( 'grid', 'text', 'dates' );
74
+	protected static $_types = array('grid', 'text', 'dates');
75 75
 
76 76
 
77 77
 //	public static $espresso_event_list_ID = 0;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 *  @access 	public
126 126
 	 *  @return 	void
127 127
 	 */
128
-	public function run( $WP ) {
128
+	public function run($WP) {
129 129
 //		do_action( 'AHEE__EED_Events_Archive_Filters__before_run' );
130 130
 //		// set config
131 131
 //		if ( ! isset( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters ) || ! EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters instanceof EE_Events_Archive_Config ) {
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	private function _filter_query_parts() {
172 172
 		// build event list query
173
-		add_filter( 'posts_join', array( $this, 'posts_join' ), 1, 2 );
174
-		add_filter( 'posts_where', array( $this, 'posts_where' ), 1, 2 );
175
-		add_filter( 'posts_orderby', array( $this, 'posts_orderby' ), 1, 2 );
173
+		add_filter('posts_join', array($this, 'posts_join'), 1, 2);
174
+		add_filter('posts_where', array($this, 'posts_where'), 1, 2);
175
+		add_filter('posts_orderby', array($this, 'posts_orderby'), 1, 2);
176 176
 	}
177 177
 
178 178
 	/**
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
 	 *  @return 	string
183 183
 	 */
184 184
 	public static function set_type() {
185
-		do_action( 'AHEE__EED_Events_Archive_Filters__before_set_type' );
186
-		EED_Events_Archive_Filters::$_types = apply_filters( 'EED_Events_Archive_Filters__set_type__types', EED_Events_Archive_Filters::$_types );
187
-		$view = isset( EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] : 'grid';
188
-		$elf_type = EE_Registry::instance()->REQ->is_set( 'elf_type' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_type' )) : '';
189
-		$view = ! empty( $elf_type ) ? $elf_type : $view;
190
-		$view = apply_filters( 'EED_Events_Archive_Filters__set_type__type', $view );
191
-		if ( ! empty( $view ) && in_array( $view, EED_Events_Archive_Filters::$_types )) {
185
+		do_action('AHEE__EED_Events_Archive_Filters__before_set_type');
186
+		EED_Events_Archive_Filters::$_types = apply_filters('EED_Events_Archive_Filters__set_type__types', EED_Events_Archive_Filters::$_types);
187
+		$view = isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type']) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['default_type'] : 'grid';
188
+		$elf_type = EE_Registry::instance()->REQ->is_set('elf_type') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_type')) : '';
189
+		$view = ! empty($elf_type) ? $elf_type : $view;
190
+		$view = apply_filters('EED_Events_Archive_Filters__set_type__type', $view);
191
+		if ( ! empty($view) && in_array($view, EED_Events_Archive_Filters::$_types)) {
192 192
 			self::$_type = $view;
193 193
 		}
194 194
 	}
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 	 *  @param	boolean	$req_only if TRUE, then ignore defaults and only return $_POST value
201 201
 	 *  @return 	boolean
202 202
 	 */
203
-	private static function _show_expired( $req_only = FALSE ) {
203
+	private static function _show_expired($req_only = FALSE) {
204 204
 		// get default value for "display_expired_events" as set in the EE General Settings > Templates > Event Listings
205
-		$show_expired = ! $req_only && isset( EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] ) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : FALSE;
205
+		$show_expired = ! $req_only && isset(EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events']) ? EE_Registry::instance()->CFG->EED_Events_Archive_Filters['display_expired_events'] : FALSE;
206 206
 		// override default expired option if set via filter
207
-		$show_expired = EE_Registry::instance()->REQ->is_set( 'elf_expired_chk' ) ? absint( EE_Registry::instance()->REQ->get( 'elf_expired_chk' )) : $show_expired;
207
+		$show_expired = EE_Registry::instance()->REQ->is_set('elf_expired_chk') ? absint(EE_Registry::instance()->REQ->get('elf_expired_chk')) : $show_expired;
208 208
 		return $show_expired ? TRUE : FALSE;
209 209
 	}
210 210
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 *  @return 	string
216 216
 	 */
217 217
 	private static function _event_category_slug() {
218
-		return EE_Registry::instance()->REQ->is_set( 'elf_category_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_category_dd' )) : '';
218
+		return EE_Registry::instance()->REQ->is_set('elf_category_dd') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_category_dd')) : '';
219 219
 	}
220 220
 
221 221
 	/**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 *  @return 	string
226 226
 	 */
227 227
 	private static function _display_month() {
228
-		return EE_Registry::instance()->REQ->is_set( 'elf_month_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_month_dd' )) : '';
228
+		return EE_Registry::instance()->REQ->is_set('elf_month_dd') ? sanitize_text_field(EE_Registry::instance()->REQ->get('elf_month_dd')) : '';
229 229
 	}
230 230
 
231 231
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	public function get_post_data() {
240 240
 		$this->_elf_month = EED_Events_Archive_Filters::_display_month();
241 241
 		$this->_elf_category = EED_Events_Archive_Filters::_event_category_slug();
242
-		$this->_show_expired = EED_Events_Archive_Filters::_show_expired( TRUE );
242
+		$this->_show_expired = EED_Events_Archive_Filters::_show_expired(TRUE);
243 243
 //		EEH_Debug_Tools::printr( EE_Registry::instance()->REQ, 'EE_Registry::instance()->REQ  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
244 244
 //		echo '<h4>$this->_elf_month : ' . $this->_elf_month . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
245 245
 //		echo '<h4>$this->_elf_category : ' . $this->_elf_category . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	 *  @access 	public
257 257
 	 *  @return 	void
258 258
 	 */
259
-	public function posts_join( $SQL, WP_Query $wp_query ) {
260
-		if ( isset( $wp_query->query ) && isset( $wp_query->query['post_type'] ) && $wp_query->query['post_type'] == 'espresso_events' ) {
259
+	public function posts_join($SQL, WP_Query $wp_query) {
260
+		if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
261 261
 			// Category
262 262
 //			$elf_category = EE_Registry::instance()->REQ->is_set( 'elf_category_dd' ) ? sanitize_text_field( EE_Registry::instance()->REQ->get( 'elf_category_dd' )) : '';
263
-			$SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms( EED_Events_Archive_Filters::_event_category_slug() );
263
+			$SQL .= EED_Events_Archive_Filters::posts_join_sql_for_terms(EED_Events_Archive_Filters::_event_category_slug());
264 264
 		}
265 265
 		return $SQL;
266 266
 	}
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 	 *  @param	mixed boolean|string	$join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get used for anything yet
274 274
 	 *  @return 	string
275 275
 	 */
276
-	public static function posts_join_sql_for_terms( $join_terms = NULL ) {
277
-		$SQL= '';
278
-		if ( ! empty( $join_terms )) {
276
+	public static function posts_join_sql_for_terms($join_terms = NULL) {
277
+		$SQL = '';
278
+		if ( ! empty($join_terms)) {
279 279
 			global $wpdb;
280 280
 			$SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)";
281 281
 			$SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
@@ -293,28 +293,28 @@  discard block
 block discarded – undo
293 293
 	 *  @param	array	$orderby_params
294 294
 	 *  @return 	string
295 295
 	 */
296
-	public static function posts_join_for_orderby( $orderby_params = array() ) {
296
+	public static function posts_join_for_orderby($orderby_params = array()) {
297 297
 		global $wpdb;
298
-		$SQL= '';
299
-		$orderby_params = is_array( $orderby_params ) ? $orderby_params : array( $orderby_params );
300
-		foreach( $orderby_params as $orderby ) {
301
-			switch ( $orderby ) {
298
+		$SQL = '';
299
+		$orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
300
+		foreach ($orderby_params as $orderby) {
301
+			switch ($orderby) {
302 302
 
303 303
 				case 'ticket_start' :
304 304
 				case 'ticket_end' :
305
-					$SQL .= ' LEFT JOIN ' . EEM_Datetime_Ticket::instance()->table() . ' ON (' . EEM_Datetime::instance()->table() . '.DTT_ID = ' . EEM_Datetime_Ticket::instance()->table() . '.DTT_ID )';
306
-					$SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table() . ' ON (' . EEM_Datetime_Ticket::instance()->table() . '.TKT_ID = ' . EEM_Ticket::instance()->table() . '.TKT_ID )';
305
+					$SQL .= ' LEFT JOIN '.EEM_Datetime_Ticket::instance()->table().' ON ('.EEM_Datetime::instance()->table().'.DTT_ID = '.EEM_Datetime_Ticket::instance()->table().'.DTT_ID )';
306
+					$SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table().' ON ('.EEM_Datetime_Ticket::instance()->table().'.TKT_ID = '.EEM_Ticket::instance()->table().'.TKT_ID )';
307 307
 					break;
308 308
 
309 309
 				case 'venue_title' :
310 310
 				case 'city' :
311
-					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
312
-					$SQL .= ' LEFT JOIN ' . EEM_Venue::instance()->table() . ' ON (' . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' . EEM_Venue::instance()->table() . '.VNU_ID )';
311
+					$SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '.EEM_Event_Venue::instance()->table().'.EVT_ID )';
312
+					$SQL .= ' LEFT JOIN '.EEM_Venue::instance()->table().' ON ('.EEM_Event_Venue::instance()->table().'.VNU_ID = '.EEM_Venue::instance()->table().'.VNU_ID )';
313 313
 					break;
314 314
 
315 315
 				case 'state' :
316
-					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->table() . ' ON (' . $wpdb->posts . '.ID = ' . EEM_Event_Venue::instance()->table() . '.EVT_ID )';
317
-					$SQL .= ' LEFT JOIN ' . EEM_Event_Venue::instance()->second_table() . ' ON (' . EEM_Event_Venue::instance()->table() . '.VNU_ID = ' . EEM_Event_Venue::instance()->second_table() . '.VNU_ID )';
316
+					$SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->table().' ON ('.$wpdb->posts.'.ID = '.EEM_Event_Venue::instance()->table().'.EVT_ID )';
317
+					$SQL .= ' LEFT JOIN '.EEM_Event_Venue::instance()->second_table().' ON ('.EEM_Event_Venue::instance()->table().'.VNU_ID = '.EEM_Event_Venue::instance()->second_table().'.VNU_ID )';
318 318
 					break;
319 319
 
320 320
 				break;
@@ -331,16 +331,16 @@  discard block
 block discarded – undo
331 331
 	 *  @access 	public
332 332
 	 *  @return 	void
333 333
 	 */
334
-	public function posts_where( $SQL, WP_Query $wp_query ) {
335
-		if ( isset( $wp_query->query_vars ) && isset( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] == 'espresso_events'  ) {
334
+	public function posts_where($SQL, WP_Query $wp_query) {
335
+		if (isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'espresso_events') {
336 336
 			// Show Expired ?
337
-			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired( EED_Events_Archive_Filters::_show_expired() );
337
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_show_expired(EED_Events_Archive_Filters::_show_expired());
338 338
 			// Category
339 339
 			//$elf_category = EED_Events_Archive_Filters::_event_category_slug();
340
-			$SQL .=  EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug( EED_Events_Archive_Filters::_event_category_slug() );
340
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_category_slug(EED_Events_Archive_Filters::_event_category_slug());
341 341
 			// Start Date
342 342
 			//$elf_month = EED_Events_Archive_Filters::_display_month();
343
-			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month( EED_Events_Archive_Filters::_display_month() );
343
+			$SQL .= EED_Events_Archive_Filters::posts_where_sql_for_event_list_month(EED_Events_Archive_Filters::_display_month());
344 344
 		}
345 345
 		return $SQL;
346 346
 	}
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
 	 *  @param	boolean	$show_expired if TRUE, then displayed past events
354 354
 	 *  @return 	string
355 355
 	 */
356
-	public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) {
357
-		return  ! $show_expired ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > "' . date('Y-m-d H:s:i') . '" ' : '';
356
+	public static function posts_where_sql_for_show_expired($show_expired = FALSE) {
357
+		return  ! $show_expired ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > "'.date('Y-m-d H:s:i').'" ' : '';
358 358
 	}
359 359
 
360 360
 
@@ -365,9 +365,9 @@  discard block
 block discarded – undo
365 365
 	 *  @param	boolean	$event_category_slug
366 366
 	 *  @return 	string
367 367
 	 */
368
-	public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) {
368
+	public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) {
369 369
 		global $wpdb;
370
-		return  ! empty( $event_category_slug ) ? ' AND ' . $wpdb->terms . '.slug = "' . $event_category_slug . '" ' : '';
370
+		return  ! empty($event_category_slug) ? ' AND '.$wpdb->terms.'.slug = "'.$event_category_slug.'" ' : '';
371 371
 	}
372 372
 
373 373
 	/**
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 	 *  @param	boolean	$month
378 378
 	 *  @return 	string
379 379
 	 */
380
-	public static function posts_where_sql_for_event_list_month( $month = NULL ) {
381
-		$SQL= '';
382
-		if ( ! empty( $month )) {
380
+	public static function posts_where_sql_for_event_list_month($month = NULL) {
381
+		$SQL = '';
382
+		if ( ! empty($month)) {
383 383
 			// event start date is LESS than the end of the month ( so nothing that doesn't start until next month )
384
-			$SQL = ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start <= "' . date('Y-m-t 23:59:59', strtotime( $month )) . '"';
384
+			$SQL = ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_start <= "'.date('Y-m-t 23:59:59', strtotime($month)).'"';
385 385
 			// event end date is GREATER than the start of the month ( so nothing that ended before this month )
386
-			$SQL .= ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end >= "' . date('Y-m-d 0:0:00', strtotime( $month )) . '" ';
386
+			$SQL .= ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end >= "'.date('Y-m-d 0:0:00', strtotime($month)).'" ';
387 387
 		}
388 388
 		return $SQL;
389 389
 	}
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
 	 *  @access 	public
396 396
 	 *  @return 	void
397 397
 	 */
398
-	public function posts_orderby( $SQL, WP_Query $wp_query ) {
399
-		if ( isset( $wp_query->query ) && isset( $wp_query->query['post_type'] ) && $wp_query->query['post_type'] == 'espresso_events' ) {
400
-			$SQL = EED_Events_Archive_Filters::posts_orderby_sql( array( 'start_date' ));
398
+	public function posts_orderby($SQL, WP_Query $wp_query) {
399
+		if (isset($wp_query->query) && isset($wp_query->query['post_type']) && $wp_query->query['post_type'] == 'espresso_events') {
400
+			$SQL = EED_Events_Archive_Filters::posts_orderby_sql(array('start_date'));
401 401
 		}
402 402
 		return $SQL;
403 403
 	}
@@ -426,54 +426,54 @@  discard block
 block discarded – undo
426 426
 	 *  @param	boolean	$orderby_params
427 427
 	 *  @return 	string
428 428
 	 */
429
-	public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) {
429
+	public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') {
430 430
 		global $wpdb;
431 431
 		$SQL = '';
432 432
 		$cntr = 1;
433
-		$orderby_params = is_array( $orderby_params ) ? $orderby_params : array( $orderby_params );
434
-		foreach( $orderby_params as $orderby ) {
435
-			$glue = $cntr == 1 || $cntr == count( $orderby_params ) ? ' ' : ', ';
436
-			switch ( $orderby ) {
433
+		$orderby_params = is_array($orderby_params) ? $orderby_params : array($orderby_params);
434
+		foreach ($orderby_params as $orderby) {
435
+			$glue = $cntr == 1 || $cntr == count($orderby_params) ? ' ' : ', ';
436
+			switch ($orderby) {
437 437
 
438 438
 				case 'id' :
439 439
 				case 'ID' :
440
-					$SQL .= $glue . $wpdb->posts . '.ID ' . $sort;
440
+					$SQL .= $glue.$wpdb->posts.'.ID '.$sort;
441 441
 					break;
442 442
 
443 443
 				case 'start_date' :
444
-					$SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_start ' . $sort;
444
+					$SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_start '.$sort;
445 445
 					break;
446 446
 
447 447
 				case 'end_date' :
448
-					$SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort;
448
+					$SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort;
449 449
 					break;
450 450
 
451 451
 				case 'event_name' :
452
-					$SQL .= $glue . $wpdb->posts . '.post_title ' . $sort;
452
+					$SQL .= $glue.$wpdb->posts.'.post_title '.$sort;
453 453
 					break;
454 454
 
455 455
 				case 'category_slug' :
456
-					$SQL .= $glue . $wpdb->terms . '.slug ' . $sort;
456
+					$SQL .= $glue.$wpdb->terms.'.slug '.$sort;
457 457
 					break;
458 458
 
459 459
 				case 'ticket_start' :
460
-					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort;
460
+					$SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort;
461 461
 					break;
462 462
 
463 463
 				case 'ticket_end' :
464
-					$SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort;
464
+					$SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort;
465 465
 					break;
466 466
 
467 467
 				case 'venue_title' :
468
-					$SQL .= $glue . 'venue_title ' . $sort;
468
+					$SQL .= $glue.'venue_title '.$sort;
469 469
 					break;
470 470
 
471 471
 				case 'city' :
472
-					$SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort;
472
+					$SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort;
473 473
 				break;
474 474
 
475 475
 				case 'state' :
476
-					$SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort;
476
+					$SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort;
477 477
 				break;
478 478
 
479 479
 			}
@@ -493,26 +493,26 @@  discard block
 block discarded – undo
493 493
 	 */
494 494
 	public function template_redirect() {
495 495
 		// add event list filters
496
-		add_action( 'loop_start', array( $this, 'event_list_template_filters' ));
496
+		add_action('loop_start', array($this, 'event_list_template_filters'));
497 497
 		// and pagination
498
-		add_action( 'loop_start', array( $this, 'event_list_pagination' ));
499
-		add_action( 'loop_end', array( $this, 'event_list_pagination' ));
498
+		add_action('loop_start', array($this, 'event_list_pagination'));
499
+		add_action('loop_end', array($this, 'event_list_pagination'));
500 500
 		// if NOT a custom template
501
-		if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php' ) {
501
+		if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php') {
502 502
 			// don't know if theme uses the_excerpt
503
-			add_filter( 'the_excerpt', array( $this, 'event_details' ), 100 );
504
-			add_filter( 'the_excerpt', array( $this, 'event_tickets' ), 110 );
505
-			add_filter( 'the_excerpt', array( $this, 'event_datetimes' ), 120 );
506
-			add_filter( 'the_excerpt', array( $this, 'event_venues' ), 130 );
503
+			add_filter('the_excerpt', array($this, 'event_details'), 100);
504
+			add_filter('the_excerpt', array($this, 'event_tickets'), 110);
505
+			add_filter('the_excerpt', array($this, 'event_datetimes'), 120);
506
+			add_filter('the_excerpt', array($this, 'event_venues'), 130);
507 507
 			// or the_content
508
-			add_filter( 'the_content', array( $this, 'event_details' ), 100 );
509
-			add_filter( 'the_content', array( $this, 'event_tickets' ), 110 );
510
-			add_filter( 'the_content', array( $this, 'event_datetimes' ), 120 );
511
-			add_filter( 'the_content', array( $this, 'event_venues' ), 130 );
508
+			add_filter('the_content', array($this, 'event_details'), 100);
509
+			add_filter('the_content', array($this, 'event_tickets'), 110);
510
+			add_filter('the_content', array($this, 'event_datetimes'), 120);
511
+			add_filter('the_content', array($this, 'event_venues'), 130);
512 512
 		} else {
513
-			remove_all_filters( 'excerpt_length' );
514
-			add_filter( 'excerpt_length', array( $this, 'excerpt_length' ), 10 );
515
-			add_filter( 'excerpt_more', array( $this, 'excerpt_more' ), 10 );
513
+			remove_all_filters('excerpt_length');
514
+			add_filter('excerpt_length', array($this, 'excerpt_length'), 10);
515
+			add_filter('excerpt_more', array($this, 'excerpt_more'), 10);
516 516
 		}
517 517
 	}
518 518
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 	 *  	@return 		void
526 526
 	 */
527 527
 	public function event_list_pagination() {
528
-		echo '<div class="ee-pagination-dv clear">' . espresso_event_list_pagination() . '</div>';
528
+		echo '<div class="ee-pagination-dv clear">'.espresso_event_list_pagination().'</div>';
529 529
 	}
530 530
 
531 531
 
@@ -536,8 +536,8 @@  discard block
 block discarded – undo
536 536
 	 * 	@param		string 	$content
537 537
 	 *  	@return 		void
538 538
 	 */
539
-	public function event_details( $content ) {
540
-		return EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-details.php', array( 'the_content' => $content ), TRUE );
539
+	public function event_details($content) {
540
+		return EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-details.php', array('the_content' => $content), TRUE);
541 541
 	}
542 542
 
543 543
 
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
 	 * 	@param		string 	$content
549 549
 	 *  	@return 		void
550 550
 	 */
551
-	public function event_tickets( $content ) {
552
-		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-tickets.php', array(), TRUE );
551
+	public function event_tickets($content) {
552
+		return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-tickets.php', array(), TRUE);
553 553
 	}
554 554
 
555 555
 	/**
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
 	 * 	@param		string 	$content
560 560
 	 *  	@return 		void
561 561
 	 */
562
-	public function event_datetimes( $content ) {
563
-		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-datetimes.php', array(), TRUE );
562
+	public function event_datetimes($content) {
563
+		return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-datetimes.php', array(), TRUE);
564 564
 	}
565 565
 
566 566
 	/**
@@ -570,8 +570,8 @@  discard block
 block discarded – undo
570 570
 	 * 	@param		string 	$content
571 571
 	 *  	@return 		void
572 572
 	 */
573
-	public function event_venues( $content ) {
574
-		return $content . EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'content-espresso_events-venues.php', array(), TRUE );
573
+	public function event_venues($content) {
574
+		return $content.EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'content-espresso_events-venues.php', array(), TRUE);
575 575
 	}
576 576
 
577 577
 
@@ -586,16 +586,16 @@  discard block
 block discarded – undo
586 586
 	 *  @return 	void
587 587
 	 */
588 588
 	private function _load_assests() {
589
-		do_action( 'AHEE__EED_Events_Archive_Filters__before_load_assests' );
590
-		add_filter( 'FHEE_load_css', '__return_true' );
591
-		add_filter( 'FHEE_load_EE_Session', '__return_true' );
592
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
593
-		if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
594
-			EE_Registry::instance()->load_helper( 'Maps' );
595
-			add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
589
+		do_action('AHEE__EED_Events_Archive_Filters__before_load_assests');
590
+		add_filter('FHEE_load_css', '__return_true');
591
+		add_filter('FHEE_load_EE_Session', '__return_true');
592
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
593
+		if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
594
+			EE_Registry::instance()->load_helper('Maps');
595
+			add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
596 596
 		}
597 597
 		//add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 );
598
-		EE_Registry::instance()->load_helper( 'Event_View' );
598
+		EE_Registry::instance()->load_helper('Event_View');
599 599
 	}
600 600
 
601 601
 
@@ -608,8 +608,8 @@  discard block
 block discarded – undo
608 608
 	 *  @access 	private
609 609
 	 *  @return 	string
610 610
 	 */
611
-	private function _get_template( $which = 'part' ) {
612
-		return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php';
611
+	private function _get_template($which = 'part') {
612
+		return EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php';
613 613
 	}
614 614
 
615 615
 
@@ -620,13 +620,13 @@  discard block
 block discarded – undo
620 620
 	 *  @access 	public
621 621
 	 *  @return 	void
622 622
 	 */
623
-	public function excerpt_length( $length ) {
623
+	public function excerpt_length($length) {
624 624
 
625
-		if ( self::$_type == 'grid' ) {
625
+		if (self::$_type == 'grid') {
626 626
 			return 36;
627 627
 		}
628 628
 
629
-		switch ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size ) {
629
+		switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) {
630 630
 			case 'tiny' :
631 631
 				return 12;
632 632
 				break;
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 	 *  @access 	public
651 651
 	 *  @return 	void
652 652
 	 */
653
-	public function excerpt_more( $more ) {
653
+	public function excerpt_more($more) {
654 654
 		return '&hellip;';
655 655
 	}
656 656
 
@@ -680,23 +680,23 @@  discard block
 block discarded – undo
680 680
 	 */
681 681
 	public function wp_enqueue_scripts() {
682 682
 		// get some style
683
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) {
683
+		if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) {
684 684
 			// first check uploads folder
685
-			EE_Registry::instance()->load_helper( 'File' );
686
-			if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' )) {
687
-				wp_register_style( 'archive-espresso_events', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' ));
685
+			EE_Registry::instance()->load_helper('File');
686
+			if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.css')) {
687
+				wp_register_style('archive-espresso_events', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'archive-espresso_events.css', array('dashicons', 'espresso_default'));
688 688
 			} else {
689
-				wp_register_style( 'archive-espresso_events', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' ));
689
+				wp_register_style('archive-espresso_events', EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'archive-espresso_events.css', array('dashicons', 'espresso_default'));
690 690
 			}
691
-			if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' )) {
692
-				wp_register_script( 'archive-espresso_events', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js', array( 'jquery-masonry' ), '1.0', TRUE  );
691
+			if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.js')) {
692
+				wp_register_script('archive-espresso_events', get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'archive-espresso_events.js', array('jquery-masonry'), '1.0', TRUE);
693 693
 			} else {
694
-				wp_register_script( 'archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', array( 'jquery-masonry' ), '1.0', TRUE );
694
+				wp_register_script('archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL.'archive-espresso_events.js', array('jquery-masonry'), '1.0', TRUE);
695 695
 			}
696
-			wp_enqueue_style( 'archive-espresso_events' );
697
-			wp_enqueue_script( 'jquery-masonry' );
698
-			wp_enqueue_script( 'archive-espresso_events' );
699
-			add_action( 'wp_footer', array( 'EED_Events_Archive_Filters', 'localize_grid_event_lists' ), 1 );
696
+			wp_enqueue_style('archive-espresso_events');
697
+			wp_enqueue_script('jquery-masonry');
698
+			wp_enqueue_script('archive-espresso_events');
699
+			add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1);
700 700
 		}
701 701
 	}
702 702
 
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 	 *  @return 	void
712 712
 	 */
713 713
 	public static function localize_grid_event_lists() {
714
-		wp_localize_script( 'archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists );
714
+		wp_localize_script('archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists);
715 715
 	}
716 716
 
717 717
 
@@ -726,9 +726,9 @@  discard block
 block discarded – undo
726 726
 	 */
727 727
 	public static function template_settings_form() {
728 728
 		$EE = EE_Registry::instance();
729
-		$EE->CFG->template_settings->EED_Events_Archive_Filters = isset( $EE->CFG->template_settings->EED_Events_Archive_Filters ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config();
730
-		$EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters( 'FHEE__Event_List__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Events_Archive_Filters );
731
-		EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters );
729
+		$EE->CFG->template_settings->EED_Events_Archive_Filters = isset($EE->CFG->template_settings->EED_Events_Archive_Filters) ? $EE->CFG->template_settings->EED_Events_Archive_Filters : new EE_Events_Archive_Config();
730
+		$EE->CFG->template_settings->EED_Events_Archive_Filters = apply_filters('FHEE__Event_List__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Events_Archive_Filters);
731
+		EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters);
732 732
 	}
733 733
 
734 734
 
@@ -742,16 +742,16 @@  discard block
 block discarded – undo
742 742
 	 *  @static
743 743
 	 *  @return 	void
744 744
 	 */
745
-	public static function set_default_settings( $CFG ) {
745
+	public static function set_default_settings($CFG) {
746 746
 		//EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
747
-		$CFG->display_description = isset( $CFG->display_description ) && ! empty( $CFG->display_description ) ? $CFG->display_description : 1;
748
-		$CFG->display_address = isset( $CFG->display_address ) && ! empty( $CFG->display_address ) ? $CFG->display_address : TRUE;
749
-		$CFG->display_venue_details = isset( $CFG->display_venue_details ) && ! empty( $CFG->display_venue_details ) ? $CFG->display_venue_details : TRUE;
750
-		$CFG->display_expired_events = isset( $CFG->display_expired_events ) && ! empty( $CFG->display_expired_events ) ? $CFG->display_expired_events : FALSE;
751
-		$CFG->default_type = isset( $CFG->default_type ) && ! empty( $CFG->default_type ) ? $CFG->default_type : 'grid';
752
-		$CFG->event_list_grid_size = isset( $CFG->event_list_grid_size ) && ! empty( $CFG->event_list_grid_size ) ? $CFG->event_list_grid_size : 'medium';
753
-		$CFG->templates['full'] = isset( $CFG->templates['full'] ) && ! empty( $CFG->templates['full'] ) ? $CFG->templates['full'] : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php';
754
-		$CFG->templates['part'] = isset( $CFG->templates['part'] ) && ! empty( $CFG->templates['part'] ) ? $CFG->templates['part'] : EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php';
747
+		$CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description) ? $CFG->display_description : 1;
748
+		$CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address : TRUE;
749
+		$CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details) ? $CFG->display_venue_details : TRUE;
750
+		$CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events) ? $CFG->display_expired_events : FALSE;
751
+		$CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid';
752
+		$CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size) ? $CFG->event_list_grid_size : 'medium';
753
+		$CFG->templates['full'] = isset($CFG->templates['full']) && ! empty($CFG->templates['full']) ? $CFG->templates['full'] : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php';
754
+		$CFG->templates['part'] = isset($CFG->templates['part']) && ! empty($CFG->templates['part']) ? $CFG->templates['part'] : EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php';
755 755
 		return $CFG;
756 756
 	}
757 757
 
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 	 *  @access 	public
764 764
 	 *  @return 	void
765 765
 	 */
766
-	public function filter_config( $CFG ) {
766
+	public function filter_config($CFG) {
767 767
 		return $CFG;
768 768
 	}
769 769
 
@@ -776,32 +776,32 @@  discard block
 block discarded – undo
776 776
 	 *  @access 	public
777 777
 	 *  @return 	void
778 778
 	 */
779
-	public static function update_template_settings( $CFG, $REQ ) {
779
+	public static function update_template_settings($CFG, $REQ) {
780 780
 //		EEH_Debug_Tools::printr( $REQ, '$REQ  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
781 781
 //		EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
782 782
 		//$CFG->template_settings->EED_Events_Archive_Filters = new stdClass();
783
-		$CFG->EED_Events_Archive_Filters->display_description = isset( $REQ['display_description_in_event_list'] ) ? absint( $REQ['display_description_in_event_list'] ) : 1;
784
-		$CFG->EED_Events_Archive_Filters->display_address = isset( $REQ['display_address_in_event_list'] ) ? absint( $REQ['display_address_in_event_list'] ) : TRUE;
785
-		$CFG->EED_Events_Archive_Filters->display_venue_details = isset( $REQ['display_venue_details_in_event_list'] ) ? absint( $REQ['display_venue_details_in_event_list'] ) : TRUE;
786
-		$CFG->EED_Events_Archive_Filters->display_expired_events = isset( $REQ['display_expired_events'] ) ? absint( $REQ['display_expired_events'] ) : FALSE;
787
-		$CFG->EED_Events_Archive_Filters->default_type = isset( $REQ['default_type'] ) ? sanitize_text_field( $REQ['default_type'] ) : 'grid';
788
-		$CFG->EED_Events_Archive_Filters->event_list_grid_size = isset( $REQ['event_list_grid_size'] ) ? sanitize_text_field( $REQ['event_list_grid_size'] ) : 'medium';
783
+		$CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list']) ? absint($REQ['display_description_in_event_list']) : 1;
784
+		$CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint($REQ['display_address_in_event_list']) : TRUE;
785
+		$CFG->EED_Events_Archive_Filters->display_venue_details = isset($REQ['display_venue_details_in_event_list']) ? absint($REQ['display_venue_details_in_event_list']) : TRUE;
786
+		$CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint($REQ['display_expired_events']) : FALSE;
787
+		$CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field($REQ['default_type']) : 'grid';
788
+		$CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium';
789 789
 		$CFG->EED_Events_Archive_Filters->templates = array(
790
-				'full'  => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'
790
+				'full'  => EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'
791 791
 			);
792 792
 
793
-		switch ( $CFG->EED_Events_Archive_Filters->default_type ) {
793
+		switch ($CFG->EED_Events_Archive_Filters->default_type) {
794 794
 			case 'dates' :
795
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-dates-view.php';
795
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-dates-view.php';
796 796
 				break;
797 797
 			case 'text' :
798
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-text-view.php';
798
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-text-view.php';
799 799
 				break;
800 800
 			default :
801
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php';
801
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php';
802 802
 		}
803 803
 
804
-		$CFG->EED_Events_Archive_Filters = isset( $REQ['reset_event_list_settings'] ) && absint( $REQ['reset_event_list_settings'] ) == 1 ? new EE_Events_Archive_Config() : $CFG->EED_Events_Archive_Filters;
804
+		$CFG->EED_Events_Archive_Filters = isset($REQ['reset_event_list_settings']) && absint($REQ['reset_event_list_settings']) == 1 ? new EE_Events_Archive_Config() : $CFG->EED_Events_Archive_Filters;
805 805
 		return $CFG;
806 806
 	}
807 807
 
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 	 *  @return 	void
817 817
 	 */
818 818
 	public static function get_template_part() {
819
-		switch ( self::$_type ) {
819
+		switch (self::$_type) {
820 820
 			case 'dates' :
821 821
 					return 'archive-espresso_events-dates-view.php';
822 822
 				break;
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
 	 */
841 841
 	public function event_list_template_filters() {
842 842
 		$args = array(
843
-			'form_url' => get_post_type_archive_link( 'espresso_events' ), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
843
+			'form_url' => get_post_type_archive_link('espresso_events'), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
844 844
 			'elf_month' => EED_Events_Archive_Filters::_display_month(),
845 845
 			'elf_category' => EED_Events_Archive_Filters::_event_category_slug(),
846 846
 			'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(),
847 847
 			'elf_type' => self::$_type
848 848
 		);
849
-		EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', $args );
849
+		EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-filters.php', $args);
850 850
 	}
851 851
 
852 852
 
@@ -859,16 +859,16 @@  discard block
 block discarded – undo
859 859
 	 *  @access 	public
860 860
 	 *  @return 	void
861 861
 	 */
862
-	public static function event_list_css( $extra_class = '' ) {
862
+	public static function event_list_css($extra_class = '') {
863 863
 		$EE = EE_Registry::instance();
864
-		$event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array();
864
+		$event_list_css = ! empty($extra_class) ? array($extra_class) : array();
865 865
 		$event_list_css[] = 'espresso-event-list-event';
866
-		if ( self::$_type == 'grid' ) {
867
-			$event_list_grid_size = isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium';
868
-			$event_list_css[] = $event_list_grid_size . '-event-list-grid';
866
+		if (self::$_type == 'grid') {
867
+			$event_list_grid_size = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size : 'medium';
868
+			$event_list_css[] = $event_list_grid_size.'-event-list-grid';
869 869
 		}
870
-		$event_list_css = apply_filters( 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css );
871
-		return implode( ' ', $event_list_css );
870
+		$event_list_css = apply_filters('EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css);
871
+		return implode(' ', $event_list_css);
872 872
 	}
873 873
 
874 874
 
@@ -894,9 +894,9 @@  discard block
 block discarded – undo
894 894
 	 *  @access 	public
895 895
 	 *  @return 	void
896 896
 	 */
897
-	public static function display_description( $value ) {
897
+	public static function display_description($value) {
898 898
 		$EE = EE_Registry::instance();
899
-		$display_description= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
899
+		$display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
900 900
 		return $display_description === $value ? TRUE : FALSE;
901 901
 	}
902 902
 
@@ -910,10 +910,10 @@  discard block
 block discarded – undo
910 910
 	 */
911 911
 	public static function display_venue_details() {
912 912
 		$EE = EE_Registry::instance();
913
-		$EE->load_helper( 'Venue_View' );
914
-		$display_venue_details= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : TRUE;
913
+		$EE->load_helper('Venue_View');
914
+		$display_venue_details = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_venue_details : TRUE;
915 915
 		$venue_name = EEH_Venue_View::venue_name();
916
-		return $display_venue_details && ! empty( $venue_name ) ? TRUE : FALSE;
916
+		return $display_venue_details && ! empty($venue_name) ? TRUE : FALSE;
917 917
 	}
918 918
 
919 919
 
@@ -925,10 +925,10 @@  discard block
 block discarded – undo
925 925
 	 */
926 926
 	public static function display_address() {
927 927
 		$EE = EE_Registry::instance();
928
-		$EE->load_helper( 'Venue_View' );
929
-		$display_address= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE;
928
+		$EE->load_helper('Venue_View');
929
+		$display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE;
930 930
 		$venue_name = EEH_Venue_View::venue_name();
931
-		return $display_address && ! empty( $venue_name ) ? TRUE : FALSE;
931
+		return $display_address && ! empty($venue_name) ? TRUE : FALSE;
932 932
 	}
933 933
 
934 934
 
@@ -942,22 +942,22 @@  discard block
 block discarded – undo
942 942
 	public static function pagination() {
943 943
 		global $wp_query;
944 944
 		$big = 999999999; // need an unlikely integer
945
-		$pagination = paginate_links( array(
946
-			'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
945
+		$pagination = paginate_links(array(
946
+			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
947 947
 			'format' => '?paged=%#%',
948
-			'current' => max( 1, get_query_var('paged') ),
948
+			'current' => max(1, get_query_var('paged')),
949 949
 			'total' => $wp_query->max_num_pages,
950 950
 			'show_all'     => TRUE,
951 951
 			'end_size'     => 10,
952 952
 			'mid_size'     => 6,
953 953
 			'prev_next'    => TRUE,
954
-			'prev_text'    => __( '&lsaquo; PREV', 'event_espresso' ),
955
-			'next_text'    => __( 'NEXT &rsaquo;', 'event_espresso' ),
954
+			'prev_text'    => __('&lsaquo; PREV', 'event_espresso'),
955
+			'next_text'    => __('NEXT &rsaquo;', 'event_espresso'),
956 956
 			'type'         => 'plain',
957 957
 			'add_args'     => FALSE,
958 958
 			'add_fragment' => ''
959 959
 		));
960
-		return ! empty( $pagination ) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : '';
960
+		return ! empty($pagination) ? '<div class="ee-pagination-dv clear">'.$pagination.'</div>' : '';
961 961
 	}
962 962
 
963 963
 
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 	 *  @return 	void
972 972
 	 */
973 973
 	public static function event_list_title() {
974
-		return apply_filters( 'EED_Events_Archive_Filters__event_list_title__event_list_title', __( 'Upcoming Events', 'event_espresso' ));
974
+		return apply_filters('EED_Events_Archive_Filters__event_list_title__event_list_title', __('Upcoming Events', 'event_espresso'));
975 975
 	}
976 976
 
977 977
 
Please login to merge, or discard this patch.
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.
modules/feeds/EED_Feeds.module.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 *  @access 	public
127 127
 	 *  @param 	string 	$SQL	the JOIN clause for the comment feed query
128
-	 *  @return 	void
128
+	 *  @return 	string
129 129
 	 */
130 130
 	public static function comment_feed_join( $SQL ) {
131 131
 		global $wpdb;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 *
147 147
 	 *  @access 	public
148 148
 	 *  @param 	string 	$SQL	the WHERE clause for the comment feed query
149
-	 *  @return 	void
149
+	 *  @return 	string
150 150
 	 */
151 151
 	public static function comment_feed_where( $SQL ) {
152 152
 		global $wp_query, $wpdb;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 *
165 165
 	 *  @access 	public
166 166
 	 *  @param 	string 	$content
167
-	 *  @return 	void
167
+	 *  @return 	string
168 168
 	 */
169 169
 	public static function the_event_feed( $content ) {
170 170
 		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php' )) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 *  @access 	public
207 207
 	 *  @param 	string 	$content
208
-	 *  @return 	void
208
+	 *  @return 	string
209 209
 	 */
210 210
 	public static function the_venue_feed( $content ) {
211 211
 		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php' )) {
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Feeds
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 	 *  @return 	void
42 42
 	 */
43 43
 	public static function set_hooks() {
44
-		add_action( 'parse_request', array( 'EED_Feeds', 'parse_request' ), 10 );
45
-		add_filter( 'default_feed', array( 'EED_Feeds', 'default_feed' ), 10, 1  );
46
-		add_filter( 'comment_feed_join', array( 'EED_Feeds', 'comment_feed_join' ), 10, 2 );
47
-		add_filter( 'comment_feed_where', array( 'EED_Feeds', 'comment_feed_where' ), 10, 2 );
44
+		add_action('parse_request', array('EED_Feeds', 'parse_request'), 10);
45
+		add_filter('default_feed', array('EED_Feeds', 'default_feed'), 10, 1);
46
+		add_filter('comment_feed_join', array('EED_Feeds', 'comment_feed_join'), 10, 2);
47
+		add_filter('comment_feed_where', array('EED_Feeds', 'comment_feed_where'), 10, 2);
48 48
 	}
49 49
 
50 50
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *  @access 	public
65 65
 	 *  @return 	void
66 66
 	 */
67
-	public function run( $WP ) {
67
+	public function run($WP) {
68 68
 	}
69 69
 
70 70
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 *  @param 	type	rss2, atom, rss, rdf, rssjs
77 77
 	 *  @return 	string
78 78
 	 */
79
-	public static function default_feed( $type = 'rss2' ) {
79
+	public static function default_feed($type = 'rss2') {
80 80
 		 //rss2, atom, rss, rdf, rssjs
81 81
 		$type = 'rss2';
82 82
 		return $type;
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 	 *  @return 	void
93 93
 	 */
94 94
 	public static function parse_request() {
95
-		if ( EE_Registry::instance()->REQ->is_set( 'post_type' )) {
95
+		if (EE_Registry::instance()->REQ->is_set('post_type')) {
96 96
 			// define path to templates
97
-			define( 'RSS_FEEDS_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
97
+			define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
98 98
 			// what kinda post_type are we dealing with ?
99
-			switch( EE_Registry::instance()->REQ->get( 'post_type' )) {
99
+			switch (EE_Registry::instance()->REQ->get('post_type')) {
100 100
 				case 'espresso_events' :
101 101
 					// for rss2, atom, rss, rdf
102
-					add_filter( 'the_excerpt_rss', array( 'EED_Feeds', 'the_event_feed' ), 10, 1 );
103
-					add_filter( 'the_content_feed', array( 'EED_Feeds', 'the_event_feed' ), 10, 1 );
102
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_event_feed'), 10, 1);
103
+					add_filter('the_content_feed', array('EED_Feeds', 'the_event_feed'), 10, 1);
104 104
 					// for json ( also uses the above filter )
105
-					add_filter( 'rssjs_feed_item', array( 'EED_Feeds', 'the_event_rssjs_feed' ), 10, 1 );
105
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_event_rssjs_feed'), 10, 1);
106 106
 					break;
107 107
 				case 'espresso_venues' :
108 108
 					// for rss2, atom, rss, rdf
109
-					add_filter( 'the_excerpt_rss', array( 'EED_Feeds', 'the_venue_feed' ), 10, 1 );
110
-					add_filter( 'the_content_feed', array( 'EED_Feeds', 'the_venue_feed' ), 10, 1 );
109
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_venue_feed'), 10, 1);
110
+					add_filter('the_content_feed', array('EED_Feeds', 'the_venue_feed'), 10, 1);
111 111
 					// for json ( also uses the above filter )
112
-					add_filter( 'rssjs_feed_item', array( 'EED_Feeds', 'the_venue_rssjs_feed' ), 10, 1 );
112
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_venue_rssjs_feed'), 10, 1);
113 113
 					break;
114 114
 			}
115 115
 		}
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 *  @param 	string 	$SQL	the JOIN clause for the comment feed query
128 128
 	 *  @return 	void
129 129
 	 */
130
-	public static function comment_feed_join( $SQL ) {
130
+	public static function comment_feed_join($SQL) {
131 131
 		global $wpdb;
132 132
 		// check for wp_posts table in JOIN clause
133
-		if ( strpos( $SQL, $wpdb->posts ) !== FALSE ) {
134
-			add_filter( 'EED_Feeds__comment_feed_where__espresso_attendees', '__return_true' );
133
+		if (strpos($SQL, $wpdb->posts) !== FALSE) {
134
+			add_filter('EED_Feeds__comment_feed_where__espresso_attendees', '__return_true');
135 135
 		}
136 136
 		return $SQL;
137 137
 	}
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 	 *  @param 	string 	$SQL	the WHERE clause for the comment feed query
149 149
 	 *  @return 	void
150 150
 	 */
151
-	public static function comment_feed_where( $SQL ) {
151
+	public static function comment_feed_where($SQL) {
152 152
 		global $wp_query, $wpdb;
153
-		if ( $wp_query->is_comment_feed && apply_filters( 'EED_Feeds__comment_feed_where__espresso_attendees', FALSE )) {
153
+		if ($wp_query->is_comment_feed && apply_filters('EED_Feeds__comment_feed_where__espresso_attendees', FALSE)) {
154 154
 			$SQL .= " AND $wpdb->posts.post_type != 'espresso_attendees'";
155 155
 		}
156 156
 		return $SQL;
@@ -166,16 +166,16 @@  discard block
 block discarded – undo
166 166
 	 *  @param 	string 	$content
167 167
 	 *  @return 	void
168 168
 	 */
169
-	public static function the_event_feed( $content ) {
170
-		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php' )) {
171
-			EE_Registry::instance()->load_helper( 'Event_View' );
172
-			EE_Registry::instance()->load_helper( 'Venue_View' );
169
+	public static function the_event_feed($content) {
170
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php')) {
171
+			EE_Registry::instance()->load_helper('Event_View');
172
+			EE_Registry::instance()->load_helper('Venue_View');
173 173
  			global $post;
174 174
 			$template_args = array(
175 175
 				'EVT_ID' => $post->ID,
176 176
 				'event_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content
177 177
 			);
178
-			$content = EEH_Template::display_template( RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php', $template_args, TRUE );
178
+			$content = EEH_Template::display_template(RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php', $template_args, TRUE);
179 179
 		}
180 180
 		return  $content;
181 181
 	}
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	 *  @param 	object 	$item
191 191
 	 *  @return 	void
192 192
 	 */
193
-	public static function the_event_rssjs_feed( $item ) {
194
-		if ( is_feed() && isset( $item->description )) {
195
-			$item->description = EED_Feeds::the_event_feed( $item->description );
193
+	public static function the_event_rssjs_feed($item) {
194
+		if (is_feed() && isset($item->description)) {
195
+			$item->description = EED_Feeds::the_event_feed($item->description);
196 196
 		}
197 197
 		return $item;
198 198
 	}
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
 	 *  @param 	string 	$content
208 208
 	 *  @return 	void
209 209
 	 */
210
-	public static function the_venue_feed( $content ) {
211
-		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php' )) {
212
-			EE_Registry::instance()->load_helper( 'Event_View' );
213
-			EE_Registry::instance()->load_helper( 'Venue_View' );
210
+	public static function the_venue_feed($content) {
211
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php')) {
212
+			EE_Registry::instance()->load_helper('Event_View');
213
+			EE_Registry::instance()->load_helper('Venue_View');
214 214
  			global $post;
215 215
 			$template_args = array(
216 216
 				'VNU_ID' => $post->ID,
217 217
 				'venue_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content
218 218
 			);
219
-			$content = EEH_Template::display_template( RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php', $template_args, TRUE );
219
+			$content = EEH_Template::display_template(RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php', $template_args, TRUE);
220 220
 		}
221 221
 		return $content;
222 222
 	}
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
 	 *  @param 	object 	$item
232 232
 	 *  @return 	void
233 233
 	 */
234
-	public static function the_venue_rssjs_feed( $item ) {
235
-		if ( is_feed() && isset( $item->description )) {
236
-			$item->description = EED_Feeds::the_venue_feed( $item->description );
234
+	public static function the_venue_rssjs_feed($item) {
235
+		if (is_feed() && isset($item->description)) {
236
+			$item->description = EED_Feeds::the_venue_feed($item->description);
237 237
 		}
238 238
 		return $item;
239 239
 	}
Please login to merge, or discard this patch.
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.
modules/messages/EED_Messages.module.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -558,7 +558,7 @@
 block discarded – undo
558 558
 	 *
559 559
 	 * @param string  $payment_status The payment status being matched.
560 560
 	 *
561
-	 * @return string|bool The payment message type slug matching the status or false if no match.
561
+	 * @return string|false The payment message type slug matching the status or false if no match.
562 562
 	 */
563 563
 	protected static function _get_payment_message_type( $payment_status ) {
564 564
 		$matches = array(
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package  Event Espresso
7 7
  * @subpackage modules, messages
8 8
  */
9
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10
+	exit('No direct script access allowed');
11
+}
10 12
 /**
11 13
  *
12 14
  * Messages module.  Takes care of registering all the triggers for messages.
@@ -216,14 +218,16 @@  discard block
 block discarded – undo
216 218
 			$template = basename( $template_path );
217 219
 
218 220
 			//is this already set?
219
-			if ( isset( self::$_TMP_PACKS[$template] ) )
220
-				continue;
221
+			if ( isset( self::$_TMP_PACKS[$template] ) ) {
222
+							continue;
223
+			}
221 224
 
222 225
 			//setup classname.
223 226
 			$pack_class = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_' , ' ', $template ) ) );
224 227
 
225
-			if ( ! class_exists( $pack_class ) )
226
-				continue;
228
+			if ( ! class_exists( $pack_class ) ) {
229
+							continue;
230
+			}
227 231
 
228 232
 			$template_packs[$template] = new $pack_class;
229 233
 		}
Please login to merge, or discard this patch.
Spacing   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @return EED_Module
59 59
 	 */
60 60
 	public static function instance() {
61
-		return parent::get_instance( __CLASS__ );
61
+		return parent::get_instance(__CLASS__);
62 62
 	}
63 63
 
64 64
 
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public static function set_hooks() {
75 75
 		//actions
76
-		add_action( 'AHEE__EE_Payment_Processor__update_txn_based_on_payment', array( 'EED_Messages', 'payment' ), 10, 2 );
77
-		add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', array( 'EED_Messages', 'maybe_registration' ), 10, 2 );
76
+		add_action('AHEE__EE_Payment_Processor__update_txn_based_on_payment', array('EED_Messages', 'payment'), 10, 2);
77
+		add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', array('EED_Messages', 'maybe_registration'), 10, 2);
78 78
 		//filters
79
-		add_filter( 'FHEE__EE_Registration__receipt_url__receipt_url', array( 'EED_Messages', 'registration_message_trigger_url' ), 10, 4 );
80
-		add_filter( 'FHEE__EE_Registration__invoice_url__invoice_url', array( 'EED_Messages', 'registration_message_trigger_url' ), 10, 4 );
79
+		add_filter('FHEE__EE_Registration__receipt_url__receipt_url', array('EED_Messages', 'registration_message_trigger_url'), 10, 4);
80
+		add_filter('FHEE__EE_Registration__invoice_url__invoice_url', array('EED_Messages', 'registration_message_trigger_url'), 10, 4);
81 81
 		//register routes
82 82
 		self::_register_routes();
83 83
 	}
@@ -90,15 +90,15 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public static function set_hooks_admin() {
92 92
 		//actions
93
-		add_action( 'AHEE__EE_Payment_Processor__update_txn_based_on_payment', array( 'EED_Messages', 'payment' ), 10, 2 );
94
-		add_action( 'AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', array( 'EED_Messages', 'payment_reminder'), 10 );
95
-		add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', array( 'EED_Messages', 'maybe_registration' ), 10, 3 );
96
-		add_action( 'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', array( 'EED_Messages', 'send_newsletter_message'), 10, 2 );
97
-		add_action( 'AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', array( 'EED_Messages', 'cancelled_registration' ), 10 );
93
+		add_action('AHEE__EE_Payment_Processor__update_txn_based_on_payment', array('EED_Messages', 'payment'), 10, 2);
94
+		add_action('AHEE__Transactions_Admin_Page___send_payment_reminder__process_admin_payment_reminder', array('EED_Messages', 'payment_reminder'), 10);
95
+		add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', array('EED_Messages', 'maybe_registration'), 10, 3);
96
+		add_action('AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', array('EED_Messages', 'send_newsletter_message'), 10, 2);
97
+		add_action('AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', array('EED_Messages', 'cancelled_registration'), 10);
98 98
 		//filters
99
-		add_filter( 'FHEE__EE_Admin_Page___process_admin_payment_notification__success', array( 'EED_Messages', 'process_admin_payment'), 10, 2 );
100
-		add_filter( 'FHEE__EE_Registration__receipt_url__receipt_url', array( 'EED_Messages', 'registration_message_trigger_url' ), 10, 4 );
101
-		add_filter( 'FHEE__EE_Registration__invoice_url__invoice_url', array( 'EED_Messages', 'registration_message_trigger_url' ), 10, 4 );
99
+		add_filter('FHEE__EE_Admin_Page___process_admin_payment_notification__success', array('EED_Messages', 'process_admin_payment'), 10, 2);
100
+		add_filter('FHEE__EE_Registration__receipt_url__receipt_url', array('EED_Messages', 'registration_message_trigger_url'), 10, 4);
101
+		add_filter('FHEE__EE_Registration__invoice_url__invoice_url', array('EED_Messages', 'registration_message_trigger_url'), 10, 4);
102 102
 	}
103 103
 
104 104
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @return void
113 113
 	 */
114 114
 	protected static function _register_routes() {
115
-		EE_Config::register_route( 'msg_url_trigger', 'Messages', 'run' );
116
-		do_action( 'AHEE__EED_Messages___register_routes' );
115
+		EE_Config::register_route('msg_url_trigger', 'Messages', 'run');
116
+		do_action('AHEE__EED_Messages___register_routes');
117 117
 	}
118 118
 
119 119
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @throws EE_Error
127 127
 	 * @return    void
128 128
 	 */
129
-	public function run( $WP ) {
129
+	public function run($WP) {
130 130
 
131 131
 		$sending_messenger = EE_Registry::instance()->REQ->is_set('snd_msgr') ? EE_Registry::instance()->REQ->get('snd_msgr') : '';
132 132
 		$generating_messenger = EE_Registry::instance()->REQ->is_set('gen_msgr') ? EE_Registry::instance()->REQ->get('gen_msgr') : '';
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 		$data_id = EE_Registry::instance()->REQ->is_set('id') ? (int) EE_Registry::instance()->REQ->get('id') : 0;
137 137
 
138 138
 		//verify the needed params are present.
139
-		if ( empty( $sending_messenger ) || empty( $generating_messenger ) || empty( $message_type ) || empty( $context ) || empty( $token ) ) {
140
-			EE_Error::add_error( __( 'The request for the "msg_url_trigger" route has a malformed url.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
139
+		if (empty($sending_messenger) || empty($generating_messenger) || empty($message_type) || empty($context) || empty($token)) {
140
+			EE_Error::add_error(__('The request for the "msg_url_trigger" route has a malformed url.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
141 141
 			return;
142 142
 		}
143 143
 		//get the registration: the token will always be the unique REG_url_link saved with a registration.  We use that to make sure we retrieve the correct data for the given registration.
144
-		$registration = EEM_Registration::instance()->get_one( array( array( 'REG_url_link' => $token ) ) );
144
+		$registration = EEM_Registration::instance()->get_one(array(array('REG_url_link' => $token)));
145 145
 		//if no registration then bail early.
146
-		if ( ! $registration instanceof EE_Registration ) {
147
-			EE_Error::add_error( __( 'Unable to complete the request because the token is invalid.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
146
+		if ( ! $registration instanceof EE_Registration) {
147
+			EE_Error::add_error(__('Unable to complete the request because the token is invalid.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
148 148
 			return;
149 149
 		}
150 150
 		//ensure controller is loaded
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
 			// retrieve the data via the handler
155 155
 			//  Depending on the context and the message type data handler, the data_id will correspond to the specific data handler item we need to retrieve for specific messages
156 156
 			// (i.e. a specific payment or specific refund).
157
-			$data = $this->_get_messages_data_from_url( $generating_messenger, $message_type, $registration, $data_id, $context );
157
+			$data = $this->_get_messages_data_from_url($generating_messenger, $message_type, $registration, $data_id, $context);
158 158
 			//make sure we drop generating messenger if both sending and generating are the same.
159 159
 			$generating_messenger = $sending_messenger != $generating_messenger ? $generating_messenger : NULL;
160 160
 			//now we can trigger the actual sending of the message via the message type.
161
-			self::$_EEMSG->send_message( $message_type, $data, $sending_messenger, $generating_messenger, $context );
162
-		} catch ( EE_Error $e ) {
163
-			$error_msg = __( 'Please note that a system message failed to send due to a technical issue.', 'event_espresso' );
161
+			self::$_EEMSG->send_message($message_type, $data, $sending_messenger, $generating_messenger, $context);
162
+		} catch (EE_Error $e) {
163
+			$error_msg = __('Please note that a system message failed to send due to a technical issue.', 'event_espresso');
164 164
 			// add specific message for developers if WP_DEBUG in on
165
-			$error_msg .= '||' . $e->getMessage();
166
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
165
+			$error_msg .= '||'.$e->getMessage();
166
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
167 167
 		}
168 168
 	}
169 169
 
@@ -178,17 +178,17 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @return EE_Messages_Template_Pack
180 180
 	 */
181
-	public static function get_template_pack( $template_pack_name ) {
182
-		if ( isset( self::$_TMP_PACKS[$template_pack_name] ) ) {
181
+	public static function get_template_pack($template_pack_name) {
182
+		if (isset(self::$_TMP_PACKS[$template_pack_name])) {
183 183
 			return self::$_TMP_PACKS[$template_pack_name];
184 184
 		}
185 185
 
186 186
 		//not set yet so let's attempt to get it.
187
-		$pack_class = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_' , ' ', $template_pack_name ) ) );
187
+		$pack_class = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $template_pack_name)));
188 188
 
189
-		if ( ! class_exists( $pack_class ) ) {
189
+		if ( ! class_exists($pack_class)) {
190 190
 			$pack_class = 'EE_Messages_Template_Pack_Default';
191
-			self::$_TMP_PACKS['default'] = empty( self::$_TMP_PACKS['default'] ) ? new $pack_class : self::$_TMP_PACKS['default'];
191
+			self::$_TMP_PACKS['default'] = empty(self::$_TMP_PACKS['default']) ? new $pack_class : self::$_TMP_PACKS['default'];
192 192
 			return self::$_TMP_PACKS['default'];
193 193
 		} else {
194 194
 			$pack = new $pack_class;
@@ -208,27 +208,27 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public static function get_template_packs() {
210 210
 		//glob the defaults directory for messages
211
-		$templates = glob( EE_LIBRARIES . 'messages/defaults/*', GLOB_ONLYDIR );
211
+		$templates = glob(EE_LIBRARIES.'messages/defaults/*', GLOB_ONLYDIR);
212 212
 		$template_packs = array();
213
-		foreach( $templates as $template_path ) {
213
+		foreach ($templates as $template_path) {
214 214
 			//grab folder name
215
-			$template = basename( $template_path );
215
+			$template = basename($template_path);
216 216
 
217 217
 			//is this already set?
218
-			if ( isset( self::$_TMP_PACKS[$template] ) )
218
+			if (isset(self::$_TMP_PACKS[$template]))
219 219
 				continue;
220 220
 
221 221
 			//setup classname.
222
-			$pack_class = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_' , ' ', $template ) ) );
222
+			$pack_class = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $template)));
223 223
 
224
-			if ( ! class_exists( $pack_class ) )
224
+			if ( ! class_exists($pack_class))
225 225
 				continue;
226 226
 
227 227
 			$template_packs[$template] = new $pack_class;
228 228
 		}
229 229
 
230
-		$template_packs = apply_filters( 'FHEE__EED_Messages__get_template_packs__template_packs', $template_packs );
231
-		self::$_TMP_PACKS = array_merge( self::$_TMP_PACKS, $template_packs );
230
+		$template_packs = apply_filters('FHEE__EED_Messages__get_template_packs__template_packs', $template_packs);
231
+		self::$_TMP_PACKS = array_merge(self::$_TMP_PACKS, $template_packs);
232 232
 		return self::$_TMP_PACKS;
233 233
 	}
234 234
 
@@ -250,15 +250,15 @@  discard block
 block discarded – undo
250 250
 	 *
251 251
 	 * @return mixed  (EE_Base_Class||EE_Base_Class[])
252 252
 	 */
253
-	protected function _get_messages_data_from_url( $generating_messenger, $message_type, EE_Registration $registration, $data_id, $context ) {
253
+	protected function _get_messages_data_from_url($generating_messenger, $message_type, EE_Registration $registration, $data_id, $context) {
254 254
 		//get message type object then get the correct data setup for that message type.
255
-		$message_type = self::$_EEMSG->get_active_message_type( $generating_messenger, $message_type );
255
+		$message_type = self::$_EEMSG->get_active_message_type($generating_messenger, $message_type);
256 256
 		//if no message type then it likely isn't active for this messenger.
257
-		if ( ! $message_type instanceof EE_message_type ) {
258
-			throw new EE_Error( sprintf( __('Unable to get data for the %s message type, likely because it is not active for the %s messenger.', 'event_espresso'), $message_type->name, $generating_messenger ) );
257
+		if ( ! $message_type instanceof EE_message_type) {
258
+			throw new EE_Error(sprintf(__('Unable to get data for the %s message type, likely because it is not active for the %s messenger.', 'event_espresso'), $message_type->name, $generating_messenger));
259 259
 		}
260 260
 		//get data according to data handler requirements
261
-		return $message_type->get_data_for_context( $context, $registration, $data_id );
261
+		return $message_type->get_data_for_context($context, $registration, $data_id);
262 262
 	}
263 263
 
264 264
 
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 	 * @return void
272 272
 	 */
273 273
 	public static function set_autoloaders() {
274
-		if ( empty( self::$_MSG_PATHS ) ) {
274
+		if (empty(self::$_MSG_PATHS)) {
275 275
 			self::_set_messages_paths();
276 276
 			EE_Registry::instance()->load_helper('Autoloader');
277
-			foreach ( self::$_MSG_PATHS as $path ) {
278
-				EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $path );
277
+			foreach (self::$_MSG_PATHS as $path) {
278
+				EEH_Autoloader::register_autoloaders_for_each_file_in_folder($path);
279 279
 			}
280 280
 		}
281 281
 	}
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
 			'shortcodes'
306 306
 			);
307 307
 		$paths = array();
308
-		foreach ( $dir_ref as $index => $dir ) {
309
-			$paths[$index] = EE_LIBRARIES . $dir;
308
+		foreach ($dir_ref as $index => $dir) {
309
+			$paths[$index] = EE_LIBRARIES.$dir;
310 310
 		}
311
-		self::$_MSG_PATHS = apply_filters( 'FHEE__EED_Messages___set_messages_paths___MSG_PATHS', $paths );
311
+		self::$_MSG_PATHS = apply_filters('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', $paths);
312 312
 	}
313 313
 
314 314
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 	 * @return void
321 321
 	 */
322 322
 	protected static function _load_controller() {
323
-		if ( ! self::$_EEMSG instanceof EE_messages ) {
323
+		if ( ! self::$_EEMSG instanceof EE_messages) {
324 324
 			self::set_autoloaders();
325 325
 			self::$_EEMSG = new EE_messages();
326 326
 		}
@@ -331,10 +331,10 @@  discard block
 block discarded – undo
331 331
 	/**
332 332
 	 * @param EE_Transaction $transaction
333 333
 	 */
334
-	public static function payment_reminder( EE_Transaction $transaction ) {
334
+	public static function payment_reminder(EE_Transaction $transaction) {
335 335
 		self::_load_controller();
336
-		$data = array( $transaction, null );
337
-		if ( self::$_EEMSG->send_message( 'payment_reminder', $data ) ) {
336
+		$data = array($transaction, null);
337
+		if (self::$_EEMSG->send_message('payment_reminder', $data)) {
338 338
 			//self::log(
339 339
 			//	__CLASS__, __FUNCTION__, __LINE__,
340 340
 			//	$transaction,
@@ -355,11 +355,11 @@  discard block
 block discarded – undo
355 355
 	 * @param  EE_Payment object
356 356
 	 * @return void
357 357
 	 */
358
-	public static function payment( EE_Transaction $transaction, EE_Payment $payment ) {
358
+	public static function payment(EE_Transaction $transaction, EE_Payment $payment) {
359 359
 		self::_load_controller();
360
-		$data = array( $transaction, $payment );
360
+		$data = array($transaction, $payment);
361 361
 
362
-		$message_type = self::_get_payment_message_type( $payment->STS_ID() );
362
+		$message_type = self::_get_payment_message_type($payment->STS_ID());
363 363
 
364 364
 		//if payment amount is less than 0 then switch to payment_refund message type.
365 365
 		$message_type = $payment->amount() < 0 ? 'payment_refund' : $message_type;
@@ -367,15 +367,15 @@  discard block
 block discarded – undo
367 367
 		//verify this message type is present and active.  If it isn't then no message is sent.
368 368
 		$active_mts = self::$_EEMSG->get_active_message_types();
369 369
 
370
-		$message_type = in_array( $message_type, $active_mts ) ? $message_type : false;
371
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, current_time( 'mysql' ), 'delivered' );
372
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $message_type, '$message_type' );
373
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $transaction->status_ID(), '$transaction->status_ID()' );
374
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $payment->status(), '$payment->status()' );
375
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, print_r( $active_mts, true ), '$active_mts' );
370
+		$message_type = in_array($message_type, $active_mts) ? $message_type : false;
371
+		do_action('AHEE_log', __FILE__, __FUNCTION__, current_time('mysql'), 'delivered');
372
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $message_type, '$message_type');
373
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $transaction->status_ID(), '$transaction->status_ID()');
374
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $payment->status(), '$payment->status()');
375
+		do_action('AHEE_log', __FILE__, __FUNCTION__, print_r($active_mts, true), '$active_mts');
376 376
 
377
-		if ( $message_type ) {
378
-			if ( self::$_EEMSG->send_message( $message_type, $data ) ) {
377
+		if ($message_type) {
378
+			if (self::$_EEMSG->send_message($message_type, $data)) {
379 379
 				//self::log(
380 380
 				//	__CLASS__, __FUNCTION__, __LINE__,
381 381
 				//	$transaction,
@@ -395,15 +395,15 @@  discard block
 block discarded – undo
395 395
 	/**
396 396
 	 * @param EE_Transaction $transaction
397 397
 	 */
398
-	public static function cancelled_registration( EE_Transaction $transaction ) {
398
+	public static function cancelled_registration(EE_Transaction $transaction) {
399 399
 		self::_load_controller();
400 400
 
401
-		$data = array( $transaction, NULL );
401
+		$data = array($transaction, NULL);
402 402
 
403 403
 		$active_mts = self::$_EEMSG->get_active_message_types();
404 404
 
405
-		if ( in_array( 'cancelled_registration', $active_mts ) ) {
406
-			self::$_EEMSG->send_message( 'cancelled_registration', $data );
405
+		if (in_array('cancelled_registration', $active_mts)) {
406
+			self::$_EEMSG->send_message('cancelled_registration', $data);
407 407
 		}
408 408
 		return;
409 409
 	}
@@ -418,15 +418,15 @@  discard block
 block discarded – undo
418 418
 	 * @param array $extra_details
419 419
 	 * @return void
420 420
 	 */
421
-	public static function maybe_registration( EE_Registration $registration, $extra_details = array() ) {
421
+	public static function maybe_registration(EE_Registration $registration, $extra_details = array()) {
422 422
 
423
-		if ( ! self::_verify_registration_notification_send( $registration, $extra_details ) ) {
423
+		if ( ! self::_verify_registration_notification_send($registration, $extra_details)) {
424 424
 			//no messages please
425 425
 			return;
426 426
 		}
427 427
 
428 428
 
429
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
429
+		EE_Registry::instance()->load_helper('MSG_Template');
430 430
 
431 431
 		//get all registrations so we make sure we send messages for the right status.
432 432
 		$all_registrations = $registration->transaction()->registrations();
@@ -435,19 +435,19 @@  discard block
 block discarded – undo
435 435
 		$statuses_sent = array();
436 436
 
437 437
 		//loop through registrations and trigger messages once per status.
438
-		foreach ( $all_registrations as $reg ) {
438
+		foreach ($all_registrations as $reg) {
439 439
 
440 440
 			//already triggered?
441
-			if ( in_array( $reg->status_ID(), $statuses_sent ) ) {
441
+			if (in_array($reg->status_ID(), $statuses_sent)) {
442 442
 				continue;
443 443
 			}
444 444
 
445
-			$message_type = self::_get_reg_status_array( $reg->status_ID() );
446
-			if ( EEH_MSG_Template::is_mt_active( $message_type ) ) {
445
+			$message_type = self::_get_reg_status_array($reg->status_ID());
446
+			if (EEH_MSG_Template::is_mt_active($message_type)) {
447 447
 				self::_load_controller();
448 448
 
449 449
 				//send away, send away, uhhuh
450
-				if ( self::$_EEMSG->send_message( $message_type, array( $registration->transaction(), null, $reg->status_ID() ) ) ) {
450
+				if (self::$_EEMSG->send_message($message_type, array($registration->transaction(), null, $reg->status_ID()))) {
451 451
 					// DEBUG LOG
452 452
 					// self::log(
453 453
 					// 	__CLASS__, __FUNCTION__, __LINE__,
@@ -466,9 +466,9 @@  discard block
 block discarded – undo
466 466
 		}
467 467
 
468 468
 		//now send summary (registration_summary) if active
469
-		if ( EEH_MSG_Template::is_mt_active( 'registration_summary' ) ) {
469
+		if (EEH_MSG_Template::is_mt_active('registration_summary')) {
470 470
 			self::_load_controller();
471
-			if ( self::$_EEMSG->send_message( 'registration_summary', array( $registration->transaction(), null ) ) ) {
471
+			if (self::$_EEMSG->send_message('registration_summary', array($registration->transaction(), null))) {
472 472
 					// DEBUG LOG
473 473
 					// self::log(
474 474
 					// 	__CLASS__, __FUNCTION__, __LINE__,
@@ -494,18 +494,18 @@  discard block
 block discarded – undo
494 494
 	 *
495 495
 	 * @return bool          true = send away, false = nope halt the presses.
496 496
 	 */
497
-	protected static function _verify_registration_notification_send( EE_Registration $registration, $extra_details = array() ) {
497
+	protected static function _verify_registration_notification_send(EE_Registration $registration, $extra_details = array()) {
498 498
 		 //self::log(
499 499
 		 //	__CLASS__, __FUNCTION__, __LINE__,
500 500
 		 //	$registration->transaction(),
501 501
 		 //	array( '$extra_details' => $extra_details )
502 502
 		 //);
503 503
 		// currently only using this to send messages for the primary registrant
504
-		if ( ! $registration->is_primary_registrant() ) {
504
+		if ( ! $registration->is_primary_registrant()) {
505 505
 			return false;
506 506
 		}
507 507
 		if (
508
-			! apply_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', false ) &&
508
+			! apply_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications', false) &&
509 509
 			$registration->status_ID() !== EEM_Registration::status_id_not_approved
510 510
 		) {
511 511
 			return false;
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	 * @param string $reg_status
523 523
 	 * @return array
524 524
 	 */
525
-	protected static function _get_reg_status_array( $reg_status = '' ) {
525
+	protected static function _get_reg_status_array($reg_status = '') {
526 526
 		$reg_status_array = array(
527 527
 			EEM_Registration::status_id_approved => 'registration',
528 528
 			EEM_Registration::status_id_pending_payment => 'pending_approval',
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 			EEM_Registration::status_id_cancelled => 'cancelled_registration',
531 531
 			EEM_Registration::status_id_declined => 'declined_registration'
532 532
 		);
533
-		return isset( $reg_status_array[ $reg_status ] ) ? $reg_status_array[ $reg_status ] : $reg_status_array;
533
+		return isset($reg_status_array[$reg_status]) ? $reg_status_array[$reg_status] : $reg_status_array;
534 534
 	}
535 535
 
536 536
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 	 *
543 543
 	 * @return string|bool The payment message type slug matching the status or false if no match.
544 544
 	 */
545
-	protected static function _get_payment_message_type( $payment_status ) {
545
+	protected static function _get_payment_message_type($payment_status) {
546 546
 		$matches = array(
547 547
 			EEM_Payment::status_id_approved => 'payment',
548 548
 			EEM_Payment::status_id_pending => 'payment_pending',
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 			EEM_Payment::status_id_failed => 'payment_failed'
552 552
 			);
553 553
 
554
-		return isset( $matches[$payment_status] ) ? $matches[$payment_status] : false;
554
+		return isset($matches[$payment_status]) ? $matches[$payment_status] : false;
555 555
 	}
556 556
 
557 557
 
@@ -564,22 +564,22 @@  discard block
 block discarded – undo
564 564
 	 * @param array $req_data This is the $_POST & $_GET data sent from EE_Admin Pages
565 565
 	 * @return bool          success/fail
566 566
 	 */
567
-	public static function process_resend( $req_data ) {
567
+	public static function process_resend($req_data) {
568 568
 		$regs_to_send = array();
569 569
 
570 570
 		//first let's make sure we have the reg id (needed for resending!);
571
-		if ( ! isset( $req_data['_REG_ID'] ) ) {
572
-			EE_Error::add_error( __('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
571
+		if ( ! isset($req_data['_REG_ID'])) {
572
+			EE_Error::add_error(__('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
573 573
 			return false;
574 574
 		}
575 575
 
576 576
 		//if $req_data['_REG_ID'] is an array then let's group the registrations by transaction and reg status
577 577
 		// so we can only trigger messages per group.
578
-		if ( is_array( $req_data['_REG_ID'] ) ) {
579
-			foreach ( $req_data['_REG_ID'] as $reg_id ) {
580
-				$reg = EE_Registry::instance()->load_model( 'Registration' )->get_one_by_ID( $reg_id );
581
-				if ( ! $reg instanceof EE_Registration ) {
582
-					EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID'] ) );
578
+		if (is_array($req_data['_REG_ID'])) {
579
+			foreach ($req_data['_REG_ID'] as $reg_id) {
580
+				$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID($reg_id);
581
+				if ( ! $reg instanceof EE_Registration) {
582
+					EE_Error::add_error(sprintf(__('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID']));
583 583
 					return false;
584 584
 				}
585 585
 				$regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg;
@@ -587,11 +587,11 @@  discard block
 block discarded – undo
587 587
 		} else {
588 588
 			//we have a single registration id, so let's see if we can get a EE_Registration from it, and if so set it up for sending.
589 589
 			//get reg object from reg_id
590
-			$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID( $req_data['_REG_ID'] );
590
+			$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID($req_data['_REG_ID']);
591 591
 
592 592
 			//if no reg object then send error
593
-			if ( ! $reg instanceof EE_Registration ) {
594
-				EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID'] ) );
593
+			if ( ! $reg instanceof EE_Registration) {
594
+				EE_Error::add_error(sprintf(__('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID']));
595 595
 				return false;
596 596
 			}
597 597
 
@@ -603,26 +603,26 @@  discard block
 block discarded – undo
603 603
 		$active_mts = self::$_EEMSG->get_active_message_types();
604 604
 		$success = false;
605 605
 		//loop through and send!
606
-		foreach( $regs_to_send as $status_group ) {
607
-			foreach ( $status_group as $status_id => $registrations ) {
608
-				if ( ! in_array( $status_match_array[ $status_id ], $active_mts ) ) {
606
+		foreach ($regs_to_send as $status_group) {
607
+			foreach ($status_group as $status_id => $registrations) {
608
+				if ( ! in_array($status_match_array[$status_id], $active_mts)) {
609 609
 					EE_Error::add_error(
610 610
 						sprintf(
611 611
 							__('Cannot resend the message for this registration because the corresponding message type (%1$s) is not active.  If you wish to send messages for this message type then please activate it by visiting the %2$sMessages Admin Page%3$s.', 'event_espresso'),
612
-							$status_match_array[ $reg->status_ID() ],
613
-							'<a href="' . admin_url('admin.php?page=espresso_messages&action=settings') . '">',
612
+							$status_match_array[$reg->status_ID()],
613
+							'<a href="'.admin_url('admin.php?page=espresso_messages&action=settings').'">',
614 614
 							'</a>'
615 615
 						)
616 616
 					);
617 617
 					return false;
618 618
 				}
619 619
 
620
-				if ( self::$_EEMSG->send_message( $status_match_array[$status_id], array( $registrations, $status_id ) ) ) {
620
+				if (self::$_EEMSG->send_message($status_match_array[$status_id], array($registrations, $status_id))) {
621 621
 					EE_Error::overwrite_success();
622
-					EE_Error::add_success( __('The message for this registration has been re-sent', 'event_espresso') );
622
+					EE_Error::add_success(__('The message for this registration has been re-sent', 'event_espresso'));
623 623
 					$success = true;
624 624
 				} else {
625
-					EE_Error::add_error( __('Something went wrong and the message for this registration was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
625
+					EE_Error::add_error(__('Something went wrong and the message for this registration was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
626 626
 				}
627 627
 			}
628 628
 		}
@@ -644,12 +644,12 @@  discard block
 block discarded – undo
644 644
 	 * @param  EE_Payment $payment EE_payment object
645 645
 	 * @return bool              success/fail
646 646
 	 */
647
-	public static function process_admin_payment( $success = TRUE, EE_Payment $payment ) {
647
+	public static function process_admin_payment($success = TRUE, EE_Payment $payment) {
648 648
 		//we need to get the transaction object
649 649
 		$transaction = $payment->transaction();
650
-		if ( $transaction instanceof EE_Transaction ) {
651
-			$data = array( $transaction, $payment );
652
-			$message_type = self::_get_payment_message_type( $payment->STS_ID() );
650
+		if ($transaction instanceof EE_Transaction) {
651
+			$data = array($transaction, $payment);
652
+			$message_type = self::_get_payment_message_type($payment->STS_ID());
653 653
 
654 654
 			//if payment amount is less than 0 then switch to payment_refund message type.
655 655
 			$message_type = $payment->amount() < 0 ? 'payment_refund' : $message_type;
@@ -660,18 +660,18 @@  discard block
 block discarded – undo
660 660
 			self::_load_controller();
661 661
 			//verify this message type is present and active.  If it isn't then no message is sent.
662 662
 			$active_mts = self::$_EEMSG->get_active_message_types();
663
-			$message_type = in_array( $message_type, $active_mts ) ? $message_type : false;
663
+			$message_type = in_array($message_type, $active_mts) ? $message_type : false;
664 664
 
665 665
 
666
-			if ( $message_type ) {
666
+			if ($message_type) {
667 667
 
668
-				$success = self::$_EEMSG->send_message( $message_type, $data );
669
-				if ( ! $success ) {
670
-					EE_Error::add_error( __('Something went wrong and the payment confirmation was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
668
+				$success = self::$_EEMSG->send_message($message_type, $data);
669
+				if ( ! $success) {
670
+					EE_Error::add_error(__('Something went wrong and the payment confirmation was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
671 671
 				}
672 672
 
673 673
 			} else {
674
-				EE_Error::add_error( __('The message type for the status of this payment is not active or does not exist, so no notification was sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
674
+				EE_Error::add_error(__('The message type for the status of this payment is not active or does not exist, so no notification was sent.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
675 675
 			}
676 676
 
677 677
 		}
@@ -689,9 +689,9 @@  discard block
 block discarded – undo
689 689
 	 * @param  int      	      $grp_id     a specific message template group id.
690 690
 	 * @return void
691 691
 	 */
692
-	public static function send_newsletter_message( $contacts, $grp_id ) {
692
+	public static function send_newsletter_message($contacts, $grp_id) {
693 693
 		//make sure mtp is id and set it in the EE_Request Handler later messages setup.
694
-		EE_Registry::instance()->REQ->set( 'GRP_ID', (int) $grp_id );
694
+		EE_Registry::instance()->REQ->set('GRP_ID', (int) $grp_id);
695 695
 
696 696
 		self::_load_controller();
697 697
 		self::$_EEMSG->send_message('newsletter', $contacts);
@@ -709,10 +709,10 @@  discard block
 block discarded – undo
709 709
 	 * @param string 	$message_type
710 710
 	 * @return 	string
711 711
 	 */
712
-	public static function registration_message_trigger_url( $registration_message_trigger_url, EE_Registration $registration, $messenger = 'html', $message_type = 'invoice' ) {
712
+	public static function registration_message_trigger_url($registration_message_trigger_url, EE_Registration $registration, $messenger = 'html', $message_type = 'invoice') {
713 713
 		EE_Registry::instance()->load_helper('MSG_Template');
714 714
 		// whitelist $messenger
715
-		switch ( $messenger ) {
715
+		switch ($messenger) {
716 716
 			case 'pdf' :
717 717
 				$sending_messenger = 'pdf';
718 718
 				$generating_messenger = 'html';
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 				break;
725 725
 		}
726 726
 		// whitelist $message_type
727
-		switch ( $message_type ) {
727
+		switch ($message_type) {
728 728
 			case 'receipt' :
729 729
 				$message_type = 'receipt';
730 730
 				break;
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 				break;
735 735
 		}
736 736
 		// verify that both the messenger AND the message type are active
737
-		if ( EEH_MSG_Template::is_messenger_active( $sending_messenger ) && EEH_MSG_Template::is_mt_active( $message_type )) {
737
+		if (EEH_MSG_Template::is_messenger_active($sending_messenger) && EEH_MSG_Template::is_mt_active($message_type)) {
738 738
 			//need to get the correct message template group for this (i.e. is there a custom invoice for the event this registration is registered for?)
739 739
 			$template_query_params = array(
740 740
 				'MTP_is_active' => TRUE,
@@ -743,16 +743,16 @@  discard block
 block discarded – undo
743 743
 				'Event.EVT_ID' => $registration->event_ID()
744 744
 			);
745 745
 			//get the message template group.
746
-			$msg_template_group = EEM_Message_Template_Group::instance()->get_one( array( $template_query_params ));
746
+			$msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params));
747 747
 			//if we don't have an EE_Message_Template_Group then return
748
-			if ( ! $msg_template_group instanceof EE_Message_Template_Group ) {
748
+			if ( ! $msg_template_group instanceof EE_Message_Template_Group) {
749 749
 				// remove EVT_ID from query params so that global templates get picked up
750
-				unset( $template_query_params[ 'Event.EVT_ID' ] );
750
+				unset($template_query_params['Event.EVT_ID']);
751 751
 				//get global template as the fallback
752
-				$msg_template_group = EEM_Message_Template_Group::instance()->get_one( array( $template_query_params ));
752
+				$msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params));
753 753
 			}
754 754
 			//if we don't have an EE_Message_Template_Group then return
755
-			if ( ! $msg_template_group instanceof EE_Message_Template_Group ) {
755
+			if ( ! $msg_template_group instanceof EE_Message_Template_Group) {
756 756
 				return '';
757 757
 			}
758 758
 			// generate the URL
@@ -782,17 +782,17 @@  discard block
 block discarded – undo
782 782
 	 * @param array $info
783 783
 	 * @param bool $display_request
784 784
 	 */
785
-	protected static function log( $class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false ) {
785
+	protected static function log($class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false) {
786 786
 		EE_Registry::instance()->load_helper('Debug_Tools');
787
-		if ( WP_DEBUG && false ) {
788
-			if ( $transaction instanceof EE_Transaction ) {
787
+		if (WP_DEBUG && false) {
788
+			if ($transaction instanceof EE_Transaction) {
789 789
 				// don't serialize objects
790
-				$info = EEH_Debug_Tools::strip_objects( $info );
791
-				$info[ 'TXN_status' ] = $transaction->status_ID();
792
-				$info[ 'TXN_reg_steps' ] = $transaction->reg_steps();
793
-				if ( $transaction->ID() ) {
794
-					$index = 'EE_Transaction: ' . $transaction->ID();
795
-					EEH_Debug_Tools::log( $class, $func, $line, $info, $display_request, $index );
790
+				$info = EEH_Debug_Tools::strip_objects($info);
791
+				$info['TXN_status'] = $transaction->status_ID();
792
+				$info['TXN_reg_steps'] = $transaction->reg_steps();
793
+				if ($transaction->ID()) {
794
+					$index = 'EE_Transaction: '.$transaction->ID();
795
+					EEH_Debug_Tools::log($class, $func, $line, $info, $display_request, $index);
796 796
 				}
797 797
 			}
798 798
 		}
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_Checkout.class.php 3 patches
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 	/**
253 253
 	 * returns true if ANY reg status was updated during checkout
254
-	 * @return array
254
+	 * @return boolean|null
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257 257
 		foreach ( $this->reg_status_updated as $reg_status ) {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 	/**
277 277
 	 * @param $REG_ID
278
-	 * @param $reg_status
278
+	 * @param boolean $reg_status
279 279
 	 */
280 280
 	public function set_reg_status_updated( $REG_ID, $reg_status ) {
281 281
 		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 	 * 	reset_reg_steps
531 531
 	 *
532 532
 	 * 	@access public
533
-	 * 	@return 	bool
533
+	 * 	@return 	boolean|null
534 534
 	 */
535 535
 	public function reset_reg_steps() {
536 536
 		$this->sort_reg_steps();
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 	 * 	stores whether any updates were made to the TXN or it's related registrations
644 644
 	 *
645 645
 	 * 	@access public
646
-	 * 	@return 	bool
646
+	 * 	@return 	boolean|null
647 647
 	 */
648 648
 	public function track_transaction_and_registration_status_updates() {
649 649
 		// verify the transaction
@@ -991,6 +991,7 @@  discard block
 block discarded – undo
991 991
 	 *
992 992
 	 * @param 	string | int 	$reg_cache_ID
993 993
 	 * @param 	EE_Registration 	$registration
994
+	 * @param integer $reg_cache_ID
994 995
 	 * @return void
995 996
 	 */
996 997
 	protected function _refresh_registration( $reg_cache_ID, $registration ) {
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_Checkout
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_Checkout
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 class EE_Checkout {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 		$this->reg_page_base_url = EE_Registry::instance()->CFG->core->reg_page_url();
243 243
 		$this->thank_you_page_url = EE_Registry::instance()->CFG->core->thank_you_page_url();
244 244
 		$this->cancel_page_url = EE_Registry::instance()->CFG->core->cancel_page_url();
245
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', TRUE );
245
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', TRUE);
246 246
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->ajax;
247
-		$this->reg_cache_where_params = array( 'order_by' => array( 'REG_count' => 'ASC' ));
247
+		$this->reg_cache_where_params = array('order_by' => array('REG_count' => 'ASC'));
248 248
 	}
249 249
 
250 250
 
@@ -254,8 +254,8 @@  discard block
 block discarded – undo
254 254
 	 * @return array
255 255
 	 */
256 256
 	public function any_reg_status_updated() {
257
-		foreach ( $this->reg_status_updated as $reg_status ) {
258
-			if ( $reg_status ) {
257
+		foreach ($this->reg_status_updated as $reg_status) {
258
+			if ($reg_status) {
259 259
 				return true;
260 260
 			}
261 261
 		}
@@ -267,8 +267,8 @@  discard block
 block discarded – undo
267 267
 	 * @param $REG_ID
268 268
 	 * @return array
269 269
 	 */
270
-	public function reg_status_updated( $REG_ID ) {
271
-		return isset( $this->reg_status_updated[ $REG_ID ] ) ? $this->reg_status_updated[ $REG_ID ] : false;
270
+	public function reg_status_updated($REG_ID) {
271
+		return isset($this->reg_status_updated[$REG_ID]) ? $this->reg_status_updated[$REG_ID] : false;
272 272
 	}
273 273
 
274 274
 
@@ -277,8 +277,8 @@  discard block
 block discarded – undo
277 277
 	 * @param $REG_ID
278 278
 	 * @param $reg_status
279 279
 	 */
280
-	public function set_reg_status_updated( $REG_ID, $reg_status ) {
281
-		$this->reg_status_updated[ $REG_ID ] = filter_var( $reg_status, FILTER_VALIDATE_BOOLEAN );
280
+	public function set_reg_status_updated($REG_ID, $reg_status) {
281
+		$this->reg_status_updated[$REG_ID] = filter_var($reg_status, FILTER_VALIDATE_BOOLEAN);
282 282
 	}
283 283
 
284 284
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * can ONLY be set by the  Finalize_Registration reg step
300 300
 	 */
301 301
 	public function set_exit_spco() {
302
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) {
302
+		if ($this->current_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) {
303 303
 			$this->exit_spco = true;
304 304
 		}
305 305
 	}
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	public function reset_for_current_request() {
318 318
 		$this->process_form_submission = FALSE;
319
-		$this->continue_reg = apply_filters( 'FHEE__EE_Checkout___construct___continue_reg', true );
319
+		$this->continue_reg = apply_filters('FHEE__EE_Checkout___construct___continue_reg', true);
320 320
 		$this->admin_request = is_admin() && ! EE_Registry::instance()->REQ->front_ajax;
321 321
 		$this->continue_reg = true;
322 322
 		$this->redirect = false;
323 323
 		// don't reset the cached redirect form if we're about to be asked to display it !!!
324
-		if ( EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ) !== 'redirect_form' ) {
324
+		if (EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step') !== 'redirect_form') {
325 325
 			$this->redirect_form = '';
326 326
 		}
327 327
 		$this->redirect_url = '';
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 	 * @param EE_SPCO_Reg_Step $reg_step_obj
339 339
 	 * @return    void
340 340
 	 */
341
-	public function add_reg_step( EE_SPCO_Reg_Step $reg_step_obj ) {
342
-		$this->reg_steps[ $reg_step_obj->slug()  ] = $reg_step_obj;
341
+	public function add_reg_step(EE_SPCO_Reg_Step $reg_step_obj) {
342
+		$this->reg_steps[$reg_step_obj->slug()] = $reg_step_obj;
343 343
 	}
344 344
 
345 345
 
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 	 * @param string $reg_step_slug
352 352
 	 * @return    void
353 353
 	 */
354
-	public function remove_reg_step( $reg_step_slug = '' ) {
355
-		unset( $this->reg_steps[ $reg_step_slug  ] );
356
-		if ( $this->transaction instanceof EE_Transaction ) {
354
+	public function remove_reg_step($reg_step_slug = '') {
355
+		unset($this->reg_steps[$reg_step_slug]);
356
+		if ($this->transaction instanceof EE_Transaction) {
357 357
 			/** @type EE_Transaction_Processor $transaction_processor */
358
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
358
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
359 359
 			// now remove reg step from TXN and save
360
-			$transaction_processor->remove_reg_step( $this->transaction, $reg_step_slug );
360
+			$transaction_processor->remove_reg_step($this->transaction, $reg_step_slug);
361 361
 			$this->transaction->save();
362 362
 		}
363 363
 	}
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
 	 * @param int    $order
373 373
 	 * @return    void
374 374
 	 */
375
-	public function set_reg_step_order( $reg_step_slug = '', $order = 100 ) {
376
-		if ( isset( $this->reg_steps[ $reg_step_slug  ] )) {
377
-			$this->reg_steps[ $reg_step_slug ]->set_order( $order );
375
+	public function set_reg_step_order($reg_step_slug = '', $order = 100) {
376
+		if (isset($this->reg_steps[$reg_step_slug])) {
377
+			$this->reg_steps[$reg_step_slug]->set_order($order);
378 378
 		}
379 379
 	}
380 380
 
@@ -387,25 +387,25 @@  discard block
 block discarded – undo
387 387
 	 * @param string $current_step
388 388
 	 * @return    void
389 389
 	 */
390
-	public function set_current_step( $current_step ) {
390
+	public function set_current_step($current_step) {
391 391
 		// grab what step we're on
392
-		$this->current_step = isset( $this->reg_steps[ $current_step ] ) ? $this->reg_steps[ $current_step ] : reset( $this->reg_steps );
392
+		$this->current_step = isset($this->reg_steps[$current_step]) ? $this->reg_steps[$current_step] : reset($this->reg_steps);
393 393
 		// verify instance
394
-		if ( $this->current_step instanceof EE_SPCO_Reg_Step ) {
394
+		if ($this->current_step instanceof EE_SPCO_Reg_Step) {
395 395
 			// we don't want to repeat completed steps if this is the first time through SPCO
396
-			if ( $this->continue_reg && $this->current_step->completed() && ! $this->revisit ) {
396
+			if ($this->continue_reg && $this->current_step->completed() && ! $this->revisit) {
397 397
 				// so advance to the next step
398 398
 				$this->set_next_step();
399
-				if ( $this->next_step instanceof EE_SPCO_Reg_Step ) {
399
+				if ($this->next_step instanceof EE_SPCO_Reg_Step) {
400 400
 					// and attempt to set it as the current step
401
-					$this->set_current_step( $this->next_step->slug() );
401
+					$this->set_current_step($this->next_step->slug());
402 402
 				}
403 403
 				return;
404 404
 			}
405
-			$this->current_step->set_is_current_step( TRUE );
405
+			$this->current_step->set_is_current_step(TRUE);
406 406
 		} else {
407 407
 			EE_Error::add_error(
408
-				__( 'The current step could not be set.', 'event_espresso' ),
408
+				__('The current step could not be set.', 'event_espresso'),
409 409
 				__FILE__, __FUNCTION__, __LINE__
410 410
 			);
411 411
 		}
@@ -422,20 +422,20 @@  discard block
 block discarded – undo
422 422
 	 */
423 423
 	public function set_next_step() {
424 424
 		// set pointer to start of array
425
-		reset( $this->reg_steps );
425
+		reset($this->reg_steps);
426 426
 		// if there is more than one step
427
-		if ( count( $this->reg_steps ) > 1 ) {
427
+		if (count($this->reg_steps) > 1) {
428 428
 			// advance to the current step and set pointer
429
-			while ( key( $this->reg_steps ) != $this->current_step->slug() && key( $this->reg_steps ) != '' ) {
430
-				next( $this->reg_steps );
429
+			while (key($this->reg_steps) != $this->current_step->slug() && key($this->reg_steps) != '') {
430
+				next($this->reg_steps);
431 431
 			}
432 432
 		}
433 433
 		// advance one more spot ( if it exists )
434
-		$this->next_step = next( $this->reg_steps );
434
+		$this->next_step = next($this->reg_steps);
435 435
 		// verify instance
436
-		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step  : NULL;
436
+		$this->next_step = $this->next_step instanceof EE_SPCO_Reg_Step ? $this->next_step : NULL;
437 437
 		// then back to current step to reset
438
-		prev( $this->reg_steps );
438
+		prev($this->reg_steps);
439 439
 	}
440 440
 
441 441
 
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
 	 *  @return 	EE_SPCO_Reg_Step | null
450 450
 	 */
451 451
 	public function get_next_reg_step() {
452
-		$next = next( $this->reg_steps );
453
-		prev( $this->reg_steps );
452
+		$next = next($this->reg_steps);
453
+		prev($this->reg_steps);
454 454
 		return $next instanceof EE_SPCO_Reg_Step ? $next : null;
455 455
 	}
456 456
 
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 	 *  @return 	EE_SPCO_Reg_Step | null
466 466
 	 */
467 467
 	public function get_prev_reg_step() {
468
-		$prev = prev( $this->reg_steps );
469
-		next( $this->reg_steps );
468
+		$prev = prev($this->reg_steps);
469
+		next($this->reg_steps);
470 470
 		return $prev instanceof EE_SPCO_Reg_Step ? $prev : null;
471 471
 	}
472 472
 
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
 	 * @return void
480 480
 	 */
481 481
 	public function sort_reg_steps() {
482
-		$reg_step_sorting_callback = apply_filters( 'FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback' );
483
-		uasort( $this->reg_steps, array( $this, $reg_step_sorting_callback ));
482
+		$reg_step_sorting_callback = apply_filters('FHEE__EE_Checkout__sort_reg_steps__reg_step_sorting_callback', 'reg_step_sorting_callback');
483
+		uasort($this->reg_steps, array($this, $reg_step_sorting_callback));
484 484
 	}
485 485
 
486 486
 
@@ -493,17 +493,17 @@  discard block
 block discarded – undo
493 493
 	 * @param EE_SPCO_Reg_Step $reg_step_B
494 494
 	 * @return array()
495 495
 	 */
496
-	public function reg_step_sorting_callback( EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B ) {
496
+	public function reg_step_sorting_callback(EE_SPCO_Reg_Step $reg_step_A, EE_SPCO_Reg_Step $reg_step_B) {
497 497
 		// send finalize_registration step to the end of the array
498
-		if ( $reg_step_A->slug() == 'finalize_registration' ) {
498
+		if ($reg_step_A->slug() == 'finalize_registration') {
499 499
 			return 1;
500
-		} else if ( $reg_step_B->slug() == 'finalize_registration' ) {
500
+		} else if ($reg_step_B->slug() == 'finalize_registration') {
501 501
 			return -1;
502 502
 		}
503
-		if ( $reg_step_A->order() == $reg_step_B->order() ) {
503
+		if ($reg_step_A->order() == $reg_step_B->order()) {
504 504
 			return 0;
505 505
 		}
506
-		return ( $reg_step_A->order() > $reg_step_B->order() ) ? 1 : -1;
506
+		return ($reg_step_A->order() > $reg_step_B->order()) ? 1 : -1;
507 507
 	}
508 508
 
509 509
 
@@ -515,10 +515,10 @@  discard block
 block discarded – undo
515 515
 	 * 	@return 	void
516 516
 	 */
517 517
 	public function set_reg_step_JSON_info() {
518
-		EE_Registry::$i18n_js_strings[ 'reg_steps' ] = array();
518
+		EE_Registry::$i18n_js_strings['reg_steps'] = array();
519 519
 		// pass basic reg step data to JS
520
-		foreach ( $this->reg_steps as $reg_step ) {
521
-			EE_Registry::$i18n_js_strings[ 'reg_steps' ][] = $reg_step->slug();
520
+		foreach ($this->reg_steps as $reg_step) {
521
+			EE_Registry::$i18n_js_strings['reg_steps'][] = $reg_step->slug();
522 522
 		}
523 523
 		// reset reg step html
524 524
 //		$this->json_response->set_reg_step_html( '' );
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 */
535 535
 	public function reset_reg_steps() {
536 536
 		$this->sort_reg_steps();
537
-		$this->set_current_step( EE_Registry::instance()->REQ->get( 'step' ));
537
+		$this->set_current_step(EE_Registry::instance()->REQ->get('step'));
538 538
 		$this->set_next_step();
539 539
 		// the text that appears on the reg step form submit button
540 540
 		$this->current_step->set_submit_button_text();
@@ -551,9 +551,9 @@  discard block
 block discarded – undo
551 551
 	 */
552 552
 	public function get_registration_time_limit() {
553 553
 
554
-		$registration_time_limit = (float)( EE_Registry::instance()	->SSN->expiration() - time() );
554
+		$registration_time_limit = (float) (EE_Registry::instance()	->SSN->expiration() - time());
555 555
 		$time_limit_format = $registration_time_limit > 60 * MINUTE_IN_SECONDS ? 'H:i:s' : 'i:s';
556
-		$registration_time_limit = gmdate( $time_limit_format, $registration_time_limit );
556
+		$registration_time_limit = gmdate($time_limit_format, $registration_time_limit);
557 557
 		return apply_filters(
558 558
 			'FHEE__EE_Checkout__get_registration_time_limit__registration_time_limit',
559 559
 			$registration_time_limit
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		//		overpaid TXN
574 574
 		//		free TXN ( total = 0.00 )
575 575
 		// then payment required is TRUE
576
-		return ! ( $this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free() ) ? TRUE : FALSE;
576
+		return ! ($this->admin_request || $this->transaction->is_completed() || $this->transaction->is_overpaid() || $this->transaction->is_free()) ? TRUE : FALSE;
577 577
 	}
578 578
 
579 579
 
@@ -586,8 +586,8 @@  discard block
 block discarded – undo
586 586
 	 */
587 587
 	public function initialize_txn_reg_steps_array() {
588 588
 		$txn_reg_steps_array = array();
589
-		foreach ( $this->reg_steps as $reg_step ) {
590
-			$txn_reg_steps_array[ $reg_step->slug() ] = FALSE;
589
+		foreach ($this->reg_steps as $reg_step) {
590
+			$txn_reg_steps_array[$reg_step->slug()] = FALSE;
591 591
 		}
592 592
 		return $txn_reg_steps_array;
593 593
 	}
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
 	public function update_txn_reg_steps_array() {
604 604
 		$updated = FALSE;
605 605
 		/** @type EE_Transaction_Processor $transaction_processor */
606
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
607
-		foreach ( $this->reg_steps as $reg_step ) {
608
-			if ( $reg_step->completed() ) {
609
-				$updated = $transaction_processor->set_reg_step_completed( $this->transaction, $reg_step->slug() ) ? TRUE : $updated;
606
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
607
+		foreach ($this->reg_steps as $reg_step) {
608
+			if ($reg_step->completed()) {
609
+				$updated = $transaction_processor->set_reg_step_completed($this->transaction, $reg_step->slug()) ? TRUE : $updated;
610 610
 			}
611 611
 		}
612
-		if ( $updated ) {
612
+		if ($updated) {
613 613
 			$this->transaction->save();
614 614
 		}
615 615
 		return $updated;
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
 	 * 	@return 	void
625 625
 	 */
626 626
 	public function stash_transaction_and_checkout() {
627
-		if ( ! $this->revisit ) {
627
+		if ( ! $this->revisit) {
628 628
 			$this->update_txn_reg_steps_array();
629 629
 		}
630 630
 		$this->track_transaction_and_registration_status_updates();
631 631
 		// save all data to the db, but suppress errors
632 632
 		//$this->save_all_data( FALSE );
633 633
 		// cache the checkout in the session
634
-		EE_Registry::instance()->SSN->set_checkout( $this );
634
+		EE_Registry::instance()->SSN->set_checkout($this);
635 635
 	}
636 636
 
637 637
 
@@ -647,21 +647,21 @@  discard block
 block discarded – undo
647 647
 	 */
648 648
 	public function track_transaction_and_registration_status_updates() {
649 649
 		// verify the transaction
650
-		if ( $this->transaction instanceof EE_Transaction ) {
650
+		if ($this->transaction instanceof EE_Transaction) {
651 651
 			/** @type EE_Transaction_Payments $transaction_payments */
652
-			$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
652
+			$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
653 653
 			/** @type EE_Transaction_Processor $transaction_processor */
654
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
654
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
655 655
 			// has there been a TXN status change during this checkout?
656
-			if ( $transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated() ) {
656
+			if ($transaction_payments->txn_status_updated() || $transaction_processor->txn_status_updated()) {
657 657
 				$this->txn_status_updated = true;
658 658
 			}
659 659
 			/** @type EE_Registration_Processor $registration_processor */
660
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
660
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
661 661
 			// grab the saved registrations from the transaction
662
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $registration ) {
663
-				if ( $registration_processor->reg_status_updated( $registration->ID() ) ) {
664
-					$this->set_reg_status_updated( $registration->ID(), true );
662
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $registration) {
663
+				if ($registration_processor->reg_status_updated($registration->ID())) {
664
+					$this->set_reg_status_updated($registration->ID(), true);
665 665
 				}
666 666
 			}
667 667
 		}
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
 	 * @param 	EE_Registration 	$registration
684 684
 	 * 	@return 	bool
685 685
 	 */
686
-	public function visit_allows_processing_of_this_registration( EE_Registration $registration ) {
687
-		return ! $this->revisit || $this->primary_revisit || ( $this->revisit && $this->reg_url_link == $registration->reg_url_link() ) ? TRUE : FALSE;
686
+	public function visit_allows_processing_of_this_registration(EE_Registration $registration) {
687
+		return ! $this->revisit || $this->primary_revisit || ($this->revisit && $this->reg_url_link == $registration->reg_url_link()) ? TRUE : FALSE;
688 688
 	}
689 689
 
690 690
 
@@ -709,18 +709,18 @@  discard block
 block discarded – undo
709 709
 	 * @param bool $show_errors
710 710
 	 * @return bool
711 711
 	 */
712
-	public function save_all_data( $show_errors = TRUE ) {
712
+	public function save_all_data($show_errors = TRUE) {
713 713
 		// verify the transaction
714
-		if ( $this->transaction instanceof EE_Transaction ) {
714
+		if ($this->transaction instanceof EE_Transaction) {
715 715
 			// save to ensure that TXN has ID
716 716
 			$this->transaction->save();
717 717
 			// grab the saved registrations from the transaction
718
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as  $registration ) {
719
-				$this->_save_registration( $registration, $show_errors );
718
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as  $registration) {
719
+				$this->_save_registration($registration, $show_errors);
720 720
 			}
721 721
 		} else {
722
-			if ( $show_errors ) {
723
-				EE_Error::add_error( __( 'A valid Transaction was not found when attempting to save your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
722
+			if ($show_errors) {
723
+				EE_Error::add_error(__('A valid Transaction was not found when attempting to save your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
724 724
 			}
725 725
 			return FALSE;
726 726
 		}
@@ -735,32 +735,32 @@  discard block
 block discarded – undo
735 735
 	 * @param bool $show_errors
736 736
 	 * @return void
737 737
 	 */
738
-	private function _save_registration( $registration, $show_errors = TRUE  ) {
738
+	private function _save_registration($registration, $show_errors = TRUE) {
739 739
 		// verify object
740
-		if ( $registration instanceof EE_Registration ) {
740
+		if ($registration instanceof EE_Registration) {
741 741
 			// should this registration be processed during this visit ?
742
-			if ( $this->visit_allows_processing_of_this_registration( $registration ) ) {
742
+			if ($this->visit_allows_processing_of_this_registration($registration)) {
743 743
 				//set TXN ID
744
-				if ( ! $registration->transaction_ID() ) {
745
-					$registration->set_transaction_id( $this->transaction->ID() );
744
+				if ( ! $registration->transaction_ID()) {
745
+					$registration->set_transaction_id($this->transaction->ID());
746 746
 				}
747 747
 				// verify and save the attendee
748
-				$this->_save_registration_attendee( $registration, $show_errors );
748
+				$this->_save_registration_attendee($registration, $show_errors);
749 749
 				// save answers to reg form questions
750
-				$this->_save_registration_answers( $registration, $show_errors );
750
+				$this->_save_registration_answers($registration, $show_errors);
751 751
 				// save changes
752 752
 				$registration->save();
753 753
 				// update txn cache
754
-				if ( ! $this->transaction->update_cache_after_object_save( 'Registration', $registration )) {
755
-					if ( $show_errors ) {
756
-						EE_Error::add_error( __( 'The newly saved Registration object could not be cached on the Transaction.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
754
+				if ( ! $this->transaction->update_cache_after_object_save('Registration', $registration)) {
755
+					if ($show_errors) {
756
+						EE_Error::add_error(__('The newly saved Registration object could not be cached on the Transaction.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
757 757
 					}
758 758
 				}
759 759
 			}
760 760
 		} else {
761
-			if ( $show_errors ) {
761
+			if ($show_errors) {
762 762
 				EE_Error::add_error(
763
-					__( 'An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso' ),
763
+					__('An invalid Registration object was discovered when attempting to save your registration information.', 'event_espresso'),
764 764
 					__FILE__, __FUNCTION__, __LINE__
765 765
 				);
766 766
 			}
@@ -776,26 +776,26 @@  discard block
 block discarded – undo
776 776
 	 * @param bool $show_errors
777 777
 	 * @return void
778 778
 	 */
779
-	private function _save_registration_attendee( $registration, $show_errors = TRUE ) {
780
-		if ( $registration->attendee() instanceof EE_Attendee ) {
779
+	private function _save_registration_attendee($registration, $show_errors = TRUE) {
780
+		if ($registration->attendee() instanceof EE_Attendee) {
781 781
 			// save so that ATT has ID
782 782
 			$registration->attendee()->save();
783
-			if ( ! $registration->update_cache_after_object_save( 'Attendee', $registration->attendee() )) {
784
-				if ( $show_errors ) {
783
+			if ( ! $registration->update_cache_after_object_save('Attendee', $registration->attendee())) {
784
+				if ($show_errors) {
785 785
 					EE_Error::add_error(
786
-						__( 'The newly saved Attendee object could not be cached on the registration.', 'event_espresso' ),
786
+						__('The newly saved Attendee object could not be cached on the registration.', 'event_espresso'),
787 787
 						__FILE__, __FUNCTION__, __LINE__
788 788
 					);
789 789
 				}
790 790
 			}
791 791
 		} else {
792
-			if ( $show_errors ) {
792
+			if ($show_errors) {
793 793
 				ob_start();
794
-				var_dump( $registration->attendee() );
794
+				var_dump($registration->attendee());
795 795
 				EE_Error::add_error(
796 796
 					sprintf(
797 797
 						'%1$s||%1$s $attendee = %2$s',
798
-						__( 'Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso' ),
798
+						__('Either no Attendee information was found, or an invalid Attendee object was discovered when attempting to save your registration information.', 'event_espresso'),
799 799
 						ob_get_clean()
800 800
 					),
801 801
 					__FILE__, __FUNCTION__, __LINE__
@@ -813,25 +813,25 @@  discard block
 block discarded – undo
813 813
 	 * @param bool $show_errors
814 814
 	 * @return void
815 815
 	 */
816
-	private function _save_registration_answers( $registration, $show_errors = TRUE ) {
816
+	private function _save_registration_answers($registration, $show_errors = TRUE) {
817 817
 		// now save the answers
818
-		foreach ( $registration->answers() as $cache_key => $answer ) {
818
+		foreach ($registration->answers() as $cache_key => $answer) {
819 819
 			// verify object
820
-			if ( $answer instanceof EE_Answer ) {
821
-				$answer->set_registration( $registration->ID() );
820
+			if ($answer instanceof EE_Answer) {
821
+				$answer->set_registration($registration->ID());
822 822
 				$answer->save();
823
-				if ( ! $registration->update_cache_after_object_save( 'Answer', $answer, $cache_key )) {
824
-					if ( $show_errors ) {
823
+				if ( ! $registration->update_cache_after_object_save('Answer', $answer, $cache_key)) {
824
+					if ($show_errors) {
825 825
 						EE_Error::add_error(
826
-							__( 'The newly saved Answer object could not be cached on the registration.', 'event_espresso' ),
826
+							__('The newly saved Answer object could not be cached on the registration.', 'event_espresso'),
827 827
 							__FILE__, __FUNCTION__, __LINE__
828 828
 						);
829 829
 					}
830 830
 				}
831 831
 			} else {
832
-				if ( $show_errors ) {
832
+				if ($show_errors) {
833 833
 					EE_Error::add_error(
834
-						__( 'An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso' ),
834
+						__('An invalid Answer object was discovered when attempting to save your registration information.', 'event_espresso'),
835 835
 						__FILE__, __FUNCTION__, __LINE__
836 836
 					);
837 837
 				}
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 	 * @param bool $from_db
850 850
 	 * @return bool
851 851
 	 */
852
-	public function refresh_all_entities( $from_db = false ) {
852
+	public function refresh_all_entities($from_db = false) {
853 853
 		$from_db = $this->current_step->is_final_step() || $this->action == 'process_gateway_response' ? true : $from_db;
854 854
 		//$this->log(
855 855
 		//	__CLASS__, __FUNCTION__, __LINE__,
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
 	 */
871 871
 	protected function refresh_from_db() {
872 872
 		// verify the transaction
873
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
873
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
874 874
 			// pull fresh TXN data from the db
875
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db( $this->transaction->ID() );
875
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_from_db($this->transaction->ID());
876 876
 			// update EE_Checkout's cached primary_attendee object
877
-			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db( $this->transaction );
877
+			$this->primary_attendee_obj = $this->_refresh_primary_attendee_obj_from_db($this->transaction);
878 878
 			// update EE_Checkout's cached payment object
879 879
 			$payment = $this->transaction->last_payment();
880 880
 			$this->payment = $payment instanceof EE_Payment ? $payment : $this->payment;
@@ -882,15 +882,15 @@  discard block
 block discarded – undo
882 882
 			$payment_method = $this->payment instanceof EE_Payment ? $this->payment->payment_method() : null;
883 883
 			$this->payment_method = $payment_method instanceof EE_Payment_Method ? $payment_method : $this->payment_method;
884 884
 			//now refresh the cart, based on the TXN
885
-			$this->cart = EE_Cart::get_cart_from_txn( $this->transaction );
885
+			$this->cart = EE_Cart::get_cart_from_txn($this->transaction);
886 886
 			// verify and update the cart because inaccurate totals are not so much fun
887
-			if ( $this->cart instanceof EE_Cart ) {
887
+			if ($this->cart instanceof EE_Cart) {
888 888
 				$this->cart->get_grand_total()->recalculate_total_including_taxes();
889 889
 			} else {
890
-				$this->cart = EE_Registry::instance()->load_core( 'Cart' );
890
+				$this->cart = EE_Registry::instance()->load_core('Cart');
891 891
 			}
892 892
 		} else {
893
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
893
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
894 894
 			return FALSE;
895 895
 		}
896 896
 		return TRUE;
@@ -904,24 +904,24 @@  discard block
 block discarded – undo
904 904
 	 * @param   EE_Transaction $transaction
905 905
 	 * @return  EE_Attendee | null
906 906
 	 */
907
-	protected function _refresh_primary_attendee_obj_from_db( EE_Transaction $transaction ) {
907
+	protected function _refresh_primary_attendee_obj_from_db(EE_Transaction $transaction) {
908 908
 
909 909
 		$primary_attendee_obj = null;
910 910
 		// grab the saved registrations from the transaction
911
-		foreach ( $transaction->registrations( $this->reg_cache_where_params, true ) as $registration ) {
911
+		foreach ($transaction->registrations($this->reg_cache_where_params, true) as $registration) {
912 912
 			// verify object
913
-			if ( $registration instanceof EE_Registration ) {
913
+			if ($registration instanceof EE_Registration) {
914 914
 				$attendee = $registration->attendee();
915 915
 				// verify object
916
-				if ( $attendee instanceof EE_Attendee  ) {
916
+				if ($attendee instanceof EE_Attendee) {
917 917
 					// maybe cache primary_attendee_obj ?
918
-					if ( $registration->is_primary_registrant() ) {
918
+					if ($registration->is_primary_registrant()) {
919 919
 						$primary_attendee_obj = $attendee;
920 920
 					}
921 921
 				}
922 922
 			} else {
923 923
 				EE_Error::add_error(
924
-						__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
924
+						__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
925 925
 						__FILE__, __FUNCTION__, __LINE__
926 926
 				);
927 927
 			}
@@ -941,43 +941,43 @@  discard block
 block discarded – undo
941 941
 	 */
942 942
 	protected function refresh_entity_map() {
943 943
 		// verify the transaction
944
-		if ( $this->transaction instanceof EE_Transaction && $this->transaction->ID() ) {
944
+		if ($this->transaction instanceof EE_Transaction && $this->transaction->ID()) {
945 945
 			// never cache payment info
946
-			$this->transaction->clear_cache( 'Payment' );
946
+			$this->transaction->clear_cache('Payment');
947 947
 			/** @type EE_Transaction_Processor $transaction_processor */
948
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
948
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
949 949
 			// is the Payment Options Reg Step completed ?
950
-			if ( $transaction_processor->reg_step_completed( $this->transaction, 'payment_options' ) ) {
950
+			if ($transaction_processor->reg_step_completed($this->transaction, 'payment_options')) {
951 951
 				// then check for payments and update TXN accordingly
952 952
 				/** @type EE_Transaction_Payments $transaction_payments */
953
-				$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
954
-				$transaction_payments->calculate_total_payments_and_update_status( $this->transaction );
953
+				$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
954
+				$transaction_payments->calculate_total_payments_and_update_status($this->transaction);
955 955
 			}
956 956
 			// grab the saved registrations from the transaction
957
-			foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $reg_cache_ID => $registration ) {
958
-				$this->_refresh_registration( $reg_cache_ID, $registration );
957
+			foreach ($this->transaction->registrations($this->reg_cache_where_params) as $reg_cache_ID => $registration) {
958
+				$this->_refresh_registration($reg_cache_ID, $registration);
959 959
 			}
960 960
 			// make sure our cached TXN is added to the model entity mapper
961
-			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with( $this->transaction->ID(), $this->transaction );
961
+			$this->transaction = $this->transaction->get_model()->refresh_entity_map_with($this->transaction->ID(), $this->transaction);
962 962
 
963 963
 		} else {
964
-			EE_Error::add_error( __( 'A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
964
+			EE_Error::add_error(__('A valid Transaction was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
965 965
 			return FALSE;
966 966
 		}
967 967
 		// verify and update the cart because inaccurate totals are not so much fun
968
-		if ( $this->cart instanceof EE_Cart ) {
968
+		if ($this->cart instanceof EE_Cart) {
969 969
 			$grand_total = $this->cart->get_grand_total();
970
-			if ( $grand_total instanceof EE_Line_Item && $grand_total->ID() ) {
970
+			if ($grand_total instanceof EE_Line_Item && $grand_total->ID()) {
971 971
 				$grand_total->recalculate_total_including_taxes();
972 972
 				$grand_total = $grand_total->get_model()->refresh_entity_map_with(
973 973
 					$this->cart->get_grand_total()->ID(),
974 974
 					$this->cart->get_grand_total()
975 975
 				);
976 976
 			}
977
-			if ( $grand_total instanceof EE_Line_Item ) {
978
-				$this->cart = EE_Cart::instance( $grand_total );
977
+			if ($grand_total instanceof EE_Line_Item) {
978
+				$this->cart = EE_Cart::instance($grand_total);
979 979
 			} else {
980
-				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
980
+				EE_Error::add_error(__('A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
981 981
 				return false;
982 982
 			}
983 983
 		}
@@ -993,19 +993,19 @@  discard block
 block discarded – undo
993 993
 	 * @param 	EE_Registration 	$registration
994 994
 	 * @return void
995 995
 	 */
996
-	protected function _refresh_registration( $reg_cache_ID, $registration ) {
996
+	protected function _refresh_registration($reg_cache_ID, $registration) {
997 997
 
998 998
 		// verify object
999
-		if ( $registration instanceof EE_Registration ) {
999
+		if ($registration instanceof EE_Registration) {
1000 1000
 			// update the entity mapper attendee
1001
-			$this->_refresh_registration_attendee( $registration );
1001
+			$this->_refresh_registration_attendee($registration);
1002 1002
 			// update the entity mapper answers for reg form questions
1003
-			$this->_refresh_registration_answers( $registration );
1003
+			$this->_refresh_registration_answers($registration);
1004 1004
 			// make sure the cached registration is added to the model entity mapper
1005
-			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1005
+			$registration->get_model()->refresh_entity_map_with($reg_cache_ID, $registration);
1006 1006
 		} else {
1007 1007
 			EE_Error::add_error(
1008
-				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1008
+				__('An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1009 1009
 				__FILE__, __FUNCTION__, __LINE__
1010 1010
 			);
1011 1011
 		}
@@ -1019,15 +1019,15 @@  discard block
 block discarded – undo
1019 1019
 	 * @param 	EE_Registration 	$registration
1020 1020
 	 * @return void
1021 1021
 	 */
1022
-	protected function _refresh_registration_attendee( $registration ) {
1022
+	protected function _refresh_registration_attendee($registration) {
1023 1023
 
1024 1024
 		$attendee = $registration->attendee();
1025 1025
 		// verify object
1026
-		if ( $attendee instanceof EE_Attendee && $attendee->ID() ) {
1026
+		if ($attendee instanceof EE_Attendee && $attendee->ID()) {
1027 1027
 			// make sure the cached attendee is added to the model entity mapper
1028
-			$registration->attendee()->get_model()->refresh_entity_map_with( $attendee->ID(), $attendee );
1028
+			$registration->attendee()->get_model()->refresh_entity_map_with($attendee->ID(), $attendee);
1029 1029
 			// maybe cache primary_attendee_obj ?
1030
-			if ( $registration->is_primary_registrant() ) {
1030
+			if ($registration->is_primary_registrant()) {
1031 1031
 				$this->primary_attendee_obj = $attendee;
1032 1032
 			}
1033 1033
 		}
@@ -1041,19 +1041,19 @@  discard block
 block discarded – undo
1041 1041
 	 * @param 	EE_Registration 	$registration
1042 1042
 	 * @return void
1043 1043
 	 */
1044
-	protected function _refresh_registration_answers( $registration ) {
1044
+	protected function _refresh_registration_answers($registration) {
1045 1045
 
1046 1046
 		// now update the answers
1047
-		foreach ( $registration->answers() as $cache_key => $answer ) {
1047
+		foreach ($registration->answers() as $cache_key => $answer) {
1048 1048
 			// verify object
1049
-			if ( $answer instanceof EE_Answer ) {
1050
-				if ( $answer->ID() ) {
1049
+			if ($answer instanceof EE_Answer) {
1050
+				if ($answer->ID()) {
1051 1051
 					// make sure the cached answer is added to the model entity mapper
1052
-					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1052
+					$answer->get_model()->refresh_entity_map_with($answer->ID(), $answer);
1053 1053
 				}
1054 1054
 			} else {
1055 1055
 				EE_Error::add_error(
1056
-					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1056
+					__('An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso'),
1057 1057
 					__FILE__, __FUNCTION__, __LINE__
1058 1058
 				);
1059 1059
 			}
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 	 * this will reinstate the EE_Checkout object on each EE_SPCO_Reg_Step object
1069 1069
 	 */
1070 1070
 	function __wakeup() {
1071
-		foreach ( $this->reg_steps as $reg_step ) {
1071
+		foreach ($this->reg_steps as $reg_step) {
1072 1072
 			$reg_step->checkout = $this;
1073 1073
 		}
1074 1074
 	}
@@ -1084,11 +1084,11 @@  discard block
 block discarded – undo
1084 1084
 	 * @param array $info
1085 1085
 	 * @param bool $display_request
1086 1086
 	 */
1087
-	function log( $class = '', $func = '', $line = '', $info = array(), $display_request = false ) {
1088
-		if ( WP_DEBUG && false ) {
1089
-			$debug_data = get_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), array() );
1087
+	function log($class = '', $func = '', $line = '', $info = array(), $display_request = false) {
1088
+		if (WP_DEBUG && false) {
1089
+			$debug_data = get_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), array());
1090 1090
 			$default_data = array(
1091
-				$class 		=> $func . '() : ' . $line,
1091
+				$class 		=> $func.'() : '.$line,
1092 1092
 				'request->step' 		=> $this->step,
1093 1093
 				'request->action' 	=> $this->action,
1094 1094
 				'current_step->slug' => $this->current_step instanceof EE_SPCO_Reg_Step ?
@@ -1100,24 +1100,24 @@  discard block
 block discarded – undo
1100 1100
 				'reg_url_link' => $this->reg_url_link,
1101 1101
 				'REQ' => $display_request ? $_REQUEST : '',
1102 1102
 			);
1103
-			if ( $this->transaction instanceof EE_Transaction ) {
1104
-				$default_data[ 'TXN_status' ] 		= $this->transaction->status_ID();
1105
-				$default_data[ 'TXN_reg_steps' ] 	= $this->transaction->reg_steps();
1106
-				foreach ( $this->transaction->registrations( $this->reg_cache_where_params ) as $REG_ID => $registration ) {
1107
-					$default_data[ 'registrations' ][ $REG_ID ] = $registration->status_ID();
1103
+			if ($this->transaction instanceof EE_Transaction) {
1104
+				$default_data['TXN_status'] = $this->transaction->status_ID();
1105
+				$default_data['TXN_reg_steps'] = $this->transaction->reg_steps();
1106
+				foreach ($this->transaction->registrations($this->reg_cache_where_params) as $REG_ID => $registration) {
1107
+					$default_data['registrations'][$REG_ID] = $registration->status_ID();
1108 1108
 				}
1109
-				if ( $this->transaction->ID() ) {
1110
-					$TXN_ID = 'EE_Transaction: ' . $this->transaction->ID();
1109
+				if ($this->transaction->ID()) {
1110
+					$TXN_ID = 'EE_Transaction: '.$this->transaction->ID();
1111 1111
 					// don't serialize objects
1112
-					$info = $this->_strip_objects( $info );
1113
-					if ( ! isset( $debug_data[ $TXN_ID ] ) ) {
1114
-						$debug_data[ $TXN_ID ] = array();
1112
+					$info = $this->_strip_objects($info);
1113
+					if ( ! isset($debug_data[$TXN_ID])) {
1114
+						$debug_data[$TXN_ID] = array();
1115 1115
 					}
1116
-					$debug_data[ $TXN_ID ][ microtime() ] = array_merge(
1116
+					$debug_data[$TXN_ID][microtime()] = array_merge(
1117 1117
 						$default_data,
1118 1118
 						$info
1119 1119
 					);
1120
-					update_option( 'EE_DEBUG_SPCO_' . EE_Session::instance()->id(), $debug_data );
1120
+					update_option('EE_DEBUG_SPCO_'.EE_Session::instance()->id(), $debug_data);
1121 1121
 				}
1122 1122
 			}
1123 1123
 		}
@@ -1130,23 +1130,23 @@  discard block
 block discarded – undo
1130 1130
 	 * @param array $info
1131 1131
 	 * @return array
1132 1132
 	 */
1133
-	function _strip_objects( $info = array() ) {
1134
-		foreach ( $info as $key => $value ) {
1135
-			if ( is_array( $value )) {
1136
-				$info[ $key ] = $this->_strip_objects( $value );
1137
-			} else if ( is_object( $value ) ) {
1138
-				$object_class = get_class( $value );
1139
-				$info[ $object_class ] = array();
1140
-				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1141
-				if ( method_exists( $value, 'status' ) ) {
1142
-					$info[ $object_class ][ 'status' ] = $value->status();
1143
-				} else if ( method_exists( $value, 'status_ID' ) ) {
1144
-					$info[ $object_class ][ 'status' ] = $value->status_ID();
1133
+	function _strip_objects($info = array()) {
1134
+		foreach ($info as $key => $value) {
1135
+			if (is_array($value)) {
1136
+				$info[$key] = $this->_strip_objects($value);
1137
+			} else if (is_object($value)) {
1138
+				$object_class = get_class($value);
1139
+				$info[$object_class] = array();
1140
+				$info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : 0;
1141
+				if (method_exists($value, 'status')) {
1142
+					$info[$object_class]['status'] = $value->status();
1143
+				} else if (method_exists($value, 'status_ID')) {
1144
+					$info[$object_class]['status'] = $value->status_ID();
1145 1145
 				}
1146
-				unset( $info[ $key ] );
1146
+				unset($info[$key]);
1147 1147
 			}
1148 1148
 		}
1149
-		return (array)$info;
1149
+		return (array) $info;
1150 1150
 	}
1151 1151
 
1152 1152
 
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -387,7 +387,7 @@
 block discarded – undo
387 387
 
388 388
 	/**
389 389
 	 * creates the default hidden inputs section
390
-	 * @return EE_Form_Input_Base[]
390
+	 * @return EE_Form_Section_Proper
391 391
 	 */
392 392
 	public function reg_step_hidden_inputs() {
393 393
 		// hidden inputs for admin registrations
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Reg_Step
5
- *
6
- * Description
7
- *
8
- * @package 			Event Espresso
9
- * @subpackage 	core
10
- * @author 				Brent Christensen
11
- * @since 				4.5.0
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_Reg_Step
5
+  *
6
+  * Description
7
+  *
8
+  * @package 			Event Espresso
9
+  * @subpackage 	core
10
+  * @author 				Brent Christensen
11
+  * @since 				4.5.0
12
+  *
13
+  */
14 14
 abstract class EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	public function set_completed() {
154 154
 		// DEBUG LOG
155 155
 		//$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ );
156
-		$this->_completed = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_completed___completed', true, $this );
156
+		$this->_completed = apply_filters('FHEE__EE_SPCO_Reg_Step__set_completed___completed', true, $this);
157 157
 	}
158 158
 
159 159
 
@@ -201,18 +201,18 @@  discard block
 block discarded – undo
201 201
 	 * sets the text that appears on the reg step form submit button
202 202
 	 * @param string $submit_button_text
203 203
 	 */
204
-	public function set_submit_button_text( $submit_button_text = '' ) {
205
-		if ( ! empty( $submit_button_text )) {
204
+	public function set_submit_button_text($submit_button_text = '') {
205
+		if ( ! empty($submit_button_text)) {
206 206
 			$this->_submit_button_text = $submit_button_text;
207
-		} else if ( $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
208
-			if ( $this->checkout->revisit ) {
209
-				$this->_submit_button_text = sprintf( __( 'Update %s', 'event_espresso' ), $this->checkout->current_step->name() );
207
+		} else if ($this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
208
+			if ($this->checkout->revisit) {
209
+				$this->_submit_button_text = sprintf(__('Update %s', 'event_espresso'), $this->checkout->current_step->name());
210 210
 			} else {
211
-				$this->_submit_button_text = sprintf( __( 'Proceed to %s', 'event_espresso' ), $this->checkout->next_step->name() );
211
+				$this->_submit_button_text = sprintf(__('Proceed to %s', 'event_espresso'), $this->checkout->next_step->name());
212 212
 			}
213 213
 		}
214 214
 		// filters the submit button text
215
-		$this->_submit_button_text = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', $this->_submit_button_text, $this->checkout );
215
+		$this->_submit_button_text = apply_filters('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', $this->_submit_button_text, $this->checkout);
216 216
 	}
217 217
 
218 218
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	/**
221 221
 	 * @param boolean $is_current_step
222 222
 	 */
223
-	public function set_is_current_step( $is_current_step ) {
223
+	public function set_is_current_step($is_current_step) {
224 224
 		$this->_is_current_step = $is_current_step;
225 225
 	}
226 226
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	/**
248 248
 	 * @param int $order
249 249
 	 */
250
-	public function set_order( $order ) {
250
+	public function set_order($order) {
251 251
 		$this->_order = $order;
252 252
 	}
253 253
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * _set_success_message
286 286
 	 * @param string $success_message
287 287
 	 */
288
-	protected function _set_success_message( $success_message ) {
288
+	protected function _set_success_message($success_message) {
289 289
 		$this->_success_message = $success_message;
290 290
 	}
291 291
 
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 	/**
314 314
 	 * @param string $instructions
315 315
 	 */
316
-	public function set_instructions( $instructions ) {
317
-		$this->_instructions = apply_filters( 'FHEE__EE_SPCO_Reg_Step__set_instructions__instructions', $instructions, $this );
316
+	public function set_instructions($instructions) {
317
+		$this->_instructions = apply_filters('FHEE__EE_SPCO_Reg_Step__set_instructions__instructions', $instructions, $this);
318 318
 	}
319 319
 
320 320
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	/**
323 323
 	 * @param array $valid_data
324 324
 	 */
325
-	public function set_valid_data( $valid_data ) {
325
+	public function set_valid_data($valid_data) {
326 326
 		$this->_valid_data = $valid_data;
327 327
 	}
328 328
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 	 * @return array
333 333
 	 */
334 334
 	public function valid_data() {
335
-		if ( empty( $this->_valid_data )) {
335
+		if (empty($this->_valid_data)) {
336 336
 			$this->_valid_data = $this->reg_form->valid_data();
337 337
 		}
338 338
 		return $this->_valid_data;
@@ -343,8 +343,8 @@  discard block
 block discarded – undo
343 343
 	 * @return string
344 344
 	 */
345 345
 	public function reg_form_name() {
346
-		if ( empty( $this->_reg_form_name )) {
347
-			$this->set_reg_form_name( 'ee-spco-' . $this->slug() . '-reg-step-form' );
346
+		if (empty($this->_reg_form_name)) {
347
+			$this->set_reg_form_name('ee-spco-'.$this->slug().'-reg-step-form');
348 348
 		}
349 349
 		return $this->_reg_form_name;
350 350
 	}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	/**
355 355
 	 * @param string $reg_form_name
356 356
 	 */
357
-	protected function set_reg_form_name( $reg_form_name ) {
357
+	protected function set_reg_form_name($reg_form_name) {
358 358
 		$this->_reg_form_name = $reg_form_name;
359 359
 	}
360 360
 
@@ -365,22 +365,22 @@  discard block
 block discarded – undo
365 365
 	 * @param string $action
366 366
 	 * @return string
367 367
 	 */
368
-	public function reg_step_url( $action = '' ) {
369
-		$query_args = array( 'step' => $this->slug() );
370
-		if( ! empty( $action )) {
368
+	public function reg_step_url($action = '') {
369
+		$query_args = array('step' => $this->slug());
370
+		if ( ! empty($action)) {
371 371
 			$query_args['action'] = $action;
372 372
 		}
373 373
 		// final step has no display
374
-		if ( $this instanceof EE_SPCO_Reg_Step_Finalize_Registration && $action == 'display_spco_reg_step' ) {
375
-			$query_args[ 'action' ] = 'process_reg_step';
374
+		if ($this instanceof EE_SPCO_Reg_Step_Finalize_Registration && $action == 'display_spco_reg_step') {
375
+			$query_args['action'] = 'process_reg_step';
376 376
 		}
377
-		if( $this->checkout->revisit ) {
377
+		if ($this->checkout->revisit) {
378 378
 			$query_args['revisit'] = TRUE;
379 379
 		}
380
-		if( $this->checkout->reg_url_link ) {
380
+		if ($this->checkout->reg_url_link) {
381 381
 			$query_args['e_reg_url_link'] = $this->checkout->reg_url_link;
382 382
 		}
383
-		return add_query_arg( $query_args, $this->checkout->reg_page_base_url );
383
+		return add_query_arg($query_args, $this->checkout->reg_page_base_url);
384 384
 	}
385 385
 
386 386
 
@@ -391,16 +391,16 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function reg_step_hidden_inputs() {
393 393
 		// hidden inputs for admin registrations
394
-		if ( $this->checkout->admin_request ) {
394
+		if ($this->checkout->admin_request) {
395 395
 			return new EE_Form_Section_Proper(
396 396
 				array(
397 397
 					'layout_strategy' 	=> new EE_Div_Per_Section_Layout(),
398
-					'html_id' 					=> 'ee-' . $this->slug() . '-hidden-inputs',
398
+					'html_id' 					=> 'ee-'.$this->slug().'-hidden-inputs',
399 399
 					'subsections' 			=> array(
400 400
 						'next_step' 			=> new EE_Fixed_Hidden_Input(
401 401
 							array(
402 402
 								'html_name' 	=> 'next_step',
403
-								'html_id' 			=> 'spco-' . $this->slug() . '-next-step',
403
+								'html_id' 			=> 'spco-'.$this->slug().'-next-step',
404 404
 								'default' 			=> $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : ''
405 405
 							)
406 406
 						)
@@ -412,19 +412,19 @@  discard block
 block discarded – undo
412 412
 			return new EE_Form_Section_Proper(
413 413
 				array(
414 414
 					'layout_strategy' 	=> new EE_Div_Per_Section_Layout(),
415
-					'html_id' 					=> 'ee-' . $this->slug() . '-hidden-inputs',
415
+					'html_id' 					=> 'ee-'.$this->slug().'-hidden-inputs',
416 416
 					'subsections' 			=> array(
417 417
 						'action' 				=> new EE_Fixed_Hidden_Input(
418 418
 								array(
419 419
 									'html_name' 	=> 'action',
420
-									'html_id' 			=> 'spco-' . $this->slug() . '-action',
421
-									'default' 			=> empty( $this->checkout->reg_url_link ) ? 'process_reg_step' : 'update_reg_step'
420
+									'html_id' 			=> 'spco-'.$this->slug().'-action',
421
+									'default' 			=> empty($this->checkout->reg_url_link) ? 'process_reg_step' : 'update_reg_step'
422 422
 								)
423 423
 							),
424 424
 						'next_step' 			=> new EE_Fixed_Hidden_Input(
425 425
 								array(
426 426
 									'html_name' 	=> 'next_step',
427
-									'html_id' 			=> 'spco-' . $this->slug() . '-next-step',
427
+									'html_id' 			=> 'spco-'.$this->slug().'-next-step',
428 428
 									'default' 			=> $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : ''
429 429
 								)
430 430
 							),
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
 	 * @param array $actions
457 457
 	 * @return void
458 458
 	 */
459
-	public function generate_reg_form_for_actions( $actions = array() ) {
460
-		$actions = array_merge( array( 'generate_reg_form', 'display_spco_reg_step', 'process_reg_step', 'update_reg_step' ), $actions );
461
-		$this->checkout->generate_reg_form = in_array( $this->checkout->action, $actions ) ? TRUE : FALSE;
459
+	public function generate_reg_form_for_actions($actions = array()) {
460
+		$actions = array_merge(array('generate_reg_form', 'display_spco_reg_step', 'process_reg_step', 'update_reg_step'), $actions);
461
+		$this->checkout->generate_reg_form = in_array($this->checkout->action, $actions) ? TRUE : FALSE;
462 462
 	}
463 463
 
464 464
 
@@ -468,11 +468,11 @@  discard block
 block discarded – undo
468 468
 	 */
469 469
 	public function display_reg_form() {
470 470
 		$html = '';
471
-		if ( $this->reg_form instanceof EE_Form_Section_Proper ) {
472
-			$html .= ! $this->checkout->admin_request ? $this->reg_form->form_open( $this->reg_step_url() ) : '';
473
-			if ( EE_Registry::instance()->REQ->ajax ) {
471
+		if ($this->reg_form instanceof EE_Form_Section_Proper) {
472
+			$html .= ! $this->checkout->admin_request ? $this->reg_form->form_open($this->reg_step_url()) : '';
473
+			if (EE_Registry::instance()->REQ->ajax) {
474 474
 				$this->reg_form->localize_validation_rules();
475
-				$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
475
+				$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
476 476
 				$html .= $this->reg_form->get_html();
477 477
 			} else {
478 478
 				$html .= $this->reg_form->get_html_and_js();
@@ -490,26 +490,26 @@  discard block
 block discarded – undo
490 490
 	 * @return string
491 491
 	 */
492 492
 	public function reg_step_submit_button() {
493
-		if ( ! $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) {
493
+		if ( ! $this->checkout->next_step instanceof EE_SPCO_Reg_Step) {
494 494
 			return '';
495 495
 		}
496 496
 		ob_start();
497
-		do_action( 'AHEE__before_spco_whats_next_buttons', $this->slug(), $this->checkout->next_step->slug(), $this->checkout );
497
+		do_action('AHEE__before_spco_whats_next_buttons', $this->slug(), $this->checkout->next_step->slug(), $this->checkout);
498 498
 		$html = ob_get_clean();
499 499
 		// generate submit button
500
-		$sbmt_btn = new EE_Submit_Input( array(
501
-			'html_name' 					=> 'spco-go-to-step-' . $this->checkout->next_step->slug(),
502
-			'html_id' 							=> 'spco-go-to-step-' . $this->checkout->next_step->slug(),
500
+		$sbmt_btn = new EE_Submit_Input(array(
501
+			'html_name' 					=> 'spco-go-to-step-'.$this->checkout->next_step->slug(),
502
+			'html_id' 							=> 'spco-go-to-step-'.$this->checkout->next_step->slug(),
503 503
 			'html_class' 					=> 'spco-next-step-btn',
504
-			'other_html_attributes' 	=> ' rel="' . $this->slug() . '"',
504
+			'other_html_attributes' 	=> ' rel="'.$this->slug().'"',
505 505
 			'default'							=> $this->submit_button_text()
506 506
 		));
507
-		$sbmt_btn->set_button_css_attributes( TRUE, 'large' );
507
+		$sbmt_btn->set_button_css_attributes(TRUE, 'large');
508 508
 		$sbmt_btn_html = $sbmt_btn->get_html_for_input();
509 509
 		EE_Registry::instance()->load_helper('HTML');
510 510
 		$html .= EEH_HTML::div(
511
-			apply_filters( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', $sbmt_btn_html, $this ),
512
-			'spco-' . $this->slug() . '-whats-next-buttons-dv',
511
+			apply_filters('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', $sbmt_btn_html, $this),
512
+			'spco-'.$this->slug().'-whats-next-buttons-dv',
513 513
 			'spco-whats-next-buttons'
514 514
 		);
515 515
 		return $html;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 	 * @return string
533 533
 	 */
534 534
 	public function edit_lnk_url() {
535
-		return 	add_query_arg( array( 'step' => $this->slug() ), $this->checkout->reg_page_base_url );
535
+		return 	add_query_arg(array('step' => $this->slug()), $this->checkout->reg_page_base_url);
536 536
 
537 537
 	}
538 538
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 	 */
555 555
 	public function update_checkout() {
556 556
 		// grab the cart grand total and reset TXN total
557
-		$this->checkout->transaction->set_total( $this->checkout->cart->get_cart_grand_total() );
557
+		$this->checkout->transaction->set_total($this->checkout->cart->get_cart_grand_total());
558 558
 		$this->checkout->stash_transaction_and_checkout();
559 559
 	}
560 560
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 	 */
570 570
 	function __sleep() {
571 571
 		// remove the reg form and the checkout
572
-		return array_diff( array_keys( get_object_vars( $this )), array( 'reg_form', 'checkout' ));
572
+		return array_diff(array_keys(get_object_vars($this)), array('reg_form', 'checkout'));
573 573
 	}
574 574
 }
575 575
 
Please login to merge, or discard this patch.
attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 4 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
 	/**
65
-	 * @return boolean
65
+	 * @return boolean|null
66 66
 	 */
67 67
 	public function initialize_reg_step() {
68 68
 	}
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	 * _auto_copy_attendee_info
343 343
 	 *
344 344
 	 * @access public
345
-	 * @return 	EE_Form_Section_Proper
345
+	 * @return 	EE_Form_Section_HTML
346 346
 	 */
347 347
 	private function _auto_copy_attendee_info() {
348 348
 		return new EE_Form_Section_HTML(
@@ -456,6 +456,7 @@  discard block
 block discarded – undo
456 456
 	 * @param EE_Registration $registration
457 457
 	 * @param EE_Question     $question
458 458
 	 * @param mixed EE_Answer|NULL      $answer
459
+	 * @param EE_Answer $answer
459 460
 	 * @return EE_Form_Input_Base
460 461
 	 */
461 462
 	private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 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
 	/**
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 			case EEM_Question::QST_type_text :
508 508
 				if( $identifier == 'email' ){
509 509
 					return new EE_Email_Input( $input_constructor_args );
510
-				}else{
510
+				} else{
511 511
 					return new EE_Text_Input( $input_constructor_args );
512 512
 				}
513 513
 				break;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
 				} // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) {
794 794
 
795
-			}  else {
795
+			} else {
796 796
 				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__ );
797 797
 				// remove malformed data
798 798
 				unset( $valid_data[ $reg_url_link ] );
Please login to merge, or discard this patch.
Spacing   +258 added lines, -259 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	 * @param    EE_Checkout $checkout
38 38
 	 * @return    \EE_SPCO_Reg_Step_Attendee_Information
39 39
 	 */
40
-	public function __construct( EE_Checkout $checkout ) {
40
+	public function __construct(EE_Checkout $checkout) {
41 41
 		$this->_slug = 'attendee_information';
42 42
 		$this->_name = __('Attendee Information', 'event_espresso');
43
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_main.template.php';
43
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_main.template.php';
44 44
 		$this->checkout = $checkout;
45 45
 		$this->_reset_success_message();
46
-		$this->set_instructions( __('Please answer the following registration questions before proceeding.', 'event_espresso'));
46
+		$this->set_instructions(__('Please answer the following registration questions before proceeding.', 'event_espresso'));
47 47
 	}
48 48
 
49 49
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		EE_Registry::$i18n_js_strings['required_field'] = __(' is a required question.', 'event_espresso');
53 53
 		EE_Registry::$i18n_js_strings['required_multi_field'] = __(' is a required question. Please enter a value for at least one of the options.', 'event_espresso');
54 54
 		EE_Registry::$i18n_js_strings['answer_required_questions'] = __('Please answer all required questions correctly before proceeding.', 'event_espresso');
55
-		EE_Registry::$i18n_js_strings['attendee_info_copied'] = sprintf( __('The attendee information was successfully copied.%sPlease ensure the rest of the registration form is completed before proceeding.', 'event_espresso'), '<br/>' );
55
+		EE_Registry::$i18n_js_strings['attendee_info_copied'] = sprintf(__('The attendee information was successfully copied.%sPlease ensure the rest of the registration form is completed before proceeding.', 'event_espresso'), '<br/>');
56 56
 		EE_Registry::$i18n_js_strings['attendee_info_copy_error'] = __('An unknown error occurred on the server while attempting to copy the attendee information. Please refresh the page and try again.', 'event_espresso');
57 57
 		EE_Registry::$i18n_js_strings['enter_valid_email'] = __('You must enter a valid email address.', 'event_espresso');
58 58
 		EE_Registry::$i18n_js_strings['valid_email_and_questions'] = __('You must enter a valid email address and answer all other required questions before you can proceed.', 'event_espresso');
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		EEH_Autoloader::register_line_item_display_autoloaders();
85 85
 		$Line_Item_Display = new EE_Line_Item_Display();
86 86
 		// calculate taxes
87
-		$Line_Item_Display->display_line_item( $this->checkout->cart->get_grand_total(), array( 'set_tax_rate' => true ) );
87
+		$Line_Item_Display->display_line_item($this->checkout->cart->get_grand_total(), array('set_tax_rate' => true));
88 88
 		EE_Registry::instance()->load_helper('Line_Item');
89 89
 		/** @var $subsections EE_Form_Section_Proper[] */
90 90
 		$subsections = array(
@@ -96,33 +96,33 @@  discard block
 block discarded – undo
96 96
 			'ticket_count' 	=> array()
97 97
 		);
98 98
 		// grab the saved registrations from the transaction
99
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
100
-		if ( $registrations ) {
101
-			foreach ( $registrations as $registration ) {
102
-				if ( $registration instanceof EE_Registration ) {
99
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
100
+		if ($registrations) {
101
+			foreach ($registrations as $registration) {
102
+				if ($registration instanceof EE_Registration) {
103 103
 					// can this registration be processed during this visit ?
104
-					if ( $this->checkout->visit_allows_processing_of_this_registration( $registration ) ) {
105
-						$subsections[ $registration->reg_url_link() ] = $this->_registrations_reg_form( $registration );
106
-						if ( ! $this->checkout->admin_request ) {
107
-							$template_args['registrations'][ $registration->reg_url_link() ] = $registration;
108
-							$template_args['ticket_count'][ $registration->ticket()->ID() ] = isset( $template_args['ticket_count'][ $registration->ticket()->ID() ] ) ? $template_args['ticket_count'][ $registration->ticket()->ID() ] + 1 : 1;
109
-							$ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs( $this->checkout->cart->get_grand_total(), 'Ticket', array( $registration->ticket()->ID() ) );
110
-							$ticket_line_item = is_array( $ticket_line_item ) ? reset( $ticket_line_item ) : $ticket_line_item;
111
-							$template_args['ticket_line_item'][ $registration->ticket()->ID() ] = $Line_Item_Display->display_line_item( $ticket_line_item );
104
+					if ($this->checkout->visit_allows_processing_of_this_registration($registration)) {
105
+						$subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration);
106
+						if ( ! $this->checkout->admin_request) {
107
+							$template_args['registrations'][$registration->reg_url_link()] = $registration;
108
+							$template_args['ticket_count'][$registration->ticket()->ID()] = isset($template_args['ticket_count'][$registration->ticket()->ID()]) ? $template_args['ticket_count'][$registration->ticket()->ID()] + 1 : 1;
109
+							$ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs($this->checkout->cart->get_grand_total(), 'Ticket', array($registration->ticket()->ID()));
110
+							$ticket_line_item = is_array($ticket_line_item) ? reset($ticket_line_item) : $ticket_line_item;
111
+							$template_args['ticket_line_item'][$registration->ticket()->ID()] = $Line_Item_Display->display_line_item($ticket_line_item);
112 112
 						}
113
-						if ( $registration->is_primary_registrant() ) {
113
+						if ($registration->is_primary_registrant()) {
114 114
 							$primary_registrant = $registration->reg_url_link();
115 115
 						}
116 116
 					}
117 117
 				}
118 118
 			}
119 119
 			// print_copy_info ?
120
-			if ( $primary_registrant && count( $registrations ) > 1 && ! $this->checkout->admin_request ) {
120
+			if ($primary_registrant && count($registrations) > 1 && ! $this->checkout->admin_request) {
121 121
 				// TODO: add admin option for toggling copy attendee info, then use that value to change $this->_print_copy_info
122 122
 				$copy_options['spco_copy_attendee_chk'] = $this->_print_copy_info ? $this->_copy_attendee_info_form() : $this->_auto_copy_attendee_info();
123 123
 				// generate hidden input
124
-				if ( isset( $subsections[ $primary_registrant ] ) && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper ) {
125
-					$subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false );
124
+				if (isset($subsections[$primary_registrant]) && $subsections[$primary_registrant] instanceof EE_Form_Section_Proper) {
125
+					$subsections[$primary_registrant]->add_subsections($copy_options, 'primary_registrant', false);
126 126
 				}
127 127
 			}
128 128
 
@@ -134,8 +134,7 @@  discard block
 block discarded – undo
134 134
 				'html_id' 					=> $this->reg_form_name(),
135 135
 				'subsections' 			=> $subsections,
136 136
 				'layout_strategy'		=> $this->checkout->admin_request ?
137
-					new EE_Div_Per_Section_Layout() :
138
-					new EE_Template_Layout(
137
+					new EE_Div_Per_Section_Layout() : new EE_Template_Layout(
139 138
 						array(
140 139
 							'layout_template_file' 	=> $this->_template, // layout_template
141 140
 							'template_args' 				=> $template_args
@@ -152,61 +151,61 @@  discard block
 block discarded – undo
152 151
 	 * @param EE_Registration $registration
153 152
 	 * @return EE_Form_Section_Proper
154 153
 	 */
155
-	private function _registrations_reg_form( EE_Registration $registration ) {
156
-		EE_Registry::instance()->load_helper( 'Template' );
154
+	private function _registrations_reg_form(EE_Registration $registration) {
155
+		EE_Registry::instance()->load_helper('Template');
157 156
 		static $attendee_nmbr = 1;
158 157
 		// array of params to pass to parent constructor
159 158
 		$form_args = array(
160
-			'html_id' 				=> 'ee-registration-' . $registration->reg_url_link(),
159
+			'html_id' 				=> 'ee-registration-'.$registration->reg_url_link(),
161 160
 			'html_class' 		=> 'ee-reg-form-attendee-dv',
162 161
 			'html_style' 		=> $this->checkout->admin_request ? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;' : '',
163 162
 			'subsections' 		=> array(),
164 163
 			'layout_strategy' => new EE_Fieldset_Section_Layout(
165 164
 				array(
166 165
 					'legend_class' 	=> 'spco-attendee-lgnd smaller-text lt-grey-text',
167
-					'legend_text' 	=> sprintf( __( 'Attendee %d', 'event_espresso' ), $attendee_nmbr )
166
+					'legend_text' 	=> sprintf(__('Attendee %d', 'event_espresso'), $attendee_nmbr)
168 167
 				)
169 168
 			)
170 169
 		);
171 170
 		// verify that registration has valid event
172
-		if ( $registration->event() instanceof EE_Event ) {
171
+		if ($registration->event() instanceof EE_Event) {
173 172
 			$query_params = array(
174 173
 				array(
175 174
 					'Event.EVT_ID' => $registration->event()->ID(),
176 175
 					'Event_Question_Group.EQG_primary' => $registration->count() == 1 ? TRUE : FALSE
177 176
 				),
178
-				'order_by'=>array( 'QSG_order'=>'ASC' )
177
+				'order_by'=>array('QSG_order'=>'ASC')
179 178
 			);
180
-			$question_groups = $registration->event()->question_groups( $query_params );
181
-			if ( $question_groups ) {
182
-				foreach ( $question_groups as $question_group ) {
183
-					if ( $question_group instanceof EE_Question_Group ) {
184
-						$form_args['subsections'][ $question_group->identifier() ] = $this->_question_group_reg_form( $registration, $question_group );
179
+			$question_groups = $registration->event()->question_groups($query_params);
180
+			if ($question_groups) {
181
+				foreach ($question_groups as $question_group) {
182
+					if ($question_group instanceof EE_Question_Group) {
183
+						$form_args['subsections'][$question_group->identifier()] = $this->_question_group_reg_form($registration, $question_group);
185 184
 						// add hidden input
186
-						$form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input( $registration );
185
+						$form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input($registration);
187 186
 					}
188 187
 				}
189 188
 				// if we have question groups for additional attendees, then display the copy options
190 189
 				$this->_print_copy_info = $attendee_nmbr > 1 ? TRUE : $this->_print_copy_info;
191 190
 			} else {
192
-				$form_args['subsections'][ 'attendee_info_not_required_' . $registration->reg_url_link() ] = new EE_Form_Section_HTML(
191
+				$form_args['subsections']['attendee_info_not_required_'.$registration->reg_url_link()] = new EE_Form_Section_HTML(
193 192
 					EEH_Template::locate_template(
194
-						SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_not_required.template.php',
195
-						apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___registrations_reg_form__attendee_info_not_required_template_args', array()),
193
+						SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_not_required.template.php',
194
+						apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___registrations_reg_form__attendee_info_not_required_template_args', array()),
196 195
 						TRUE,
197 196
 						TRUE
198 197
 					)
199 198
 				);
200 199
 				// add hidden input
201
-				$form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input( $registration, FALSE );
200
+				$form_args['subsections']['additional_attendee_reg_info'] = $this->_additional_attendee_reg_info_input($registration, FALSE);
202 201
 			}
203 202
 		}
204
-		if ( $registration->is_primary_registrant() ) {
203
+		if ($registration->is_primary_registrant()) {
205 204
 			// generate hidden input
206
-			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs( $registration );
205
+			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs($registration);
207 206
 		}
208 207
 		$attendee_nmbr++;
209
-		return new EE_Form_Section_Proper( $form_args );
208
+		return new EE_Form_Section_Proper($form_args);
210 209
 	}
211 210
 
212 211
 
@@ -219,11 +218,11 @@  discard block
 block discarded – undo
219 218
 	 * @param bool  $additional_attendee_reg_info
220 219
 	 * @return    EE_Form_Input_Base
221 220
 	 */
222
-	private function _additional_attendee_reg_info_input( EE_Registration $registration, $additional_attendee_reg_info = TRUE ){
221
+	private function _additional_attendee_reg_info_input(EE_Registration $registration, $additional_attendee_reg_info = TRUE) {
223 222
 		// generate hidden input
224 223
 		return new EE_Hidden_Input(
225 224
 			array(
226
-				'html_id' 				=> 'additional-attendee-reg-info-' . $registration->reg_url_link(),
225
+				'html_id' 				=> 'additional-attendee-reg-info-'.$registration->reg_url_link(),
227 226
 				'default'				=> $additional_attendee_reg_info
228 227
 			)
229 228
 		);
@@ -236,22 +235,22 @@  discard block
 block discarded – undo
236 235
 	 * @param EE_Question_Group $question_group
237 236
 	 * @return EE_Form_Section_Proper
238 237
 	 */
239
-	private function _question_group_reg_form( EE_Registration $registration, EE_Question_Group $question_group ){
238
+	private function _question_group_reg_form(EE_Registration $registration, EE_Question_Group $question_group) {
240 239
 		// array of params to pass to parent constructor
241 240
 		$form_args = array(
242
-			'html_id' 					=> 'ee-reg-form-qstn-grp-' . $question_group->identifier(),
241
+			'html_id' 					=> 'ee-reg-form-qstn-grp-'.$question_group->identifier(),
243 242
 			'html_class' 			=> $this->checkout->admin_request ? 'form-table ee-reg-form-qstn-grp-dv' : 'ee-reg-form-qstn-grp-dv',
244
-			'html_label_id' 		=> 'ee-reg-form-qstn-grp-' . $question_group->identifier() . '-lbl',
243
+			'html_label_id' 		=> 'ee-reg-form-qstn-grp-'.$question_group->identifier().'-lbl',
245 244
 			'subsections' 			=> array(
246
-				'reg_form_qstn_grp_hdr' => $this->_question_group_header( $question_group )
245
+				'reg_form_qstn_grp_hdr' => $this->_question_group_header($question_group)
247 246
 			),
248 247
 			'layout_strategy' 	=> $this->checkout->admin_request ? new EE_Admin_Two_Column_Layout() : new EE_Div_Per_Section_Layout()
249 248
 		);
250 249
 		// where params
251
-		$query_params = array( 'QST_deleted' => 0 );
250
+		$query_params = array('QST_deleted' => 0);
252 251
 		// don't load admin only questions on the frontend
253
-		if ( ! $this->checkout->admin_request ) {
254
-			$query_params['QST_admin_only'] = array( '!=', TRUE );
252
+		if ( ! $this->checkout->admin_request) {
253
+			$query_params['QST_admin_only'] = array('!=', TRUE);
255 254
 		}
256 255
 		$questions = $question_group->get_many_related(
257 256
 			'Question',
@@ -263,21 +262,21 @@  discard block
 block discarded – undo
263 262
 			)
264 263
 		);
265 264
 		// filter for additional content before questions
266
-		$form_args['subsections']['reg_form_questions_before'] = new EE_Form_Section_HTML( apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '', $registration, $question_group, $this ));
265
+		$form_args['subsections']['reg_form_questions_before'] = new EE_Form_Section_HTML(apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', '', $registration, $question_group, $this));
267 266
 		// loop thru questions
268
-		foreach ( $questions as $question ) {
269
-			if( $question instanceof EE_Question ){
267
+		foreach ($questions as $question) {
268
+			if ($question instanceof EE_Question) {
270 269
 				$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
271
-				$form_args['subsections'][ $identifier ] = $this->reg_form_question( $registration, $question );
270
+				$form_args['subsections'][$identifier] = $this->reg_form_question($registration, $question);
272 271
 			}
273 272
 		}
274
-		$form_args['subsections'] = apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information__question_group_reg_form__subsections_array', $form_args['subsections'], $registration, $question_group, $this );
273
+		$form_args['subsections'] = apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information__question_group_reg_form__subsections_array', $form_args['subsections'], $registration, $question_group, $this);
275 274
 
276 275
 		// filter for additional content after questions
277
-		$form_args['subsections']['reg_form_questions_after'] = new EE_Form_Section_HTML( apply_filters( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '', $registration, $question_group, $this ));
276
+		$form_args['subsections']['reg_form_questions_after'] = new EE_Form_Section_HTML(apply_filters('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', '', $registration, $question_group, $this));
278 277
 //		d( $form_args );
279
-		$question_group_reg_form = new EE_Form_Section_Proper( $form_args );
280
-		return apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', $question_group_reg_form, $registration, $question_group, $this );
278
+		$question_group_reg_form = new EE_Form_Section_Proper($form_args);
279
+		return apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form', $question_group_reg_form, $registration, $question_group, $this);
281 280
 	}
282 281
 
283 282
 
@@ -287,12 +286,12 @@  discard block
 block discarded – undo
287 286
 	 * @param EE_Question_Group $question_group
288 287
 	 * @return 	EE_Form_Section_HTML
289 288
 	 */
290
-	private function _question_group_header( EE_Question_Group $question_group ){
289
+	private function _question_group_header(EE_Question_Group $question_group) {
291 290
 		$html = '';
292 291
 		// group_name
293
-		if ( $question_group->show_group_name() && $question_group->name() != '' ) {
292
+		if ($question_group->show_group_name() && $question_group->name() != '') {
294 293
 			EE_Registry::instance()->load_helper('HTML');
295
-			if ( $this->checkout->admin_request ) {
294
+			if ($this->checkout->admin_request) {
296 295
 				$html .= EEH_HTML::br();
297 296
 				$html .= EEH_HTML::h3(
298 297
 					$question_group->name(),
@@ -306,7 +305,7 @@  discard block
 block discarded – undo
306 305
 			}
307 306
 		}
308 307
 		// group_desc
309
-		if ( $question_group->show_group_desc() && $question_group->desc() != '' ) {
308
+		if ($question_group->show_group_desc() && $question_group->desc() != '') {
310 309
 			$html .= EEH_HTML::p(
311 310
 				$question_group->desc(),
312 311
 				'',
@@ -314,7 +313,7 @@  discard block
 block discarded – undo
314 313
 			);
315 314
 
316 315
 		}
317
-		return new EE_Form_Section_HTML( $html );
316
+		return new EE_Form_Section_HTML($html);
318 317
 	}
319 318
 
320 319
 
@@ -323,14 +322,14 @@  discard block
 block discarded – undo
323 322
 	 * @access public
324 323
 	 * @return 	EE_Form_Section_Proper
325 324
 	 */
326
-	private function _copy_attendee_info_form(){
325
+	private function _copy_attendee_info_form() {
327 326
 		// array of params to pass to parent constructor
328 327
 		return new EE_Form_Section_Proper(
329 328
 			array(
330 329
 				'subsections' 			=> $this->_copy_attendee_info_inputs(),
331 330
 				'layout_strategy' 	=> new EE_Template_Layout(
332 331
 					array(
333
-						'layout_template_file' 			=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'copy_attendee_info.template.php', // layout_template
332
+						'layout_template_file' 			=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'copy_attendee_info.template.php', // layout_template
334 333
 						'begin_template_file' 			=> NULL,
335 334
 						'input_template_file' 				=> NULL,
336 335
 						'subsection_template_file' 	=> NULL,
@@ -352,8 +351,8 @@  discard block
 block discarded – undo
352 351
 	private function _auto_copy_attendee_info() {
353 352
 		return new EE_Form_Section_HTML(
354 353
 			EEH_Template::locate_template(
355
-				SPCO_REG_STEPS_PATH . $this->_slug . DS . '_auto_copy_attendee_info.template.php',
356
-				apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information__auto_copy_attendee_info__template_args', array()),
354
+				SPCO_REG_STEPS_PATH.$this->_slug.DS.'_auto_copy_attendee_info.template.php',
355
+				apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information__auto_copy_attendee_info__template_args', array()),
357 356
 				TRUE,
358 357
 				TRUE
359 358
 			)
@@ -372,25 +371,25 @@  discard block
 block discarded – undo
372 371
 		$copy_attendee_info_inputs = array();
373 372
 		$prev_ticket = NULL;
374 373
 		// grab the saved registrations from the transaction
375
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
376
-		foreach ( $registrations as $registration ) {
374
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
375
+		foreach ($registrations as $registration) {
377 376
 			// for all  attendees other than the primary attendee
378
-			if ( $registration instanceof EE_Registration && ! $registration->is_primary_registrant() ) {
377
+			if ($registration instanceof EE_Registration && ! $registration->is_primary_registrant()) {
379 378
 				// if this is a new ticket OR if this is the very first additional attendee after the primary attendee
380
-				if ( $registration->ticket()->ID() !== $prev_ticket ) {
379
+				if ($registration->ticket()->ID() !== $prev_ticket) {
381 380
 					$item_name = $registration->ticket()->name();
382
-					$item_name .= $registration->ticket()->description() != '' ? ' - ' . $registration->ticket()->description() : '';
383
-					$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[ticket-' . $registration->ticket()->ID() . ']' ] = new EE_Form_Section_HTML(
384
-						'<h6 class="spco-copy-attendee-event-hdr">' . $item_name . '</h6>'
381
+					$item_name .= $registration->ticket()->description() != '' ? ' - '.$registration->ticket()->description() : '';
382
+					$copy_attendee_info_inputs['spco_copy_attendee_chk[ticket-'.$registration->ticket()->ID().']'] = new EE_Form_Section_HTML(
383
+						'<h6 class="spco-copy-attendee-event-hdr">'.$item_name.'</h6>'
385 384
 					);
386 385
 					$prev_ticket = $registration->ticket()->ID();
387 386
 				}
388 387
 
389
-				$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[' . $registration->ID() . ']' ] = new
388
+				$copy_attendee_info_inputs['spco_copy_attendee_chk['.$registration->ID().']'] = new
390 389
 				EE_Checkbox_Multi_Input(
391
-					array( $registration->ID() => sprintf( __('Attendee #%s', 'event_espresso'), $registration->count() )),
390
+					array($registration->ID() => sprintf(__('Attendee #%s', 'event_espresso'), $registration->count())),
392 391
 					array(
393
-						'html_id' 								=> 'spco-copy-attendee-chk-' . $registration->reg_url_link(),
392
+						'html_id' 								=> 'spco-copy-attendee-chk-'.$registration->reg_url_link(),
394 393
 						'html_class' 						=> 'spco-copy-attendee-chk ee-do-not-validate',
395 394
 						'display_html_label_text' 	=> FALSE
396 395
 					)
@@ -409,7 +408,7 @@  discard block
 block discarded – undo
409 408
 	 * @param EE_Registration $registration
410 409
 	 * @return    EE_Form_Input_Base
411 410
 	 */
412
-	private function _additional_primary_registrant_inputs( EE_Registration $registration ){
411
+	private function _additional_primary_registrant_inputs(EE_Registration $registration) {
413 412
 		// generate hidden input
414 413
 		return new EE_Hidden_Input(
415 414
 			array(
@@ -427,31 +426,31 @@  discard block
 block discarded – undo
427 426
 	 * @param EE_Question     $question
428 427
 	 * @return 	EE_Form_Input_Base
429 428
 	 */
430
-	public function reg_form_question( EE_Registration $registration, EE_Question $question ){
429
+	public function reg_form_question(EE_Registration $registration, EE_Question $question) {
431 430
 
432 431
 		// if this question was for an attendee detail, then check for that answer
433
-		$answer_value = EEM_Answer::instance()->get_attendee_property_answer_value( $registration, $question->system_ID() );
432
+		$answer_value = EEM_Answer::instance()->get_attendee_property_answer_value($registration, $question->system_ID());
434 433
 		$answer = $answer_value === null
435
-				? EEM_Answer::instance()->get_one( array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() )	) )
434
+				? EEM_Answer::instance()->get_one(array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID())))
436 435
 				: null;
437 436
 		// if NOT returning to edit an existing registration OR if this question is for an attendee property OR we still don't have an EE_Answer object
438
-		if( ! $registration->reg_url_link() || $answer_value || ! $answer instanceof EE_Answer ) {
437
+		if ( ! $registration->reg_url_link() || $answer_value || ! $answer instanceof EE_Answer) {
439 438
 			// create an EE_Answer object for storing everything in
440
-			$answer = EE_Answer::new_instance ( array(
439
+			$answer = EE_Answer::new_instance(array(
441 440
 				'QST_ID'=> $question->ID(),
442 441
 				'REG_ID'=> $registration->ID()
443 442
 			));
444 443
 		}
445 444
 		// verify instance
446
-		if( $answer instanceof EE_Answer ){
447
-			if ( ! empty( $answer_value )) {
448
-				$answer->set( 'ANS_value', $answer_value );
445
+		if ($answer instanceof EE_Answer) {
446
+			if ( ! empty($answer_value)) {
447
+				$answer->set('ANS_value', $answer_value);
449 448
 			}
450
-			$answer->cache( 'Question', $question );
451
-			$answer_cache_id =$question->system_ID() != NULL ? $question->system_ID() . '-' . $registration->reg_url_link() : $question->ID() . '-' . $registration->reg_url_link();
452
-			$registration->cache( 'Answer', $answer, $answer_cache_id );
449
+			$answer->cache('Question', $question);
450
+			$answer_cache_id = $question->system_ID() != NULL ? $question->system_ID().'-'.$registration->reg_url_link() : $question->ID().'-'.$registration->reg_url_link();
451
+			$registration->cache('Answer', $answer, $answer_cache_id);
453 452
 		}
454
-		return $this->_generate_question_input( $registration, $question, $answer );
453
+		return $this->_generate_question_input($registration, $question, $answer);
455 454
 
456 455
 	}
457 456
 
@@ -463,7 +462,7 @@  discard block
 block discarded – undo
463 462
 	 * @param mixed EE_Answer|NULL      $answer
464 463
 	 * @return EE_Form_Input_Base
465 464
 	 */
466
-	private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){
465
+	private function _generate_question_input(EE_Registration $registration, EE_Question $question, $answer) {
467 466
 		//		d( $registration );
468 467
 		//		d( $question );
469 468
 		//		d( $answer );
@@ -486,103 +485,103 @@  discard block
 block discarded – undo
486 485
 		$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
487 486
 
488 487
 		$input_constructor_args = array(
489
-			'html_name' 			=> 'ee_reg_qstn[' . $registration->ID() . '][' . $identifier . ']',
490
-			'html_id' 					=> 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
491
-			'html_class' 			=> 'ee-reg-qstn ee-reg-qstn-' . $identifier,
488
+			'html_name' 			=> 'ee_reg_qstn['.$registration->ID().']['.$identifier.']',
489
+			'html_id' 					=> 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
490
+			'html_class' 			=> 'ee-reg-qstn ee-reg-qstn-'.$identifier,
492 491
 			'required' 				=> $question->required() ? TRUE : FALSE,
493
-			'html_label_id'		=> 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
492
+			'html_label_id'		=> 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
494 493
 			'html_label_class'	=> 'ee-reg-qstn',
495 494
 			'html_label_text'		=> $question->display_text(),
496 495
 			'required_validation_error_message' => $question->required_text()
497 496
 		);
498 497
 		// has this question been answered ?
499
-		if ( $answer instanceof EE_Answer ) {
500
-			if ( $answer->ID() ) {
501
-				$input_constructor_args['html_name'] 		.= '[' . $answer->ID() . ']';
502
-				$input_constructor_args['html_id'] 				.= '-' . $answer->ID();
503
-				$input_constructor_args['html_label_id'] 	.= '-' . $answer->ID();
498
+		if ($answer instanceof EE_Answer) {
499
+			if ($answer->ID()) {
500
+				$input_constructor_args['html_name'] 		.= '['.$answer->ID().']';
501
+				$input_constructor_args['html_id'] 				.= '-'.$answer->ID();
502
+				$input_constructor_args['html_label_id'] .= '-'.$answer->ID();
504 503
 			}
505 504
 			$input_constructor_args['default'] = $answer->value();
506 505
 		}
507 506
 		//add "-lbl" to the end of the label id
508
-		$input_constructor_args['html_label_id'] 	.= '-lbl';
509
-		$input_constructor_args = apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__input_constructor_args',
507
+		$input_constructor_args['html_label_id'] .= '-lbl';
508
+		$input_constructor_args = apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__input_constructor_args',
510 509
 				$input_constructor_args,
511 510
 				$registration,
512 511
 				$question,
513 512
 				$answer
514 513
 				);
515 514
 
516
-		$this->_required_questions[ $identifier ] = $question->required() ? true : false;
515
+		$this->_required_questions[$identifier] = $question->required() ? true : false;
517 516
 
518
-		switch ( $question->type() ) {
517
+		switch ($question->type()) {
519 518
 			// Text
520 519
 			case EEM_Question::QST_type_text :
521
-				if( $identifier == 'email' ){
522
-					return new EE_Email_Input( $input_constructor_args );
523
-				}else{
524
-					return new EE_Text_Input( $input_constructor_args );
520
+				if ($identifier == 'email') {
521
+					return new EE_Email_Input($input_constructor_args);
522
+				} else {
523
+					return new EE_Text_Input($input_constructor_args);
525 524
 				}
526 525
 				break;
527 526
 			// Textarea
528 527
 			case EEM_Question::QST_type_textarea :
529
-				return new EE_Text_Area_Input( $input_constructor_args );
528
+				return new EE_Text_Area_Input($input_constructor_args);
530 529
 				break;
531 530
 			// Radio Buttons
532 531
 			case EEM_Question::QST_type_radio :
533
-				return new EE_Radio_Button_Input( $question->options(), $input_constructor_args );
532
+				return new EE_Radio_Button_Input($question->options(), $input_constructor_args);
534 533
 				break;
535 534
 			// Dropdown
536 535
 			case EEM_Question::QST_type_dropdown :
537
-				return new EE_Select_Input( $question->options(), $input_constructor_args );
536
+				return new EE_Select_Input($question->options(), $input_constructor_args);
538 537
 				break;
539 538
 			// State Dropdown
540 539
 			case EEM_Question::QST_type_state :
541
-				$state_options = array( '' => array( '' => ''));
540
+				$state_options = array('' => array('' => ''));
542 541
 				$states = $this->checkout->action == 'process_reg_step' ? EEM_State::instance()->get_all_states() : EEM_State::instance()->get_all_active_states();
543
-				if ( ! empty( $states )) {
544
-					foreach( $states as $state ){
545
-						if ( $state instanceof EE_State ) {
546
-							$state_options[ $state->country()->name() ][ $state->ID() ] = $state->name();
542
+				if ( ! empty($states)) {
543
+					foreach ($states as $state) {
544
+						if ($state instanceof EE_State) {
545
+							$state_options[$state->country()->name()][$state->ID()] = $state->name();
547 546
 						}
548 547
 					}
549 548
 				}
550
-				$state_options = apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', $state_options, $this, $registration, $question, $answer );
551
-				return new EE_State_Select_Input( $state_options, $input_constructor_args );
549
+				$state_options = apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__state_options', $state_options, $this, $registration, $question, $answer);
550
+				return new EE_State_Select_Input($state_options, $input_constructor_args);
552 551
 				break;
553 552
 			// Country Dropdown
554 553
 			case EEM_Question::QST_type_country :
555
-				$country_options = array( '' => '' );
554
+				$country_options = array('' => '');
556 555
 				// get possibly cached list of countries
557 556
 				$countries = $this->checkout->action == 'process_reg_step' ? EEM_Country::instance()->get_all_countries() : EEM_Country::instance()->get_all_active_countries();
558
-				if ( ! empty( $countries )) {
559
-					foreach( $countries as $country ){
560
-						if ( $country instanceof EE_Country ) {
561
-							$country_options[ $country->ID() ] = $country->name();
557
+				if ( ! empty($countries)) {
558
+					foreach ($countries as $country) {
559
+						if ($country instanceof EE_Country) {
560
+							$country_options[$country->ID()] = $country->name();
562 561
 						}
563 562
 					}
564 563
 				}
565
-				$country_options = apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', $country_options, $this, $registration, $question, $answer );
566
-				return new EE_Country_Select_Input( $country_options, $input_constructor_args );
564
+				$country_options = apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__country_options', $country_options, $this, $registration, $question, $answer);
565
+				return new EE_Country_Select_Input($country_options, $input_constructor_args);
567 566
 				break;
568 567
 			// Checkboxes
569 568
 			case EEM_Question::QST_type_checkbox :
570
-				return new EE_Checkbox_Multi_Input( $question->options(), $input_constructor_args );
569
+				return new EE_Checkbox_Multi_Input($question->options(), $input_constructor_args);
571 570
 				break;
572 571
 			// Date
573 572
 			case EEM_Question::QST_type_date :
574
-				return new EE_Datepicker_Input( $input_constructor_args );
573
+				return new EE_Datepicker_Input($input_constructor_args);
575 574
 				break;
576 575
 			case EEM_Question::QST_type_html_textarea :
577
-				$input_constructor_args[ 'validation_strategies' ][] = new EE_Simple_HTML_Validation_Strategy();
578
-				$input =  new EE_Text_Area_Input( $input_constructor_args );
579
-				$input->remove_validation_strategy( 'EE_Plaintext_Validation_Strategy' );
576
+				$input_constructor_args['validation_strategies'][] = new EE_Simple_HTML_Validation_Strategy();
577
+				$input = new EE_Text_Area_Input($input_constructor_args);
578
+				$input->remove_validation_strategy('EE_Plaintext_Validation_Strategy');
580 579
 				return $input;
581 580
 			// fallback
582 581
 			default :
583
-				$default_input = apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__default', null, $question->type(), $question, $input_constructor_args );
584
-				if( ! $default_input ){
585
-					$default_input = new EE_Text_Input( $input_constructor_args );
582
+				$default_input = apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__default', null, $question->type(), $question, $input_constructor_args);
583
+				if ( ! $default_input) {
584
+					$default_input = new EE_Text_Input($input_constructor_args);
586 585
 				}
587 586
 				return $default_input;
588 587
 		}
@@ -607,65 +606,65 @@  discard block
 block discarded – undo
607 606
 	 */
608 607
 	public function process_reg_step() {
609 608
 
610
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
609
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
611 610
 		// grab validated data from form
612 611
 		$valid_data = $this->checkout->current_step->valid_data();
613 612
 		//EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
614 613
 		//EEH_Debug_Tools::printr( $valid_data, '$valid_data', __FILE__, __LINE__ );
615 614
 		// if we don't have any $valid_data then something went TERRIBLY WRONG !!!
616
-		if ( empty( $valid_data ))  {
617
-			EE_Error::add_error( __('No valid question responses were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
615
+		if (empty($valid_data)) {
616
+			EE_Error::add_error(__('No valid question responses were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
618 617
 			return FALSE;
619 618
 		}
620 619
 		//EEH_Debug_Tools::printr( $this->checkout->transaction, '$this->checkout->transaction', __FILE__, __LINE__ );
621
-		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg ) {
622
-			EE_Error::add_error( __( 'A valid transaction could not be initiated for processing your registrations.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
620
+		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg) {
621
+			EE_Error::add_error(__('A valid transaction could not be initiated for processing your registrations.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
623 622
 			return FALSE;
624 623
 		}
625 624
 		// get cached registrations
626
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
625
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
627 626
 		// verify we got the goods
628
-		if ( empty( $registrations )) {
629
-			EE_Error::add_error( __( 'Your form data could not be applied to any valid registrations.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
627
+		if (empty($registrations)) {
628
+			EE_Error::add_error(__('Your form data could not be applied to any valid registrations.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
630 629
 			return FALSE;
631 630
 		}
632 631
 		// extract attendee info from form data and save to model objects
633
-		$registrations_processed = $this->_process_registrations( $registrations, $valid_data );
632
+		$registrations_processed = $this->_process_registrations($registrations, $valid_data);
634 633
 		// if first pass thru SPCO, then let's check processed registrations against the total number of tickets in the cart
635
-		if ( $registrations_processed === FALSE ) {
634
+		if ($registrations_processed === FALSE) {
636 635
 			// but return immediately if the previous step exited early due to errors
637 636
 			return FALSE;
638
-		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count ) {
637
+		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count) {
639 638
 			// generate a correctly translated string for all possible singular/plural combinations
640
-			if ( $this->checkout->total_ticket_count === 1 && $registrations_processed !== 1 ) {
639
+			if ($this->checkout->total_ticket_count === 1 && $registrations_processed !== 1) {
641 640
 				$error_msg = sprintf(
642
-					__( 'There was %1$d ticket in the Event Queue, but %2$ds registrations were processed', 'event_espresso' ),
641
+					__('There was %1$d ticket in the Event Queue, but %2$ds registrations were processed', 'event_espresso'),
643 642
 					$this->checkout->total_ticket_count,
644 643
 					$registrations_processed
645 644
 				);
646
-			} else if ( $this->checkout->total_ticket_count !== 1 && $registrations_processed === 1 ) {
645
+			} else if ($this->checkout->total_ticket_count !== 1 && $registrations_processed === 1) {
647 646
 				$error_msg = sprintf(
648
-					__( 'There was a total of %1$d tickets in the Event Queue, but only %2$ds registration was processed', 'event_espresso' ),
647
+					__('There was a total of %1$d tickets in the Event Queue, but only %2$ds registration was processed', 'event_espresso'),
649 648
 					$this->checkout->total_ticket_count,
650 649
 					$registrations_processed
651 650
 				);
652 651
 			} else {
653 652
 				$error_msg = sprintf(
654
-					__( 'There was a total of %1$d tickets in the Event Queue, but %2$ds registrations were processed', 'event_espresso' ),
653
+					__('There was a total of %1$d tickets in the Event Queue, but %2$ds registrations were processed', 'event_espresso'),
655 654
 					$this->checkout->total_ticket_count,
656 655
 					$registrations_processed
657 656
 				);
658 657
 
659 658
 			}
660
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
659
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
661 660
 			return FALSE;
662 661
 		}
663 662
 		// mark this reg step as completed
664 663
 		$this->checkout->current_step->set_completed();
665
-		$this->_set_success_message( __('The Attendee Information Step has been successfully completed.', 'event_espresso' ));
664
+		$this->_set_success_message(__('The Attendee Information Step has been successfully completed.', 'event_espresso'));
666 665
 		//do action in case a plugin wants to do something with the data submitted in step 1.
667 666
 		//passes EE_Single_Page_Checkout, and it's posted data
668
-		do_action( 'AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data );
667
+		do_action('AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data);
669 668
 		return TRUE;
670 669
 
671 670
 	}
@@ -679,9 +678,9 @@  discard block
 block discarded – undo
679 678
 	 * @param array             $valid_data
680 679
 	 * @return boolean | int
681 680
 	 */
682
-	private function _process_registrations( $registrations = array(), $valid_data = array() ) {
681
+	private function _process_registrations($registrations = array(), $valid_data = array()) {
683 682
 		// load resources and set some defaults
684
-		EE_Registry::instance()->load_model( 'Attendee' );
683
+		EE_Registry::instance()->load_model('Attendee');
685 684
 		// holder for primary registrant attendee object
686 685
 		$this->checkout->primary_attendee_obj = NULL;
687 686
 		// array for tracking reg form data for the primary registrant
@@ -698,19 +697,19 @@  discard block
 block discarded – undo
698 697
 		// attendee counter
699 698
 		$att_nmbr = 0;
700 699
 		// grab the saved registrations from the transaction
701
-		foreach ( $registrations  as $registration ) {
700
+		foreach ($registrations  as $registration) {
702 701
 			// verify EE_Registration object
703
-			if ( ! $registration instanceof EE_Registration ) {
704
-				EE_Error::add_error( __( 'An invalid Registration object was discovered when attempting to process your registration information.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__);
702
+			if ( ! $registration instanceof EE_Registration) {
703
+				EE_Error::add_error(__('An invalid Registration object was discovered when attempting to process your registration information.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
705 704
 				return FALSE;
706 705
 			}
707 706
 			$reg_url_link = $registration->reg_url_link();
708 707
 			// reg_url_link exists ?
709
-			if ( $reg_url_link ) {
708
+			if ($reg_url_link) {
710 709
 				// should this registration be processed during this visit ?
711
-				if ( $this->checkout->visit_allows_processing_of_this_registration( $registration ) ) {
710
+				if ($this->checkout->visit_allows_processing_of_this_registration($registration)) {
712 711
 					// if NOT revisiting, then let's save the registration now, so that we have a REG_ID to use when generating other objects
713
-					if ( ! $this->checkout->revisit ) {
712
+					if ( ! $this->checkout->revisit) {
714 713
 						$registration->save();
715 714
 					}
716 715
 
@@ -721,41 +720,41 @@  discard block
 block discarded – undo
721 720
 					 * @var bool   if TRUE is returned by the plugin then the
722 721
 					 *      		registration processing is halted.
723 722
 					 */
724
-					if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process', FALSE, $att_nmbr, $registration, $registrations, $valid_data, $this ) ) {
723
+					if (apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process', FALSE, $att_nmbr, $registration, $registrations, $valid_data, $this)) {
725 724
 						return FALSE;
726 725
 					}
727 726
 
728 727
 					// Houston, we have a registration!
729 728
 					$att_nmbr++;
730
-					$this->_attendee_data[ $reg_url_link ] = array();
729
+					$this->_attendee_data[$reg_url_link] = array();
731 730
 					// unset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] );
732
-					if ( isset( $valid_data[ $reg_url_link ] )) {
731
+					if (isset($valid_data[$reg_url_link])) {
733 732
 						// do we need to copy basic info from primary attendee ?
734
-						$copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0 ? TRUE : FALSE;
733
+						$copy_primary = isset($valid_data[$reg_url_link]['additional_attendee_reg_info']) && absint($valid_data[$reg_url_link]['additional_attendee_reg_info']) === 0 ? TRUE : FALSE;
735 734
 						// filter form input data for this registration
736
-						$valid_data[ $reg_url_link ] = apply_filters( 'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', $valid_data[ $reg_url_link ] );
735
+						$valid_data[$reg_url_link] = apply_filters('FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item', $valid_data[$reg_url_link]);
737 736
 						//EEH_Debug_Tools::printr( $valid_data[ $reg_url_link ], '$valid_data[ $reg_url_link ]', __FILE__, __LINE__ );
738
-						if ( isset( $valid_data['primary_attendee'] )) {
739
-							$primary_registrant['line_item_id'] =  ! empty( $valid_data['primary_attendee'] ) ? $valid_data['primary_attendee'] : FALSE;
740
-							unset( $valid_data['primary_attendee'] );
737
+						if (isset($valid_data['primary_attendee'])) {
738
+							$primary_registrant['line_item_id'] = ! empty($valid_data['primary_attendee']) ? $valid_data['primary_attendee'] : FALSE;
739
+							unset($valid_data['primary_attendee']);
741 740
 						}
742 741
 						// now loop through our array of valid post data && process attendee reg forms
743
-						foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs ) {
744
-							if ( ! in_array( $form_section, $non_input_form_sections )) {
745
-								foreach ( $form_inputs as $form_input => $input_value ) {
742
+						foreach ($valid_data[$reg_url_link] as $form_section => $form_inputs) {
743
+							if ( ! in_array($form_section, $non_input_form_sections)) {
744
+								foreach ($form_inputs as $form_input => $input_value) {
746 745
 									// check for critical inputs
747
-									if ( ! $this->_verify_critical_attendee_details_are_set_and_validate_email( $form_input, $input_value )) {
746
+									if ( ! $this->_verify_critical_attendee_details_are_set_and_validate_email($form_input, $input_value)) {
748 747
 										return FALSE;
749 748
 									}
750 749
 									// store a bit of data about the primary attendee
751
-									if ( $att_nmbr == 1 && $reg_url_link == $primary_registrant['line_item_id'] && ! empty( $input_value )) {
752
-										$primary_registrant[ $form_input ] = $input_value;
753
-									} else if ( $copy_primary && isset( $primary_registrant[ $form_input ] ) && $input_value == NULL ) {
754
-										$input_value = $primary_registrant[ $form_input ];
750
+									if ($att_nmbr == 1 && $reg_url_link == $primary_registrant['line_item_id'] && ! empty($input_value)) {
751
+										$primary_registrant[$form_input] = $input_value;
752
+									} else if ($copy_primary && isset($primary_registrant[$form_input]) && $input_value == NULL) {
753
+										$input_value = $primary_registrant[$form_input];
755 754
 									}
756 755
 									// now attempt to save the input data
757
-									if ( ! $this->_save_registration_form_input( $registration, $form_input, $input_value ))  {
758
-										EE_Error::add_error( sprintf( __( 'Unable to save registration form data for the form input: "%1$s" with the submitted value: "%2$s"', 'event_espresso' ), $form_input, $input_value ), __FILE__, __FUNCTION__, __LINE__ );
756
+									if ( ! $this->_save_registration_form_input($registration, $form_input, $input_value)) {
757
+										EE_Error::add_error(sprintf(__('Unable to save registration form data for the form input: "%1$s" with the submitted value: "%2$s"', 'event_espresso'), $form_input, $input_value), __FILE__, __FUNCTION__, __LINE__);
759 758
 										return FALSE;
760 759
 									}
761 760
 								}
@@ -764,51 +763,51 @@  discard block
 block discarded – undo
764 763
 					}
765 764
 					//EEH_Debug_Tools::printr( $this->_attendee_data, '$this->_attendee_data', __FILE__, __LINE__ );
766 765
 					// this registration does not require additional attendee information ?
767
-					if ( $copy_primary && $att_nmbr > 1 && $this->checkout->primary_attendee_obj instanceof EE_Attendee ) {
766
+					if ($copy_primary && $att_nmbr > 1 && $this->checkout->primary_attendee_obj instanceof EE_Attendee) {
768 767
 						// just copy the primary registrant
769 768
 						$attendee = $this->checkout->primary_attendee_obj;
770 769
 					} else {
771 770
 						// have we met before?
772
-						$attendee = $this->_find_existing_attendee( $registration, $this->_attendee_data[ $reg_url_link ] );
771
+						$attendee = $this->_find_existing_attendee($registration, $this->_attendee_data[$reg_url_link]);
773 772
 						// did we find an already existing record for this attendee ?
774
-						if ( $attendee instanceof EE_Attendee ) {
775
-							$attendee = $this->_update_existing_attendee_data( $attendee, $this->_attendee_data[ $reg_url_link ] );
773
+						if ($attendee instanceof EE_Attendee) {
774
+							$attendee = $this->_update_existing_attendee_data($attendee, $this->_attendee_data[$reg_url_link]);
776 775
 						} else {
777 776
 							// ensure critical details are set for additional attendees
778
-							$this->_attendee_data[ $reg_url_link ] = $att_nmbr > 1 ? $this->_copy_critical_attendee_details_from_primary_registrant( $this->_attendee_data[ $reg_url_link ] ) : $this->_attendee_data[ $reg_url_link ];
779
-							$attendee = $this->_create_new_attendee( $registration, $this->_attendee_data[ $reg_url_link ] );
777
+							$this->_attendee_data[$reg_url_link] = $att_nmbr > 1 ? $this->_copy_critical_attendee_details_from_primary_registrant($this->_attendee_data[$reg_url_link]) : $this->_attendee_data[$reg_url_link];
778
+							$attendee = $this->_create_new_attendee($registration, $this->_attendee_data[$reg_url_link]);
780 779
 						}
781 780
 						// who's #1 ?
782
-						if ( $att_nmbr == 1 ) {
781
+						if ($att_nmbr == 1) {
783 782
 							$this->checkout->primary_attendee_obj = $attendee;
784 783
 						}
785 784
 					}
786 785
 					//EEH_Debug_Tools::printr( $attendee, '$attendee', __FILE__, __LINE__ );
787 786
 					// add relation to registration, set attendee ID, and cache attendee
788
-					$this->_associate_attendee_with_registration( $registration, $attendee );
789
-					if ( ! $registration->attendee() instanceof EE_Attendee ) {
790
-						EE_Error::add_error( sprintf( __( 'Registration %s has an invalid or missing Attendee object.', 'event_espresso' ), $reg_url_link ), __FILE__, __FUNCTION__, __LINE__ );
787
+					$this->_associate_attendee_with_registration($registration, $attendee);
788
+					if ( ! $registration->attendee() instanceof EE_Attendee) {
789
+						EE_Error::add_error(sprintf(__('Registration %s has an invalid or missing Attendee object.', 'event_espresso'), $reg_url_link), __FILE__, __FUNCTION__, __LINE__);
791 790
 						return FALSE;
792 791
 					}
793 792
 					/** @type EE_Registration_Processor $registration_processor */
794
-					$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
793
+					$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
795 794
 					// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
796
-					$registration_processor->toggle_incomplete_registration_status_to_default( $registration, FALSE );
795
+					$registration_processor->toggle_incomplete_registration_status_to_default($registration, FALSE);
797 796
 					/** @type EE_Transaction_Processor $transaction_processor */
798
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
797
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
799 798
 					// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
800
-					$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
799
+					$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
801 800
 					// if we've gotten this far, then let's save what we have
802 801
 					$registration->save();
803 802
 					// add relation between TXN and registration
804
-					$this->_associate_registration_with_transaction( $registration );
803
+					$this->_associate_registration_with_transaction($registration);
805 804
 
806 805
 				} // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) {
807 806
 
808
-			}  else {
809
-				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__ );
807
+			} else {
808
+				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__);
810 809
 				// remove malformed data
811
-				unset( $valid_data[ $reg_url_link ] );
810
+				unset($valid_data[$reg_url_link]);
812 811
 				return FALSE;
813 812
 			}
814 813
 
@@ -826,22 +825,22 @@  discard block
 block discarded – undo
826 825
 	 * @param string           	$input_value
827 826
 	 * @return boolean
828 827
 	 */
829
-	private function _save_registration_form_input( EE_Registration $registration, $form_input = '', $input_value = '' ) {
828
+	private function _save_registration_form_input(EE_Registration $registration, $form_input = '', $input_value = '') {
830 829
 		//echo '<h3 style="color:#999;line-height:.9em;"><span style="color:#2EA2CC">' . __CLASS__ . '</span>::<span style="color:#E76700">' . __FUNCTION__ . '()</span><br/><span style="font-size:9px;font-weight:normal;">' . __FILE__ . '</span>    <b style="font-size:10px;">  ' . __LINE__ . ' </b></h3>';
831 830
 		//EEH_Debug_Tools::printr( $form_input, '$form_input', __FILE__, __LINE__ );
832 831
 		// allow for plugins to hook in and do their own processing of the form input.
833 832
 		// For plugins to bypass normal processing here, they just need to return a boolean value.
834
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___save_registration_form_input', FALSE, $registration, $form_input, $input_value, $this ) ) {
833
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___save_registration_form_input', FALSE, $registration, $form_input, $input_value, $this)) {
835 834
 			return TRUE;
836 835
 		}
837 836
 
838 837
 		// grab related answer objects
839 838
 		$answers = $registration->answers();
840 839
 		// $answer_cache_id is the key used to find the EE_Answer we want
841
-		$answer_cache_id = $this->checkout->reg_url_link ? $form_input : $form_input . '-' . $registration->reg_url_link();
842
-		$answer_is_obj = isset( $answers[ $answer_cache_id ] ) && $answers[ $answer_cache_id ] instanceof EE_Answer ? TRUE : FALSE;
840
+		$answer_cache_id = $this->checkout->reg_url_link ? $form_input : $form_input.'-'.$registration->reg_url_link();
841
+		$answer_is_obj = isset($answers[$answer_cache_id]) && $answers[$answer_cache_id] instanceof EE_Answer ? TRUE : FALSE;
843 842
 		//rename form_inputs if they are EE_Attendee properties
844
-		switch( (string)$form_input ) {
843
+		switch ((string) $form_input) {
845 844
 
846 845
 			case 'state' :
847 846
 			case 'STA_ID' :
@@ -856,33 +855,33 @@  discard block
 block discarded – undo
856 855
 				break;
857 856
 
858 857
 			default :
859
-				$ATT_input = 'ATT_' . $form_input;
858
+				$ATT_input = 'ATT_'.$form_input;
860 859
 				//EEH_Debug_Tools::printr( $ATT_input, '$ATT_input', __FILE__, __LINE__ );
861
-				$attendee_property = EEM_Attendee::instance()->has_field( $ATT_input ) ? TRUE : FALSE;
862
-				$form_input = $attendee_property ? 'ATT_' . $form_input : $form_input;
860
+				$attendee_property = EEM_Attendee::instance()->has_field($ATT_input) ? TRUE : FALSE;
861
+				$form_input = $attendee_property ? 'ATT_'.$form_input : $form_input;
863 862
 		}
864 863
 		//EEH_Debug_Tools::printr( $input_value, '$input_value', __FILE__, __LINE__ );
865 864
 		//EEH_Debug_Tools::printr( $answer_cache_id, '$answer_cache_id', __FILE__, __LINE__ );
866 865
 		//EEH_Debug_Tools::printr( $attendee_property, '$attendee_property', __FILE__, __LINE__ );
867 866
 		//EEH_Debug_Tools::printr( $answer_is_obj, '$answer_is_obj', __FILE__, __LINE__ );
868 867
 		// if this form input has a corresponding attendee property
869
-		if ( $attendee_property ) {
870
-			$this->_attendee_data[ $registration->reg_url_link() ][ $form_input ] = $input_value;
871
-			if (  $answer_is_obj ) {
868
+		if ($attendee_property) {
869
+			$this->_attendee_data[$registration->reg_url_link()][$form_input] = $input_value;
870
+			if ($answer_is_obj) {
872 871
 				// and delete the corresponding answer since we won't be storing this data in that object
873
-				$registration->_remove_relation_to( $answers[ $answer_cache_id ], 'Answer' );
874
-				$answers[ $answer_cache_id ]->delete_permanently();
872
+				$registration->_remove_relation_to($answers[$answer_cache_id], 'Answer');
873
+				$answers[$answer_cache_id]->delete_permanently();
875 874
 			}
876 875
 			return TRUE;
877
-		} elseif ( $answer_is_obj ) {
876
+		} elseif ($answer_is_obj) {
878 877
 			// save this data to the answer object
879
-			$answers[ $answer_cache_id ]->set_value( $input_value );
880
-			$result = $answers[ $answer_cache_id ]->save();
878
+			$answers[$answer_cache_id]->set_value($input_value);
879
+			$result = $answers[$answer_cache_id]->save();
881 880
 			return $result !== false ? true : false;
882 881
 		} else {
883
-			foreach ( $answers as $answer ) {
884
-				if ( $answer instanceof EE_Answer && $answer->question_ID() == $answer_cache_id ) {
885
-					$answer->set_value( $input_value );
882
+			foreach ($answers as $answer) {
883
+				if ($answer instanceof EE_Answer && $answer->question_ID() == $answer_cache_id) {
884
+					$answer->set_value($input_value);
886 885
 					$result = $answer->save();
887 886
 					return $result !== false ? true : false;
888 887
 				}
@@ -900,33 +899,33 @@  discard block
 block discarded – undo
900 899
 	 * @param string $input_value
901 900
 	 * @return boolean
902 901
 	 */
903
-	private function _verify_critical_attendee_details_are_set_and_validate_email( $form_input = '', $input_value = '' ) {
904
-		if ( empty( $input_value )) {
902
+	private function _verify_critical_attendee_details_are_set_and_validate_email($form_input = '', $input_value = '') {
903
+		if (empty($input_value)) {
905 904
 			// if the form input isn't marked as being required, then just return
906
-			if ( ! isset( $this->_required_questions[ $form_input ]  ) || ! $this->_required_questions[ $form_input ] ) {
905
+			if ( ! isset($this->_required_questions[$form_input]) || ! $this->_required_questions[$form_input]) {
907 906
 				return true;
908 907
 			}
909
-			switch( $form_input ) {
908
+			switch ($form_input) {
910 909
 				case 'fname' :
911
-					EE_Error::add_error( __( 'First Name is a required value.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
910
+					EE_Error::add_error(__('First Name is a required value.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
912 911
 					return FALSE;
913 912
 					break;
914 913
 				case 'lname' :
915
-					EE_Error::add_error( __( 'Last Name is a required value.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
914
+					EE_Error::add_error(__('Last Name is a required value.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
916 915
 					return FALSE;
917 916
 					break;
918 917
 				case 'email' :
919
-					EE_Error::add_error( __( 'Email Address is a required value.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
918
+					EE_Error::add_error(__('Email Address is a required value.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
920 919
 					return FALSE;
921 920
 					break;
922 921
 			}
923
-		} else if ( $form_input === 'email' ) {
922
+		} else if ($form_input === 'email') {
924 923
 			// clean the email address
925
-			$valid_email = sanitize_email( $input_value );
924
+			$valid_email = sanitize_email($input_value);
926 925
 			// check if it matches
927
-			if ( $input_value != $valid_email ) {
926
+			if ($input_value != $valid_email) {
928 927
 				// whoops!!!
929
-				EE_Error::add_error( __( 'Please enter a valid email address.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
928
+				EE_Error::add_error(__('Please enter a valid email address.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
930 929
 				return FALSE;
931 930
 			}
932 931
 		}
@@ -954,14 +953,14 @@  discard block
 block discarded – undo
954 953
 	 * @param array           $attendee_data
955 954
 	 * @return boolean
956 955
 	 */
957
-	private function _find_existing_attendee( EE_Registration $registration, $attendee_data = array() ) {
956
+	private function _find_existing_attendee(EE_Registration $registration, $attendee_data = array()) {
958 957
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
959
-		$ATT_fname = isset( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_fname'] ) ? $attendee_data['ATT_fname'] : '';
960
-		$ATT_lname = isset( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_lname'] ) ? $attendee_data['ATT_lname'] : '';
961
-		$ATT_email = isset( $attendee_data['ATT_email'] ) && ! empty( $attendee_data['ATT_email'] ) ? $attendee_data['ATT_email'] : '';
958
+		$ATT_fname = isset($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_fname']) ? $attendee_data['ATT_fname'] : '';
959
+		$ATT_lname = isset($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_lname']) ? $attendee_data['ATT_lname'] : '';
960
+		$ATT_email = isset($attendee_data['ATT_email']) && ! empty($attendee_data['ATT_email']) ? $attendee_data['ATT_email'] : '';
962 961
 		// but only if those have values
963
-		if ( $ATT_fname && $ATT_lname && $ATT_email ) {
964
-			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( array(
962
+		if ($ATT_fname && $ATT_lname && $ATT_email) {
963
+			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(array(
965 964
 				'ATT_fname' => $ATT_fname,
966 965
 				'ATT_lname' => $ATT_lname,
967 966
 				'ATT_email' => $ATT_email
@@ -969,7 +968,7 @@  discard block
 block discarded – undo
969 968
 		} else {
970 969
 			$existing_attendee = NULL;
971 970
 		}
972
-		return apply_filters( 'FHEE_EE_Single_Page_Checkout__save_registration_items__find_existing_attendee', $existing_attendee, $registration, $attendee_data );
971
+		return apply_filters('FHEE_EE_Single_Page_Checkout__save_registration_items__find_existing_attendee', $existing_attendee, $registration, $attendee_data);
973 972
 	}
974 973
 
975 974
 
@@ -981,13 +980,13 @@  discard block
 block discarded – undo
981 980
 	 * @param array           $attendee_data
982 981
 	 * @return \EE_Attendee
983 982
 	 */
984
-	private function _update_existing_attendee_data( EE_Attendee $existing_attendee, $attendee_data = array() ) {
983
+	private function _update_existing_attendee_data(EE_Attendee $existing_attendee, $attendee_data = array()) {
985 984
 		// first remove fname, lname, and email from attendee data
986
-		$dont_set = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
985
+		$dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
987 986
 		// now loop thru what's left and add to attendee CPT
988
-		foreach ( $attendee_data as $property_name => $property_value ) {
989
-			if ( ! in_array( $property_name, $dont_set ) && EEM_Attendee::instance()->has_field( $property_name )) {
990
-				$existing_attendee->set( $property_name, $property_value );
987
+		foreach ($attendee_data as $property_name => $property_value) {
988
+			if ( ! in_array($property_name, $dont_set) && EEM_Attendee::instance()->has_field($property_name)) {
989
+				$existing_attendee->set($property_name, $property_value);
991 990
 			}
992 991
 		}
993 992
 		// better save that now
@@ -1004,11 +1003,11 @@  discard block
 block discarded – undo
1004 1003
 	 * @param EE_Attendee     $attendee
1005 1004
 	 * @return void
1006 1005
 	 */
1007
-	private function _associate_attendee_with_registration( EE_Registration $registration, EE_Attendee $attendee ) {
1006
+	private function _associate_attendee_with_registration(EE_Registration $registration, EE_Attendee $attendee) {
1008 1007
 		// add relation to attendee
1009
-		$registration->_add_relation_to( $attendee, 'Attendee' );
1010
-		$registration->set_attendee_id( $attendee->ID() );
1011
-		$registration->update_cache_after_object_save( 'Attendee', $attendee );
1008
+		$registration->_add_relation_to($attendee, 'Attendee');
1009
+		$registration->set_attendee_id($attendee->ID());
1010
+		$registration->update_cache_after_object_save('Attendee', $attendee);
1012 1011
 	}
1013 1012
 
1014 1013
 
@@ -1019,10 +1018,10 @@  discard block
 block discarded – undo
1019 1018
 	 * @param EE_Registration $registration
1020 1019
 	 * @return void
1021 1020
 	 */
1022
-	private function _associate_registration_with_transaction( EE_Registration $registration ) {
1021
+	private function _associate_registration_with_transaction(EE_Registration $registration) {
1023 1022
 		// add relation to attendee
1024
-		$this->checkout->transaction->_add_relation_to( $registration, 'Registration' );
1025
-		$this->checkout->transaction->update_cache_after_object_save( 'Registration', $registration );
1023
+		$this->checkout->transaction->_add_relation_to($registration, 'Registration');
1024
+		$this->checkout->transaction->update_cache_after_object_save('Registration', $registration);
1026 1025
 	}
1027 1026
 
1028 1027
 
@@ -1034,17 +1033,17 @@  discard block
 block discarded – undo
1034 1033
 	 * @param array $attendee_data
1035 1034
 	 * @return array
1036 1035
 	 */
1037
-	private function _copy_critical_attendee_details_from_primary_registrant( $attendee_data = array() ) {
1036
+	private function _copy_critical_attendee_details_from_primary_registrant($attendee_data = array()) {
1038 1037
 		// bare minimum critical details include first name, last name, email address
1039
-		$critical_attendee_details = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
1038
+		$critical_attendee_details = array('ATT_fname', 'ATT_lname', 'ATT_email');
1040 1039
 		// add address info to critical details?
1041
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information__merge_address_details_with_critical_attendee_details', FALSE )) {
1042
-			$address_details = array( 'ATT_address', 'ATT_address2', 'ATT_city', 'STA_ID', 'CNT_ISO', 'ATT_zip', 'ATT_phone' );
1043
-			$critical_attendee_details = array_merge( $critical_attendee_details, $address_details );
1040
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information__merge_address_details_with_critical_attendee_details', FALSE)) {
1041
+			$address_details = array('ATT_address', 'ATT_address2', 'ATT_city', 'STA_ID', 'CNT_ISO', 'ATT_zip', 'ATT_phone');
1042
+			$critical_attendee_details = array_merge($critical_attendee_details, $address_details);
1044 1043
 		}
1045
-		foreach ( $critical_attendee_details as $critical_attendee_detail ) {
1046
-			if ( ! isset( $attendee_data[ $critical_attendee_detail ] ) || empty( $attendee_data[ $critical_attendee_detail ] )) {
1047
-				$attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get( $critical_attendee_detail );
1044
+		foreach ($critical_attendee_details as $critical_attendee_detail) {
1045
+			if ( ! isset($attendee_data[$critical_attendee_detail]) || empty($attendee_data[$critical_attendee_detail])) {
1046
+				$attendee_data[$critical_attendee_detail] = $this->checkout->primary_attendee_obj->get($critical_attendee_detail);
1048 1047
 			}
1049 1048
 		}
1050 1049
 		return $attendee_data;
@@ -1059,11 +1058,11 @@  discard block
 block discarded – undo
1059 1058
 	 * @param array           $attendee_data
1060 1059
 	 * @return \EE_Attendee
1061 1060
 	 */
1062
-	private function _create_new_attendee( EE_Registration $registration, $attendee_data = array() ) {
1061
+	private function _create_new_attendee(EE_Registration $registration, $attendee_data = array()) {
1063 1062
 		// create new attendee object
1064
-		$new_attendee = EE_Attendee::new_instance( $attendee_data );
1063
+		$new_attendee = EE_Attendee::new_instance($attendee_data);
1065 1064
 		// set author to event creator
1066
-		$new_attendee->set( 'ATT_author', $registration->event()->wp_user() );
1065
+		$new_attendee->set('ATT_author', $registration->event()->wp_user());
1067 1066
 		$new_attendee->save();
1068 1067
 		return $new_attendee;
1069 1068
 	}
@@ -1079,7 +1078,7 @@  discard block
 block discarded – undo
1079 1078
 	 */
1080 1079
 	public function update_reg_step() {
1081 1080
 		// save everything
1082
-		if ( $this->process_reg_step() ) {
1081
+		if ($this->process_reg_step()) {
1083 1082
 			$this->checkout->redirect = TRUE;
1084 1083
 			$this->checkout->redirect_url = add_query_arg(
1085 1084
 				array(
@@ -1088,7 +1087,7 @@  discard block
 block discarded – undo
1088 1087
 				),
1089 1088
 				$this->checkout->thank_you_page_url
1090 1089
 			);
1091
-			$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1090
+			$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1092 1091
 			return TRUE;
1093 1092
 		}
1094 1093
 		return FALSE;
Please login to merge, or discard this patch.
finalize_registration/EE_SPCO_Reg_Step_Finalize_Registration.class.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 
44 44
 	/**
45
-	 * @return boolean
45
+	 * @return boolean|null
46 46
 	 */
47 47
 	public function initialize_reg_step() {
48 48
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
 
171 171
 	/**
172
-	 * @return boolean
172
+	 * @return boolean|null
173 173
 	 */
174 174
 	public function update_reg_step() {
175 175
 		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 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_Finalize_Registration
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_Finalize_Registration
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_Finalize_Registration extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param    EE_Checkout $checkout
21 21
 	 * @return 	\EE_SPCO_Reg_Step_Finalize_Registration
22 22
 	 */
23
-	public function __construct( EE_Checkout $checkout ) {
23
+	public function __construct(EE_Checkout $checkout) {
24 24
 		$this->_slug = 'finalize_registration';
25 25
 		$this->_name = __('Finalize Registration', 'event_espresso');
26 26
 		$this->_submit_button_text = $this->_name;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	public function initialize_reg_step() {
48 48
 
49 49
 		// there's actually no reg form to process if this is the final step
50
-		if ( $this->is_current_step() ) {
50
+		if ($this->is_current_step()) {
51 51
 			$this->checkout->step = $_REQUEST['step'] = $this->slug();
52
-			$this->checkout->action = $_REQUEST[ 'action' ] = 'process_reg_step';
52
+			$this->checkout->action = $_REQUEST['action'] = 'process_reg_step';
53 53
 			$this->checkout->generate_reg_form = false;
54 54
 		}
55 55
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function process_reg_step() {
74 74
 		// ensure all data gets refreshed from the db
75
-		$this->checkout->refresh_all_entities( true );
75
+		$this->checkout->refresh_all_entities(true);
76 76
 		// ensures that all details and statuses for transaction, registration, and payments are updated
77 77
 		$txn_update_params = $this->_finalize_transaction();
78 78
 		// DEBUG LOG
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
 		//	)
87 87
 		//);
88 88
 		// set a hook point
89
-		do_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params );
89
+		do_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', $this->checkout, $txn_update_params);
90 90
 		// check if transaction has a primary registrant and that it has a related Attendee object
91
-		if ( $this->checkout->transaction_has_primary_registrant() ) {
91
+		if ($this->checkout->transaction_has_primary_registrant()) {
92 92
 			// setup URL for redirect
93 93
 			$this->checkout->redirect_url = add_query_arg(
94
-				array( 'e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link() ),
94
+				array('e_reg_url_link' => $this->checkout->transaction->primary_registration()->reg_url_link()),
95 95
 				$this->checkout->thank_you_page_url
96 96
 			);
97 97
 		} else {
98
-			EE_Error::add_error( __( 'A valid Primary Registration for this Transaction could not be found.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
98
+			EE_Error::add_error(__('A valid Primary Registration for this Transaction could not be found.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
99 99
 			$this->checkout->redirect = false;
100 100
 			$this->checkout->continue_reg = false;
101 101
 			return false;
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 		// you don't have to go home but you can't stay here !
104 104
 		$this->checkout->redirect = true;
105 105
 		$this->checkout->continue_reg = true;
106
-		$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
107
-		if ( ! ( $this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site() ) ) {
106
+		$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
107
+		if ( ! ($this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site())) {
108 108
 			// mark this reg step as completed
109 109
 			$this->checkout->current_step->set_completed();
110 110
 		}
@@ -121,43 +121,43 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	protected function _finalize_transaction() {
123 123
 		/** @type EE_Transaction_Processor $transaction_processor */
124
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
124
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
125 125
 		//set revisit flag in txn processor
126
-		$transaction_processor->set_revisit( $this->checkout->revisit );
126
+		$transaction_processor->set_revisit($this->checkout->revisit);
127 127
 		// at this point we'll consider a TXN to not have been abandoned
128
-		$transaction_processor->toggle_abandoned_transaction_status( $this->checkout->transaction );
129
-		if ( $this->checkout->cart instanceof EE_Cart ) {
128
+		$transaction_processor->toggle_abandoned_transaction_status($this->checkout->transaction);
129
+		if ($this->checkout->cart instanceof EE_Cart) {
130 130
 			// save TXN data to the cart
131
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() );
131
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID());
132 132
 		}
133 133
 		/** @type EE_Transaction_Payments $transaction_payments */
134
-		$transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' );
134
+		$transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
135 135
 		// maybe update status, but don't save transaction just yet
136
-		$transaction_payments->update_transaction_status_based_on_total_paid( $this->checkout->transaction, false );
136
+		$transaction_payments->update_transaction_status_based_on_total_paid($this->checkout->transaction, false);
137 137
 		// If the selected method of payment used an off-site gateway...
138
-		if ( $this->checkout->payment_method instanceof EE_Payment_Method ) {
139
-			$is_revisit = filter_var( $this->checkout->revisit, FILTER_VALIDATE_BOOLEAN );
140
-			if ( $this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site() ) {
141
-				$gateway= $this->checkout->payment_method->type_obj()->get_gateway();
142
-				if ( $gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request() ) {
138
+		if ($this->checkout->payment_method instanceof EE_Payment_Method) {
139
+			$is_revisit = filter_var($this->checkout->revisit, FILTER_VALIDATE_BOOLEAN);
140
+			if ($this->checkout->payment_method instanceof EE_Payment_Method && $this->checkout->payment_method->is_off_site()) {
141
+				$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
142
+				if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) {
143 143
 					// do NOT trigger notifications because it was already done during the IPN
144
-					remove_all_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications' );
145
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 );
146
-				} else if ( ! $is_revisit ) {
147
-					add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
144
+					remove_all_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications');
145
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15);
146
+				} else if ( ! $is_revisit) {
147
+					add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
148 148
 				}
149 149
 			} else if (
150 150
 				// if SPCO revisit and TXN status has changed due to a payment
151
-				$is_revisit && ( $this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated() )
151
+				$is_revisit && ($this->checkout->txn_status_updated || $this->checkout->any_reg_status_updated())
152 152
 			) {
153 153
 				// send out notifications
154
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
155
-			} else if ( ! $is_revisit ) {
156
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
154
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
155
+			} else if ( ! $is_revisit) {
156
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
157 157
 			}
158 158
 		}
159 159
 		// this will result in the base session properties getting saved to the TXN_Session_data field
160
-		$this->checkout->transaction->set_txn_session_data( EE_Registry::instance()->SSN->get_session_data( null, true ));
160
+		$this->checkout->transaction->set_txn_session_data(EE_Registry::instance()->SSN->get_session_data(null, true));
161 161
 
162 162
 		// update the TXN if payment conditions have changed
163 163
 		return $transaction_processor->update_transaction_and_registrations_after_checkout_or_payment(
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * @return boolean
175 175
 	 */
176 176
 	public function update_reg_step() {
177
-		EE_Error::doing_it_wrong( __CLASS__ . '::' . __FILE__, __( 'Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0' );
177
+		EE_Error::doing_it_wrong(__CLASS__.'::'.__FILE__, __('Can not call update_reg_step() on the Finalize Registration reg step.', 'event_espresso'), '4.6.0');
178 178
 	 }
179 179
 
180 180
 
Please login to merge, or discard this patch.
reg_steps/payment_options/EE_SPCO_Reg_Step_Payment_Options.class.php 4 patches
Doc Comments   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 
105 105
 	/**
106
-	 * @return null
106
+	 * @return EE_Line_Item_Display
107 107
 	 */
108 108
 	public function line_item_display() {
109 109
 		return $this->line_item_display;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 
114 114
 	/**
115
-	 * @param null $line_item_display
115
+	 * @param EE_Line_Item_Display $line_item_display
116 116
 	 */
117 117
 	public function set_line_item_display( $line_item_display ) {
118 118
 		$this->line_item_display = $line_item_display;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 
180 180
 	/**
181
-	 * @return bool
181
+	 * @return EE_Form_Section_Proper
182 182
 	 */
183 183
 	public function generate_reg_form() {
184 184
 		EE_Registry::instance()->load_helper( 'HTML' );
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 	 * get_billing_form_html_for_payment_method
731 731
 	 *
732 732
 	 * @access public
733
-	 * @return string
733
+	 * @return boolean
734 734
 	 */
735 735
 	public function get_billing_form_html_for_payment_method() {
736 736
 		// how have they chosen to pay?
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 	 * switch_payment_method
851 851
 	 *
852 852
 	 * @access public
853
-	 * @return string
853
+	 * @return boolean
854 854
 	 */
855 855
 	public function switch_payment_method() {
856 856
 		if ( ! $this->_verify_payment_method_is_set() ) {
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 
1016 1016
 	/**
1017 1017
 	 * process_reg_step
1018
-	 * @return boolean
1018
+	 * @return null|boolean
1019 1019
 	 */
1020 1020
 	public function process_reg_step() {
1021 1021
 		// how have they chosen to pay?
@@ -1091,7 +1091,7 @@  discard block
 block discarded – undo
1091 1091
 	 *    update_reg_step
1092 1092
 	 *    this is the final step after a user  revisits the site to retry a payment
1093 1093
 	 *
1094
-	 * @return boolean
1094
+	 * @return null|boolean
1095 1095
 	 */
1096 1096
 	public function update_reg_step() {
1097 1097
 		$success = TRUE;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 	 *
1374 1374
 	 * 	@access 	private
1375 1375
 	 * 	@type 	EE_Payment_Method $payment_method
1376
-	 * 	@return 	mixed	EE_Payment | boolean
1376
+	 * 	@return 	EE_Payment|null	EE_Payment | boolean
1377 1377
 	 */
1378 1378
 	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1379 1379
 		$payment =NULL;
@@ -1570,6 +1570,7 @@  discard block
 block discarded – undo
1570 1570
 	 * @access private
1571 1571
 	 * @type    EE_Payment $payment
1572 1572
 	 * @param string $payment_occurs
1573
+	 * @param EE_Payment|null $payment
1573 1574
 	 * @return bool
1574 1575
 	 * @throws \EE_Error
1575 1576
 	 */
@@ -1675,7 +1676,7 @@  discard block
 block discarded – undo
1675 1676
 	 * 		or present the payment options again
1676 1677
 	 *
1677 1678
 	 * @access private
1678
-	 * @return EE_Payment | FALSE
1679
+	 * @return boolean | FALSE
1679 1680
 	 */
1680 1681
 	public function process_gateway_response() {
1681 1682
 		$payment = null;
@@ -1733,7 +1734,7 @@  discard block
 block discarded – undo
1733 1734
 	 * _validate_return
1734 1735
 	 *
1735 1736
 	 * @access private
1736
-	 * @return bool
1737
+	 * @return boolean|null
1737 1738
 	 */
1738 1739
 	private function _validate_offsite_return() {
1739 1740
 		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
@@ -1800,7 +1801,7 @@  discard block
 block discarded – undo
1800 1801
 	 *
1801 1802
 	 * @access private
1802 1803
 	 * @param \EE_Registration $primary_registrant
1803
-	 * @return bool
1804
+	 * @return false|null
1804 1805
 	 */
1805 1806
 	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
1806 1807
 		if ( ! $primary_registrant instanceof EE_Registration ) {
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 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_Payment_Options
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_Payment_Options
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_Payment_Options extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
@@ -740,13 +740,13 @@  discard block
 block discarded – undo
740 740
 			return FALSE;
741 741
 		}
742 742
 		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
743
-            EE_Error::add_success(
744
-                apply_filters(
745
-                    'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
746
-                    sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
747
-                )
748
-            );
749
-        }
743
+			EE_Error::add_success(
744
+				apply_filters(
745
+					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
746
+					sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
747
+				)
748
+			);
749
+		}
750 750
 		// now generate billing form for selected method of payment
751 751
 		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method, FALSE );
752 752
 		// fill form with attendee info if applicable
@@ -778,14 +778,14 @@  discard block
 block discarded – undo
778 778
 		$billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction, array( 'amount_owing' => $this->checkout->amount_owing ) );
779 779
 		if ( $billing_form instanceof EE_Billing_Info_Form ) {
780 780
 			if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) {
781
-                if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
782
-                    EE_Error::add_success(
783
-                        apply_filters(
784
-                            'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
785
-                            sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
786
-                        )
787
-                    );
788
-                }
781
+				if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
782
+					EE_Error::add_success(
783
+						apply_filters(
784
+							'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
785
+							sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
786
+						)
787
+					);
788
+				}
789 789
 			}
790 790
 			return apply_filters(
791 791
 				'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form',
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1214,9 +1214,9 @@
 block discarded – undo
1214 1214
 						$form_section = $validation_error->get_form_section();
1215 1215
 						if( $form_section instanceof EE_Form_Input_Base ){
1216 1216
 							$label = $form_section->html_label_text();
1217
-						}elseif( $form_section instanceof EE_Form_Section_Base ){
1217
+						} elseif( $form_section instanceof EE_Form_Section_Base ){
1218 1218
 							$label = $form_section->name();
1219
-						}else{
1219
+						} else{
1220 1220
 							$label = __( 'Validation Error', 'event_espresso' );
1221 1221
 						}
1222 1222
 						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() );
Please login to merge, or discard this patch.
Spacing   +368 added lines, -368 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 	 *  @return 	void
29 29
 	 */
30 30
 	public static function set_hooks() {
31
-		add_filter( 'FHEE__SPCO__EE_Line_Item_Filter_Collection', array( 'EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters' ) );
32
-		add_action( 'wp_ajax_switch_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ));
33
-		add_action( 'wp_ajax_nopriv_switch_spco_billing_form', array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' ));
34
-		add_action( 'wp_ajax_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ));
35
-		add_action( 'wp_ajax_nopriv_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ));
36
-		add_action( 'wp_ajax_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' ) );
37
-		add_action( 'wp_ajax_nopriv_get_transaction_details_for_gateways', array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
31
+		add_filter('FHEE__SPCO__EE_Line_Item_Filter_Collection', array('EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters'));
32
+		add_action('wp_ajax_switch_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form'));
33
+		add_action('wp_ajax_nopriv_switch_spco_billing_form', array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form'));
34
+		add_action('wp_ajax_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
35
+		add_action('wp_ajax_nopriv_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
36
+		add_action('wp_ajax_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details'));
37
+		add_action('wp_ajax_nopriv_get_transaction_details_for_gateways', array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
38 38
 		);
39
-		add_filter( 'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ), 10, 1 );
39
+		add_filter('FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array', array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'), 10, 1);
40 40
 	}
41 41
 
42 42
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * 	ajax switch_spco_billing_form
46 46
 	 */
47 47
 	public static function switch_spco_billing_form() {
48
-		EED_Single_Page_Checkout::process_ajax_request( 'switch_payment_method' );
48
+		EED_Single_Page_Checkout::process_ajax_request('switch_payment_method');
49 49
 	}
50 50
 
51 51
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * 	ajax save_payer_details
55 55
 	 */
56 56
 	public static function save_payer_details() {
57
-		EED_Single_Page_Checkout::process_ajax_request( 'save_payer_details_via_ajax' );
57
+		EED_Single_Page_Checkout::process_ajax_request('save_payer_details_via_ajax');
58 58
 	}
59 59
 
60 60
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * 	ajax get_transaction_details
64 64
 	 */
65 65
 	public static function get_transaction_details() {
66
-		EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' );
66
+		EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways');
67 67
 	}
68 68
 
69 69
 
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 	 * @param    EE_Checkout $checkout
92 92
 	 * @return    \EE_SPCO_Reg_Step_Payment_Options
93 93
 	 */
94
-	public function __construct( EE_Checkout $checkout ) {
94
+	public function __construct(EE_Checkout $checkout) {
95 95
 		$this->_slug = 'payment_options';
96 96
 		$this->_name = __('Payment Options', 'event_espresso');
97
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'payment_options_main.template.php';
97
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'payment_options_main.template.php';
98 98
 		$this->checkout = $checkout;
99 99
 		$this->_reset_success_message();
100
-		$this->set_instructions( __('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso'));
100
+		$this->set_instructions(__('Please select a method of payment and provide any necessary billing information before proceeding.', 'event_espresso'));
101 101
 	}
102 102
 
103 103
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	/**
115 115
 	 * @param null $line_item_display
116 116
 	 */
117
-	public function set_line_item_display( $line_item_display ) {
117
+	public function set_line_item_display($line_item_display) {
118 118
 		$this->line_item_display = $line_item_display;
119 119
 	}
120 120
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	 * @return void
126 126
 	 */
127 127
 	public function translate_js_strings() {
128
-		EE_Registry::$i18n_js_strings['no_payment_method'] = __( 'Please select a method of payment in order to continue.', 'event_espresso' );
129
-		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso' );
130
-		EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __( 'Forwarding to Secure Payment Provider.', 'event_espresso' );
128
+		EE_Registry::$i18n_js_strings['no_payment_method'] = __('Please select a method of payment in order to continue.', 'event_espresso');
129
+		EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('A valid method of payment could not be determined. Please refresh the page and try again.', 'event_espresso');
130
+		EE_Registry::$i18n_js_strings['forwarding_to_offsite'] = __('Forwarding to Secure Payment Provider.', 'event_espresso');
131 131
 	}
132 132
 
133 133
 
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 			// 	$ 0.00 transactions (no payment required)
157 157
 			! $this->checkout->payment_required()
158 158
 			// but do NOT remove if current action being called belongs to this reg step
159
-			&& ! is_callable( array( $this, $this->checkout->action ) )
159
+			&& ! is_callable(array($this, $this->checkout->action))
160 160
 			&& ! $this->completed()
161 161
 		) {
162 162
 				// and if so, then we no longer need the Payment Options step
163
-				$this->checkout->remove_reg_step( $this->_slug );
163
+				$this->checkout->remove_reg_step($this->_slug);
164 164
 				$this->checkout->reset_reg_steps();
165
-				if ( $this->is_current_step() ) {
165
+				if ($this->is_current_step()) {
166 166
 					$this->checkout->generate_reg_form = false;
167 167
 				}
168 168
 				// DEBUG LOG
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 				return;
171 171
 		}
172 172
 		// load EEM_Payment_Method
173
-		EE_Registry::instance()->load_model( 'Payment_Method' );
173
+		EE_Registry::instance()->load_model('Payment_Method');
174 174
 		// get all active payment methods
175
-		$this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction( $this->checkout->transaction, EEM_Payment_Method::scope_cart );
175
+		$this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction($this->checkout->transaction, EEM_Payment_Method::scope_cart);
176 176
 	}
177 177
 
178 178
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 * @return bool
182 182
 	 */
183 183
 	public function generate_reg_form() {
184
-		EE_Registry::instance()->load_helper( 'HTML' );
184
+		EE_Registry::instance()->load_helper('HTML');
185 185
 		// reset in case someone changes their mind
186 186
 		$this->_reset_selected_method_of_payment();
187 187
 		// set some defaults
@@ -192,16 +192,16 @@  discard block
 block discarded – undo
192 192
 		$sold_out_events = array();
193 193
 		$reg_count = 0;
194 194
 		// loop thru registrations to gather info
195
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
196
-		foreach ( $registrations as $registration ) {
195
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
196
+		foreach ($registrations as $registration) {
197 197
 			//echo '<h3 style="color:#E76700;line-height:1em;">' . $registration->ID() . '<br/><span style="font-size:9px;font-weight:normal;color:#666">' . __FILE__ . '</span>    <b style="font-size:10px;color:#333">  ' . __LINE__ . ' </b></h3>';
198 198
 			/** @var $registration EE_Registration */
199 199
 			$reg_count++;
200 200
 			// if returning registrant is Approved then do NOT do this
201
-			if ( ! ( $this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved )) {
202
-				if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true )) {
201
+			if ( ! ($this->checkout->revisit && $registration->status_ID() == EEM_Registration::status_id_approved)) {
202
+				if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) {
203 203
 					// add event to list of events that are sold out
204
-					$sold_out_events[ $registration->event()->ID() ] = $registration->event();
204
+					$sold_out_events[$registration->event()->ID()] = $registration->event();
205 205
 					do_action(
206 206
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event',
207 207
 						$registration->event(),
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
 					);
210 210
 				}
211 211
 				// event requires admin approval
212
-				if ( $registration->status_ID() == EEM_Registration::status_id_not_approved ) {
212
+				if ($registration->status_ID() == EEM_Registration::status_id_not_approved) {
213 213
 					// add event to list of events with pre-approval reg status
214
-					$registrations_requiring_pre_approval[ $registration->ID() ] = $registration;
214
+					$registrations_requiring_pre_approval[$registration->ID()] = $registration;
215 215
 					do_action(
216 216
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval',
217 217
 						$registration->event(),
@@ -220,29 +220,29 @@  discard block
 block discarded – undo
220 220
 				}
221 221
 			}
222 222
 			// are they allowed to pay now and is there monies owing?
223
-			if ( $registration->owes_monies_and_can_pay() ) {
224
-				$registrations_requiring_payment[ $registration->ID() ] = $registration;
223
+			if ($registration->owes_monies_and_can_pay()) {
224
+				$registrations_requiring_payment[$registration->ID()] = $registration;
225 225
 				do_action(
226 226
 					'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment',
227 227
 					$registration->event(),
228 228
 					$this
229 229
 				);
230
-			} else if ( ! $this->checkout->revisit && $registration->status_ID() != EEM_Registration::status_id_not_approved && $registration->ticket()->is_free()  ) {
231
-				$registrations_for_free_events[ $registration->event()->ID() ] = $registration;
230
+			} else if ( ! $this->checkout->revisit && $registration->status_ID() != EEM_Registration::status_id_not_approved && $registration->ticket()->is_free()) {
231
+				$registrations_for_free_events[$registration->event()->ID()] = $registration;
232 232
 			}
233 233
 		}
234 234
 		$subsections = array();
235 235
 		// now decide which template to load
236
-		if ( ! empty( $sold_out_events )) {
237
-			$subsections['sold_out_events'] = $this->_sold_out_events( $sold_out_events );
236
+		if ( ! empty($sold_out_events)) {
237
+			$subsections['sold_out_events'] = $this->_sold_out_events($sold_out_events);
238 238
 		}
239
-		if ( ! empty( $registrations_requiring_pre_approval )) {
240
-			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval( $registrations_requiring_pre_approval );
239
+		if ( ! empty($registrations_requiring_pre_approval)) {
240
+			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval($registrations_requiring_pre_approval);
241 241
 		}
242
-		if ( ! empty( $registrations_for_free_events ) ) {
243
-			$subsections[ 'no_payment_required' ] = $this->_no_payment_required( $registrations_for_free_events );
242
+		if ( ! empty($registrations_for_free_events)) {
243
+			$subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events);
244 244
 		}
245
-		if ( ! empty( $registrations_requiring_payment ) ) {
245
+		if ( ! empty($registrations_requiring_payment)) {
246 246
 			//EEH_Debug_Tools::printr( $registrations_requiring_payment, '$registrations_requiring_payment', __FILE__, __LINE__ );
247 247
 			// autoload Line_Item_Display classes
248 248
 			EEH_Autoloader::register_line_item_filter_autoloaders();
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 			//EEH_Debug_Tools::printr( $filtered_line_item_tree->total(), '$filtered_line_item_tree->total()', __FILE__, __LINE__ );
260 260
 			$this->checkout->amount_owing = $filtered_line_item_tree->total();
261 261
 
262
-			if ( $this->checkout->amount_owing > 0 ) {
262
+			if ($this->checkout->amount_owing > 0) {
263 263
 				EEH_Autoloader::register_line_item_display_autoloaders();
264
-				$this->set_line_item_display( new EE_Line_Item_Display( 'spco' ) );
265
-				$subsections[ 'payment_options' ] = $this->_display_payment_options(
266
-					$this->line_item_display->display_line_item( $filtered_line_item_tree )
264
+				$this->set_line_item_display(new EE_Line_Item_Display('spco'));
265
+				$subsections['payment_options'] = $this->_display_payment_options(
266
+					$this->line_item_display->display_line_item($filtered_line_item_tree)
267 267
 				);
268 268
 				$this->_apply_transaction_payments_to_amount_owing();
269 269
 			}
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	 * @param \EE_Line_Item_Filter_Collection $line_item_filter_collection
299 299
 	 * @return \EE_Line_Item_Filter_Collection
300 300
 	 */
301
-	public static function add_spco_line_item_filters( EE_Line_Item_Filter_Collection $line_item_filter_collection ) {
301
+	public static function add_spco_line_item_filters(EE_Line_Item_Filter_Collection $line_item_filter_collection) {
302 302
 		$line_item_filter_collection->add(
303 303
 			new EE_Billable_Line_Item_Filter(
304 304
 				EE_Registry::instance()->SSN->checkout()->transaction->registrations(
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 				)
307 307
 			)
308 308
 		);
309
-		$line_item_filter_collection->add( new EE_Non_Zero_Line_Item_Filter() );
309
+		$line_item_filter_collection->add(new EE_Non_Zero_Line_Item_Filter());
310 310
 		return $line_item_filter_collection;
311 311
 	}
312 312
 
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 	 * @return void
321 321
 	 */
322 322
 	protected function _hide_reg_step_submit_button_if_revisit() {
323
-		if ( $this->checkout->revisit ) {
324
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string' );
323
+		if ($this->checkout->revisit) {
324
+			add_filter('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string');
325 325
 		}
326 326
 	}
327 327
 
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
 	 * @param \EE_Event[] $sold_out_events_array
333 333
 	 * @return \EE_Form_Section_Proper
334 334
 	 */
335
-	private function _sold_out_events( $sold_out_events_array = array() ) {
335
+	private function _sold_out_events($sold_out_events_array = array()) {
336 336
 		// set some defaults
337 337
 		$this->checkout->selected_method_of_payment = 'events_sold_out';
338 338
 		$sold_out_events = '';
339
-		foreach ( $sold_out_events_array as $sold_out_event ) {
340
-			$sold_out_events .= EEH_HTML::li( EEH_HTML::span( $sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' ));
339
+		foreach ($sold_out_events_array as $sold_out_event) {
340
+			$sold_out_events .= EEH_HTML::li(EEH_HTML::span($sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text'));
341 341
 		}
342 342
 		return new EE_Form_Section_Proper(
343 343
 			array(
@@ -349,14 +349,14 @@  discard block
 block discarded – undo
349 349
 				),
350 350
 				'layout_strategy'		=> new EE_Template_Layout(
351 351
 					array(
352
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'sold_out_events.template.php', // layout_template
352
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'sold_out_events.template.php', // layout_template
353 353
 						'template_args'  				=> apply_filters(
354 354
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
355 355
 							array(
356 356
 								'sold_out_events' 			=> $sold_out_events,
357 357
 								'sold_out_events_msg' 	=> apply_filters(
358 358
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__sold_out_events_msg',
359
-									__( 'It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso' )
359
+									__('It appears that the event you were about to make a payment for has sold out since you first registered. If you have already made a partial payment towards this event, please contact the event administrator for a refund.', 'event_espresso')
360 360
 								)
361 361
 							)
362 362
 						)
@@ -373,14 +373,14 @@  discard block
 block discarded – undo
373 373
 	 * @param array $registrations_requiring_pre_approval
374 374
 	 * @return \EE_Form_Section_Proper
375 375
 	 */
376
-	private function _registrations_requiring_pre_approval( $registrations_requiring_pre_approval = array()) {
376
+	private function _registrations_requiring_pre_approval($registrations_requiring_pre_approval = array()) {
377 377
 		$events_requiring_pre_approval = '';
378
-		foreach ( $registrations_requiring_pre_approval as $registration ) {
379
-			if ( $registration instanceof EE_Registration && $registration->event() instanceof EE_Event ) {
380
-				$events_requiring_pre_approval[ $registration->event()->ID() ] = EEH_HTML::li(
381
-					EEH_HTML::span( '', '', 'dashicons dashicons-marker ee-icon-size-16 orange-text'
378
+		foreach ($registrations_requiring_pre_approval as $registration) {
379
+			if ($registration instanceof EE_Registration && $registration->event() instanceof EE_Event) {
380
+				$events_requiring_pre_approval[$registration->event()->ID()] = EEH_HTML::li(
381
+					EEH_HTML::span('', '', 'dashicons dashicons-marker ee-icon-size-16 orange-text'
382 382
 					)
383
-					. EEH_HTML::span( $registration->event()->name(), '', 'orange-text' )
383
+					. EEH_HTML::span($registration->event()->name(), '', 'orange-text')
384 384
 				);
385 385
 			}
386 386
 		}
@@ -392,14 +392,14 @@  discard block
 block discarded – undo
392 392
 				),
393 393
 				'layout_strategy'		=> new EE_Template_Layout(
394 394
 					array(
395
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'events_requiring_pre_approval.template.php', // layout_template
395
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'events_requiring_pre_approval.template.php', // layout_template
396 396
 						'template_args'  				=> apply_filters(
397 397
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
398 398
 							array(
399
-								'events_requiring_pre_approval' 			=> implode( '', $events_requiring_pre_approval ),
399
+								'events_requiring_pre_approval' 			=> implode('', $events_requiring_pre_approval),
400 400
 								'events_requiring_pre_approval_msg' 	=> apply_filters(
401 401
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg',
402
-									__( 'The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso' )
402
+									__('The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso')
403 403
 								)
404 404
 							)
405 405
 						),
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 * @param \EE_Event[] $registrations_for_free_events
418 418
 	 * @return \EE_Form_Section_Proper
419 419
 	 */
420
-	private function _no_payment_required( $registrations_for_free_events = array() ) {
420
+	private function _no_payment_required($registrations_for_free_events = array()) {
421 421
 		// set some defaults
422 422
 		$this->checkout->selected_method_of_payment = 'no_payment_required';
423 423
 		// generate no_payment_required form
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 				),
430 430
 				'layout_strategy' 	=> new EE_Template_Layout(
431 431
 					array(
432
-						'layout_template_file' 	=> SPCO_REG_STEPS_PATH . $this->_slug . DS . 'no_payment_required.template.php', // layout_template
432
+						'layout_template_file' 	=> SPCO_REG_STEPS_PATH.$this->_slug.DS.'no_payment_required.template.php', // layout_template
433 433
 						'template_args'  				=> apply_filters(
434 434
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___no_payment_required__template_args',
435 435
 							array(
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 								'registrations' => array(),
438 438
 								'ticket_count' 	=> array(),
439 439
 								'registrations_for_free_events' 	=> $registrations_for_free_events,
440
-								'no_payment_required_msg' => EEH_HTML::p( __( 'This is a free event, so no billing will occur.', 'event_espresso' ))
440
+								'no_payment_required_msg' => EEH_HTML::p(__('This is a free event, so no billing will occur.', 'event_espresso'))
441 441
 							)
442 442
 						),
443 443
 					)
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	 * @param string $transaction_details
455 455
 	 * @return \EE_Form_Section_Proper
456 456
 	 */
457
-	private function _display_payment_options( $transaction_details = '' ) {
457
+	private function _display_payment_options($transaction_details = '') {
458 458
 		// has method_of_payment been set by no-js user?
459 459
 		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment();
460 460
 		// build payment options form
@@ -466,20 +466,20 @@  discard block
 block discarded – undo
466 466
 						'before_payment_options' => apply_filters(
467 467
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options',
468 468
 							new EE_Form_Section_Proper(
469
-								array( 'layout_strategy'	=> new EE_Div_Per_Section_Layout() )
469
+								array('layout_strategy'	=> new EE_Div_Per_Section_Layout())
470 470
 							)
471 471
 						),
472 472
 						'payment_options' => $this->_setup_payment_options(),
473 473
 						'after_payment_options' => apply_filters(
474 474
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__after_payment_options',
475 475
 							new EE_Form_Section_Proper(
476
-								array( 'layout_strategy'	=> new EE_Div_Per_Section_Layout() )
476
+								array('layout_strategy'	=> new EE_Div_Per_Section_Layout())
477 477
 							)
478 478
 						),
479 479
 						'default_hidden_inputs' => $this->reg_step_hidden_inputs(),
480
-						'extra_hidden_inputs' 	=> $this->_extra_hidden_inputs( FALSE )
480
+						'extra_hidden_inputs' 	=> $this->_extra_hidden_inputs(FALSE)
481 481
 					),
482
-					'layout_strategy'	=> new EE_Template_Layout( array(
482
+					'layout_strategy'	=> new EE_Template_Layout(array(
483 483
 							'layout_template_file' 	=> $this->_template,
484 484
 							'template_args'  				=> apply_filters(
485 485
 								'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__template_args',
@@ -503,11 +503,11 @@  discard block
 block discarded – undo
503 503
 	 * @param bool $no_payment_required
504 504
 	 * @return \EE_Form_Section_Proper
505 505
 	 */
506
-	private function _extra_hidden_inputs( $no_payment_required = TRUE ) {
506
+	private function _extra_hidden_inputs($no_payment_required = TRUE) {
507 507
 
508 508
 		return new EE_Form_Section_Proper(
509 509
 			array(
510
-				'html_id' 				=> 'ee-' . $this->slug() . '-extra-hidden-inputs',
510
+				'html_id' 				=> 'ee-'.$this->slug().'-extra-hidden-inputs',
511 511
 				'layout_strategy'	=> new EE_Div_Per_Section_Layout(),
512 512
 				'subsections' 		=> array(
513 513
 					'spco_no_payment_required' => new EE_Hidden_Input(
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 	 */
543 543
 	protected function _apply_transaction_payments_to_amount_owing() {
544 544
 		$payments = $this->checkout->transaction->approved_payments();
545
-		if ( ! empty( $payments ) ) {
546
-			foreach ( $payments as $payment ) {
547
-				if ( $payment instanceof EE_Payment ) {
545
+		if ( ! empty($payments)) {
546
+			foreach ($payments as $payment) {
547
+				if ($payment instanceof EE_Payment) {
548 548
 					$this->checkout->amount_owing -= $payment->amount();
549 549
 				}
550 550
 			}
@@ -560,9 +560,9 @@  discard block
 block discarded – undo
560 560
 	 * @param 	bool $force_reset
561 561
 	 * @return 	void
562 562
 	 */
563
-	private function _reset_selected_method_of_payment( $force_reset = FALSE ) {
564
-		$reset_payment_method = $force_reset ? TRUE : sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', FALSE ));
565
-		if ( $reset_payment_method ) {
563
+	private function _reset_selected_method_of_payment($force_reset = FALSE) {
564
+		$reset_payment_method = $force_reset ? TRUE : sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', FALSE));
565
+		if ($reset_payment_method) {
566 566
 			$this->checkout->selected_method_of_payment = NULL;
567 567
 			$this->checkout->payment_method = NULL;
568 568
 			$this->checkout->billing_form = NULL;
@@ -581,9 +581,9 @@  discard block
 block discarded – undo
581 581
 	 * @param string $selected_method_of_payment
582 582
 	 * 	@return 		EE_Billing_Info_Form
583 583
 	 */
584
-	private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) {
585
-		$selected_method_of_payment = ! empty( $selected_method_of_payment ) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment;
586
-		EE_Registry::instance()->SSN->set_session_data( array( 'selected_method_of_payment' => $selected_method_of_payment ));
584
+	private function _save_selected_method_of_payment($selected_method_of_payment = '') {
585
+		$selected_method_of_payment = ! empty($selected_method_of_payment) ? $selected_method_of_payment : $this->checkout->selected_method_of_payment;
586
+		EE_Registry::instance()->SSN->set_session_data(array('selected_method_of_payment' => $selected_method_of_payment));
587 587
 	}
588 588
 
589 589
 
@@ -596,40 +596,40 @@  discard block
 block discarded – undo
596 596
 		// load payment method classes
597 597
 		$this->checkout->available_payment_methods = $this->_get_available_payment_methods();
598 598
 		// switch up header depending on number of available payment methods
599
-		$payment_method_header = count( $this->checkout->available_payment_methods ) > 1
600
-			? apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Please Select Your Method of Payment', 'event_espresso' ))
601
-			: apply_filters( 'FHEE__registration_page_payment_options__method_of_payment_hdr', __( 'Method of Payment', 'event_espresso' ));
599
+		$payment_method_header = count($this->checkout->available_payment_methods) > 1
600
+			? apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Please Select Your Method of Payment', 'event_espresso'))
601
+			: apply_filters('FHEE__registration_page_payment_options__method_of_payment_hdr', __('Method of Payment', 'event_espresso'));
602 602
 		$available_payment_methods = array(
603 603
 			// display the "Payment Method" header
604 604
 			'payment_method_header' => new EE_Form_Section_HTML(
605
-				EEH_HTML::h4 ( $payment_method_header, 'method-of-payment-hdr' )
605
+				EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr')
606 606
 			)
607 607
 		);
608 608
 		// the list of actual payment methods ( invoice, paypal, etc ) in a  ( slug => HTML )  format
609 609
 		$available_payment_method_options = array();
610 610
 		$default_payment_method_option = array();
611 611
 		// additional instructions to be displayed and hidden below payment methods (adding a clearing div to start)
612
-		$payment_methods_billing_info = array( new EE_Form_Section_HTML( EEH_HTML::div ( '<br />', '', '', 'clear:both;' )));
612
+		$payment_methods_billing_info = array(new EE_Form_Section_HTML(EEH_HTML::div('<br />', '', '', 'clear:both;')));
613 613
 		// loop through payment methods
614
-		foreach( $this->checkout->available_payment_methods as $payment_method ) {
615
-			if ( $payment_method instanceof EE_Payment_Method ) {
616
-				$payment_method_button = EEH_HTML::img( $payment_method->button_url(), $payment_method->name(), 'spco-payment-method-' . $payment_method->slug() . '-btn-img', 'spco-payment-method-btn-img' );
614
+		foreach ($this->checkout->available_payment_methods as $payment_method) {
615
+			if ($payment_method instanceof EE_Payment_Method) {
616
+				$payment_method_button = EEH_HTML::img($payment_method->button_url(), $payment_method->name(), 'spco-payment-method-'.$payment_method->slug().'-btn-img', 'spco-payment-method-btn-img');
617 617
 				// check if any payment methods are set as default
618 618
 				// if payment method is already selected OR nothing is selected and this payment method should be open_by_default
619
-				if (( $this->checkout->selected_method_of_payment == $payment_method->slug() ) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() )) {
619
+				if (($this->checkout->selected_method_of_payment == $payment_method->slug()) || ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default())) {
620 620
 					$this->checkout->selected_method_of_payment = $payment_method->slug();
621 621
 					$this->_save_selected_method_of_payment();
622
-					$default_payment_method_option[ $payment_method->slug() ] =  $payment_method_button;
622
+					$default_payment_method_option[$payment_method->slug()] = $payment_method_button;
623 623
 				} else {
624
-					$available_payment_method_options[ $payment_method->slug() ] =  $payment_method_button;
624
+					$available_payment_method_options[$payment_method->slug()] = $payment_method_button;
625 625
 				}
626
-				$payment_methods_billing_info[ $payment_method->slug() . '-info' ] = $this->_payment_method_billing_info( $payment_method );
626
+				$payment_methods_billing_info[$payment_method->slug().'-info'] = $this->_payment_method_billing_info($payment_method);
627 627
 			}
628 628
 		}
629 629
 		// prepend available_payment_method_options with default_payment_method_option so that it appears first in list of PMs
630 630
 		$available_payment_method_options = $default_payment_method_option + $available_payment_method_options;
631 631
 		// now generate the actual form  inputs
632
-		$available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs( $available_payment_method_options );
632
+		$available_payment_methods['available_payment_methods'] = $this->_available_payment_method_inputs($available_payment_method_options);
633 633
 		$available_payment_methods = $available_payment_methods + $payment_methods_billing_info;
634 634
 
635 635
 		// build the available payment methods form
@@ -649,19 +649,19 @@  discard block
 block discarded – undo
649 649
 	 * @return EE_Payment_Method[]
650 650
 	 */
651 651
 	protected function _get_available_payment_methods() {
652
-		if ( ! empty( $this->checkout->available_payment_methods )) {
652
+		if ( ! empty($this->checkout->available_payment_methods)) {
653 653
 			return $this->checkout->available_payment_methods;
654 654
 		}
655 655
 		$available_payment_methods = array();
656 656
 		// load EEM_Payment_Method
657
-		EE_Registry::instance()->load_model( 'Payment_Method' );
657
+		EE_Registry::instance()->load_model('Payment_Method');
658 658
 		/** @type EEM_Payment_Method $EEM_Payment_Method */
659 659
 		$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
660 660
 		// get all active payment methods
661
-		$payment_methods = $EEM_Payment_Method->get_all_for_transaction( $this->checkout->transaction, EEM_Payment_Method::scope_cart );
662
-		foreach ( $payment_methods as $payment_method ) {
663
-			if ( $payment_method instanceof EE_Payment_Method ) {
664
-				$available_payment_methods[ $payment_method->slug() ] = $payment_method;
661
+		$payment_methods = $EEM_Payment_Method->get_all_for_transaction($this->checkout->transaction, EEM_Payment_Method::scope_cart);
662
+		foreach ($payment_methods as $payment_method) {
663
+			if ($payment_method instanceof EE_Payment_Method) {
664
+				$available_payment_methods[$payment_method->slug()] = $payment_method;
665 665
 			}
666 666
 		}
667 667
 		return $available_payment_methods;
@@ -677,14 +677,14 @@  discard block
 block discarded – undo
677 677
 	 * @param 	array $available_payment_method_options
678 678
 	 * @return 	\EE_Form_Section_Proper
679 679
 	 */
680
-	private function _available_payment_method_inputs( $available_payment_method_options = array() ) {
680
+	private function _available_payment_method_inputs($available_payment_method_options = array()) {
681 681
 		// generate inputs
682 682
 		return new EE_Form_Section_Proper(
683 683
 			array(
684 684
 				'html_id' 				=> 'ee-available-payment-method-inputs',
685 685
 				'layout_strategy'	=> new EE_Div_Per_Section_Layout(),
686 686
 				'subsections' 		=> array(
687
-					'' => new EE_Radio_Button_Input (
687
+					'' => new EE_Radio_Button_Input(
688 688
 						$available_payment_method_options,
689 689
 						array(
690 690
 							'html_name' 				=> 'selected_method_of_payment',
@@ -708,36 +708,36 @@  discard block
 block discarded – undo
708 708
 	 * @param 	EE_Payment_Method $payment_method
709 709
 	 * @return 	\EE_Form_Section_Proper
710 710
 	 */
711
-	private function _payment_method_billing_info( EE_Payment_Method $payment_method ) {
711
+	private function _payment_method_billing_info(EE_Payment_Method $payment_method) {
712 712
 		$currently_selected = $this->checkout->selected_method_of_payment == $payment_method->slug() ? TRUE : FALSE;
713 713
 		// generate the billing form for payment method
714
-		$billing_form = $currently_selected ? $this->_get_billing_form_for_payment_method( $payment_method ) : new EE_Form_Section_HTML();
714
+		$billing_form = $currently_selected ? $this->_get_billing_form_for_payment_method($payment_method) : new EE_Form_Section_HTML();
715 715
 		$this->checkout->billing_form = $currently_selected ? $billing_form : $this->checkout->billing_form;
716 716
 		// it's all in the details
717
-		$info_html = EEH_HTML::h3 ( __( 'Important information regarding your payment', 'event_espresso' ), '', 'spco-payment-method-hdr' );
717
+		$info_html = EEH_HTML::h3(__('Important information regarding your payment', 'event_espresso'), '', 'spco-payment-method-hdr');
718 718
 		// add some info regarding the step, either from what's saved in the admin, or a default string depending on whether the PM has a billing form or not
719
-		if ( $payment_method->description() ) {
719
+		if ($payment_method->description()) {
720 720
 			$payment_method_info = $payment_method->description();
721
-		} elseif ( $billing_form instanceof EE_Billing_Info_Form ) {
722
-			$payment_method_info = sprintf( __( 'Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() );
721
+		} elseif ($billing_form instanceof EE_Billing_Info_Form) {
722
+			$payment_method_info = sprintf(__('Please provide the following billing information, then click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text());
723 723
 		} else {
724
-			$payment_method_info = sprintf( __( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ), $this->submit_button_text() );
724
+			$payment_method_info = sprintf(__('Please click the "%1$s" button below in order to proceed.', 'event_espresso'), $this->submit_button_text());
725 725
 		}
726
-		$info_html .= EEH_HTML::p (
727
-			apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info ),
726
+		$info_html .= EEH_HTML::p(
727
+			apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options___payment_method_billing_info__payment_method_info', $payment_method_info),
728 728
 			'',
729 729
 			'spco-payment-method-desc ee-attention'
730 730
 		);
731 731
 
732 732
 		return new EE_Form_Section_Proper(
733 733
 			array(
734
-				'html_id' 					=> 'spco-payment-method-info-' . $payment_method->slug(),
734
+				'html_id' 					=> 'spco-payment-method-info-'.$payment_method->slug(),
735 735
 				'html_class' 			=> 'spco-payment-method-info-dv',
736 736
 				// only display the selected or default PM
737 737
 				'html_style' 			=> $currently_selected ? '' : 'display:none;',
738 738
 				'layout_strategy'		=> new EE_Div_Per_Section_Layout(),
739 739
 				'subsections' 			=> array(
740
-					'info' 					=> new EE_Form_Section_HTML( $info_html ),
740
+					'info' 					=> new EE_Form_Section_HTML($info_html),
741 741
 					'billing_form' 		=> $currently_selected ? $billing_form : new EE_Form_Section_HTML()
742 742
 				)
743 743
 			)
@@ -755,12 +755,12 @@  discard block
 block discarded – undo
755 755
 	 */
756 756
 	public function get_billing_form_html_for_payment_method() {
757 757
 		// how have they chosen to pay?
758
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE );
758
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE);
759 759
 		$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
760
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
760
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
761 761
 			return FALSE;
762 762
 		}
763
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
763
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
764 764
             EE_Error::add_success(
765 765
                 apply_filters(
766 766
                     'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -769,20 +769,20 @@  discard block
 block discarded – undo
769 769
             );
770 770
         }
771 771
 		// now generate billing form for selected method of payment
772
-		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method, FALSE );
772
+		$payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method, FALSE);
773 773
 		// fill form with attendee info if applicable
774
-		if ( $payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant() ) {
775
-			$payment_method_billing_form->populate_from_attendee( $this->checkout->transaction->primary_registration()->attendee() );
774
+		if ($payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant()) {
775
+			$payment_method_billing_form->populate_from_attendee($this->checkout->transaction->primary_registration()->attendee());
776 776
 		}
777 777
 		// and debug content
778
-		if ( $payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base ) {
779
-			$payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( $payment_method_billing_form );
778
+		if ($payment_method_billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base) {
779
+			$payment_method_billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings($payment_method_billing_form);
780 780
 		}
781 781
 		$billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper ? $payment_method_billing_form->get_html() : '';
782
-		$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info ));
782
+		$this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info));
783 783
 		// localize validation rules for main form
784 784
 		$this->checkout->current_step->reg_form->localize_validation_rules();
785
-		$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
785
+		$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
786 786
 		return TRUE;
787 787
 	}
788 788
 
@@ -795,15 +795,15 @@  discard block
 block discarded – undo
795 795
 	 * @param EE_Payment_Method $payment_method
796 796
 	 * @return \EE_Billing_Info_Form
797 797
 	 */
798
-	private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) {
799
-		$billing_form = $payment_method->type_obj()->billing_form( $this->checkout->transaction, array( 'amount_owing' => $this->checkout->amount_owing ) );
800
-		if ( $billing_form instanceof EE_Billing_Info_Form ) {
801
-			if ( EE_Registry::instance()->REQ->is_set( 'payment_method' )) {
802
-                if ( apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false )) {
798
+	private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) {
799
+		$billing_form = $payment_method->type_obj()->billing_form($this->checkout->transaction, array('amount_owing' => $this->checkout->amount_owing));
800
+		if ($billing_form instanceof EE_Billing_Info_Form) {
801
+			if (EE_Registry::instance()->REQ->is_set('payment_method')) {
802
+                if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
803 803
                     EE_Error::add_success(
804 804
                         apply_filters(
805 805
                             'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
806
-                            sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $payment_method->name() )
806
+                            sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $payment_method->name())
807 807
                         )
808 808
                     );
809 809
                 }
@@ -828,27 +828,27 @@  discard block
 block discarded – undo
828 828
 	 * @param string 		$request_param
829 829
 	 * @return NULL|string
830 830
 	 */
831
-	private function _get_selected_method_of_payment( $required = FALSE, $request_param = 'selected_method_of_payment' ) {
831
+	private function _get_selected_method_of_payment($required = FALSE, $request_param = 'selected_method_of_payment') {
832 832
 		// is selected_method_of_payment set in the request ?
833
-		$selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, FALSE );
834
-		if ( $selected_method_of_payment ) {
833
+		$selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, FALSE);
834
+		if ($selected_method_of_payment) {
835 835
 			// sanitize it
836
-			$selected_method_of_payment = is_array( $selected_method_of_payment ) ? array_shift( $selected_method_of_payment ) : $selected_method_of_payment;
837
-			$selected_method_of_payment = sanitize_text_field( $selected_method_of_payment );
836
+			$selected_method_of_payment = is_array($selected_method_of_payment) ? array_shift($selected_method_of_payment) : $selected_method_of_payment;
837
+			$selected_method_of_payment = sanitize_text_field($selected_method_of_payment);
838 838
 			// store it in the session so that it's available for all subsequent requests including AJAX
839
-			$this->_save_selected_method_of_payment( $selected_method_of_payment );
839
+			$this->_save_selected_method_of_payment($selected_method_of_payment);
840 840
 		} else {
841 841
 			// or is is set in the session ?
842
-			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data( 'selected_method_of_payment' );
842
+			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data('selected_method_of_payment');
843 843
 		}
844 844
 		// do ya really really gotta have it?
845
-		if ( empty( $selected_method_of_payment ) && $required ) {
845
+		if (empty($selected_method_of_payment) && $required) {
846 846
 			EE_Error::add_error(
847 847
 				sprintf(
848
-					__( 'The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso' ),
848
+					__('The selected method of payment could not be determined.%sPlease ensure that you have selected one before proceeding.%sIf you continue to experience difficulties, then refresh your browser and try again, or contact %s for assistance.', 'event_espresso'),
849 849
 					'<br/>',
850 850
 					'<br/>',
851
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
851
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
852 852
 				),
853 853
 				__FILE__, __FUNCTION__, __LINE__
854 854
 			);
@@ -874,37 +874,37 @@  discard block
 block discarded – undo
874 874
 	 * @return string
875 875
 	 */
876 876
 	public function switch_payment_method() {
877
-		if ( ! $this->_verify_payment_method_is_set() ) {
877
+		if ( ! $this->_verify_payment_method_is_set()) {
878 878
 			return FALSE;
879 879
 		}
880
-		if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false ) ) {
880
+		if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success', false)) {
881 881
 			EE_Error::add_success(
882 882
 				apply_filters(
883 883
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
884
-					sprintf( __( 'You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso' ), $this->checkout->payment_method->name() )
884
+					sprintf(__('You have selected "%s" as your method of payment. Please note the important payment information below.', 'event_espresso'), $this->checkout->payment_method->name())
885 885
 				)
886 886
 			);
887 887
 		}
888 888
 		// generate billing form for selected method of payment if it hasn't been done already
889
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
890
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
889
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
890
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
891 891
 		}
892 892
 		// fill form with attendee info if applicable
893
-		if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant() ) {
894
-			$this->checkout->billing_form->populate_from_attendee( $this->checkout->transaction->primary_registration()->attendee() );
893
+		if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && $this->checkout->transaction_has_primary_registrant()) {
894
+			$this->checkout->billing_form->populate_from_attendee($this->checkout->transaction->primary_registration()->attendee());
895 895
 		}
896 896
 		// and debug content
897
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base ) {
898
-			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings( $this->checkout->billing_form );
897
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base) {
898
+			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings($this->checkout->billing_form);
899 899
 		}
900 900
 		// get html and validation rules for form
901
-		if ( $this->checkout->billing_form instanceof EE_Form_Section_Proper ) {
902
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $this->checkout->billing_form->get_html() ));
901
+		if ($this->checkout->billing_form instanceof EE_Form_Section_Proper) {
902
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => $this->checkout->billing_form->get_html()));
903 903
 			// localize validation rules for main form
904
-			$this->checkout->billing_form->localize_validation_rules( TRUE );
905
-			$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
904
+			$this->checkout->billing_form->localize_validation_rules(TRUE);
905
+			$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
906 906
 		} else {
907
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => '' ));
907
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => ''));
908 908
 		}
909 909
 		//prevents advancement to next step
910 910
 		$this->checkout->continue_reg = FALSE;
@@ -919,12 +919,12 @@  discard block
 block discarded – undo
919 919
 	 */
920 920
 	protected function _verify_payment_method_is_set() {
921 921
 		// generate billing form for selected method of payment if it hasn't been done already
922
-		if ( empty( $this->checkout->selected_method_of_payment )) {
922
+		if (empty($this->checkout->selected_method_of_payment)) {
923 923
 			// how have they chosen to pay?
924
-			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( TRUE );
924
+			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(TRUE);
925 925
 		}
926 926
 		// verify payment method
927
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
927
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
928 928
 			// get payment method for selected method of payment
929 929
 			$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
930 930
 		}
@@ -944,23 +944,23 @@  discard block
 block discarded – undo
944 944
 	 * @return void
945 945
 	 */
946 946
 	public function save_payer_details_via_ajax() {
947
-		if ( ! $this->_verify_payment_method_is_set() ) {
947
+		if ( ! $this->_verify_payment_method_is_set()) {
948 948
 			return;
949 949
 		}
950 950
 		// generate billing form for selected method of payment if it hasn't been done already
951
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
952
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
951
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
952
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
953 953
 		}
954 954
 		// generate primary attendee from payer info if applicable
955 955
 		if ( ! $this->checkout->transaction_has_primary_registrant()) {
956 956
 			$attendee = $this->_create_attendee_from_request_data();
957
-			if ( $attendee instanceof EE_Attendee ) {
958
-				foreach ( $this->checkout->transaction->registrations() as $registration ) {
959
-					if ( $registration->is_primary_registrant() ) {
957
+			if ($attendee instanceof EE_Attendee) {
958
+				foreach ($this->checkout->transaction->registrations() as $registration) {
959
+					if ($registration->is_primary_registrant()) {
960 960
 						$this->checkout->primary_attendee_obj = $attendee;
961
-						$registration->_add_relation_to( $attendee, 'Attendee' );
962
-						$registration->set_attendee_id( $attendee->ID() );
963
-						$registration->update_cache_after_object_save( 'Attendee', $attendee );
961
+						$registration->_add_relation_to($attendee, 'Attendee');
962
+						$registration->set_attendee_id($attendee->ID());
963
+						$registration->update_cache_after_object_save('Attendee', $attendee);
964 964
 					}
965 965
 				}
966 966
 			}
@@ -973,56 +973,56 @@  discard block
 block discarded – undo
973 973
 	 * uses info from alternate GET or POST data (such as AJAX) to create a new attendee
974 974
 	 * @return \EE_Attendee
975 975
 	 */
976
-	protected function _create_attendee_from_request_data(){
976
+	protected function _create_attendee_from_request_data() {
977 977
 		// get State ID
978
-		$STA_ID = ! empty( $_REQUEST['state'] ) ? sanitize_text_field( $_REQUEST['state'] ) : '';
979
-		if ( ! empty( $STA_ID )) {
978
+		$STA_ID = ! empty($_REQUEST['state']) ? sanitize_text_field($_REQUEST['state']) : '';
979
+		if ( ! empty($STA_ID)) {
980 980
 			// can we get state object from name ?
981
-			EE_Registry::instance()->load_model( 'State' );
982
-			$state = EEM_State::instance()->get_col( array( array( 'STA_name' => $STA_ID ), 'limit' => 1), 'STA_ID' );
983
-			$STA_ID = is_array( $state ) && ! empty( $state ) ? reset( $state ) : $STA_ID;
981
+			EE_Registry::instance()->load_model('State');
982
+			$state = EEM_State::instance()->get_col(array(array('STA_name' => $STA_ID), 'limit' => 1), 'STA_ID');
983
+			$STA_ID = is_array($state) && ! empty($state) ? reset($state) : $STA_ID;
984 984
 		}
985 985
 		// get Country ISO
986
-		$CNT_ISO = ! empty( $_REQUEST['country'] ) ? sanitize_text_field( $_REQUEST['country'] ) : '';
987
-		if ( ! empty( $CNT_ISO )) {
986
+		$CNT_ISO = ! empty($_REQUEST['country']) ? sanitize_text_field($_REQUEST['country']) : '';
987
+		if ( ! empty($CNT_ISO)) {
988 988
 			// can we get country object from name ?
989
-			EE_Registry::instance()->load_model( 'Country' );
990
-			$country = EEM_Country::instance()->get_col( array( array( 'CNT_name' => $CNT_ISO ), 'limit' => 1), 'CNT_ISO' );
991
-			$CNT_ISO = is_array( $country ) && ! empty( $country ) ? reset( $country ) : $CNT_ISO;
989
+			EE_Registry::instance()->load_model('Country');
990
+			$country = EEM_Country::instance()->get_col(array(array('CNT_name' => $CNT_ISO), 'limit' => 1), 'CNT_ISO');
991
+			$CNT_ISO = is_array($country) && ! empty($country) ? reset($country) : $CNT_ISO;
992 992
 		}
993 993
 		// grab attendee data
994 994
 		$attendee_data = array(
995
-			'ATT_fname' 		=> ! empty( $_REQUEST['first_name'] ) ? sanitize_text_field( $_REQUEST['first_name'] ) : '',
996
-			'ATT_lname' 		=> ! empty( $_REQUEST['last_name'] ) ? sanitize_text_field( $_REQUEST['last_name'] ) : '',
997
-			'ATT_email' 		=> ! empty( $_REQUEST['email'] ) ? sanitize_email( $_REQUEST['email'] ) : '',
998
-			'ATT_address' 		=> ! empty( $_REQUEST['address'] ) ? sanitize_text_field( $_REQUEST['address'] ) : '',
999
-			'ATT_address2' 	=> ! empty( $_REQUEST['address2'] ) ? sanitize_text_field( $_REQUEST['address2'] ) : '',
1000
-			'ATT_city' 			=> ! empty( $_REQUEST['city'] ) ? sanitize_text_field( $_REQUEST['city'] ) : '',
995
+			'ATT_fname' 		=> ! empty($_REQUEST['first_name']) ? sanitize_text_field($_REQUEST['first_name']) : '',
996
+			'ATT_lname' 		=> ! empty($_REQUEST['last_name']) ? sanitize_text_field($_REQUEST['last_name']) : '',
997
+			'ATT_email' 		=> ! empty($_REQUEST['email']) ? sanitize_email($_REQUEST['email']) : '',
998
+			'ATT_address' 		=> ! empty($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '',
999
+			'ATT_address2' 	=> ! empty($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '',
1000
+			'ATT_city' 			=> ! empty($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '',
1001 1001
 			'STA_ID' 				=> $STA_ID,
1002 1002
 			'CNT_ISO' 			=> $CNT_ISO,
1003
-			'ATT_zip' 				=> ! empty( $_REQUEST['zip'] ) ? sanitize_text_field( $_REQUEST['zip'] ) : '',
1004
-			'ATT_phone' 		=> ! empty( $_REQUEST['phone'] ) ? sanitize_text_field( $_REQUEST['phone'] ) : '',
1003
+			'ATT_zip' 				=> ! empty($_REQUEST['zip']) ? sanitize_text_field($_REQUEST['zip']) : '',
1004
+			'ATT_phone' 		=> ! empty($_REQUEST['phone']) ? sanitize_text_field($_REQUEST['phone']) : '',
1005 1005
 		);
1006 1006
 		// validate the email address since it is the most important piece of info
1007
-		if ( empty( $attendee_data['ATT_email'] ) || $attendee_data['ATT_email'] != $_REQUEST['email'] ) {
1008
-			EE_Error::add_error( __( 'An invalid email address was submitted.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1007
+		if (empty($attendee_data['ATT_email']) || $attendee_data['ATT_email'] != $_REQUEST['email']) {
1008
+			EE_Error::add_error(__('An invalid email address was submitted.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1009 1009
 		}
1010 1010
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1011
-		if ( ! empty( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_email'] ) ) {
1012
-			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( array(
1011
+		if ( ! empty($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_email'])) {
1012
+			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(array(
1013 1013
 				'ATT_fname' => $attendee_data['ATT_fname'],
1014 1014
 				'ATT_lname' => $attendee_data['ATT_lname'],
1015 1015
 				'ATT_email' => $attendee_data['ATT_email']
1016 1016
 			));
1017
-			if ( $existing_attendee instanceof EE_Attendee ) {
1017
+			if ($existing_attendee instanceof EE_Attendee) {
1018 1018
 				return $existing_attendee;
1019 1019
 			}
1020 1020
 		}
1021 1021
 		// no existing attendee? kk let's create a new one
1022 1022
 		// kinda lame, but we need a first and last name to create an attendee, so use the email address if those don't exist
1023
-		$attendee_data['ATT_fname'] = ! empty( $attendee_data['ATT_fname'] ) ? $attendee_data['ATT_fname'] : $attendee_data['ATT_email'];
1024
-		$attendee_data['ATT_lname'] = ! empty( $attendee_data['ATT_lname'] ) ? $attendee_data['ATT_lname'] : $attendee_data['ATT_email'];
1025
-		return EE_Attendee::new_instance( $attendee_data );
1023
+		$attendee_data['ATT_fname'] = ! empty($attendee_data['ATT_fname']) ? $attendee_data['ATT_fname'] : $attendee_data['ATT_email'];
1024
+		$attendee_data['ATT_lname'] = ! empty($attendee_data['ATT_lname']) ? $attendee_data['ATT_lname'] : $attendee_data['ATT_email'];
1025
+		return EE_Attendee::new_instance($attendee_data);
1026 1026
 	}
1027 1027
 
1028 1028
 
@@ -1042,22 +1042,22 @@  discard block
 block discarded – undo
1042 1042
 	 */
1043 1043
 	public function process_reg_step() {
1044 1044
 		// how have they chosen to pay?
1045
-		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free() ? 'no_payment_required' : $this->_get_selected_method_of_payment( TRUE );
1045
+		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free() ? 'no_payment_required' : $this->_get_selected_method_of_payment(TRUE);
1046 1046
 		// choose your own adventure based on method_of_payment
1047
-		switch(  $this->checkout->selected_method_of_payment ) {
1047
+		switch ($this->checkout->selected_method_of_payment) {
1048 1048
 
1049 1049
 			case 'events_sold_out' :
1050 1050
 				$this->checkout->redirect = TRUE;
1051 1051
 				$this->checkout->redirect_url = $this->checkout->cancel_page_url;
1052
-				$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1052
+				$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1053 1053
 				// mark this reg step as completed
1054 1054
 				$this->checkout->current_step->set_completed();
1055 1055
 				return FALSE;
1056 1056
 				break;
1057 1057
 
1058 1058
 			case 'payments_closed' :
1059
-				if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false ) ) {
1060
-					EE_Error::add_success( __( 'no payment required at this time.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1059
+				if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success', false)) {
1060
+					EE_Error::add_success(__('no payment required at this time.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1061 1061
 				}
1062 1062
 				// mark this reg step as completed
1063 1063
 				$this->checkout->current_step->set_completed();
@@ -1065,8 +1065,8 @@  discard block
 block discarded – undo
1065 1065
 				break;
1066 1066
 
1067 1067
 			case 'no_payment_required' :
1068
-				if ( apply_filters( 'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false ) ) {
1069
-					EE_Error::add_success( __( 'no payment required.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1068
+				if (apply_filters('FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success', false)) {
1069
+					EE_Error::add_success(__('no payment required.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1070 1070
 				}
1071 1071
 				// mark this reg step as completed
1072 1072
 				$this->checkout->current_step->set_completed();
@@ -1075,9 +1075,9 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
 			default:
1077 1077
 				$payment_successful = $this->_process_payment();
1078
-				if ( $payment_successful ) {
1078
+				if ($payment_successful) {
1079 1079
 					$this->checkout->continue_reg = true;
1080
-					$this->_maybe_set_completed( $this->checkout->payment_method );
1080
+					$this->_maybe_set_completed($this->checkout->payment_method);
1081 1081
 				} else {
1082 1082
 					$this->checkout->continue_reg = false;
1083 1083
 				}
@@ -1095,8 +1095,8 @@  discard block
 block discarded – undo
1095 1095
 	 * @param \EE_Payment_Method $payment_method
1096 1096
 	 * @return void
1097 1097
 	 */
1098
-	protected function _maybe_set_completed( EE_Payment_Method $payment_method ) {
1099
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1098
+	protected function _maybe_set_completed(EE_Payment_Method $payment_method) {
1099
+		switch ($payment_method->type_obj()->payment_occurs()) {
1100 1100
 			case EE_PMT_Base::offsite :
1101 1101
 				break;
1102 1102
 			case EE_PMT_Base::onsite :
@@ -1119,15 +1119,15 @@  discard block
 block discarded – undo
1119 1119
 	public function update_reg_step() {
1120 1120
 		$success = TRUE;
1121 1121
 		// if payment required
1122
-		if ( $this->checkout->transaction->total() > 0 ) {
1123
-			do_action ('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction );
1122
+		if ($this->checkout->transaction->total() > 0) {
1123
+			do_action('AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway', $this->checkout->transaction);
1124 1124
 			// attempt payment via payment method
1125 1125
 			$success = $this->process_reg_step();
1126 1126
 		}
1127
-		if ( $success && ! $this->checkout->redirect ) {
1128
-			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $this->checkout->transaction->ID() );
1127
+		if ($success && ! $this->checkout->redirect) {
1128
+			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($this->checkout->transaction->ID());
1129 1129
 			 // set return URL
1130
-			$this->checkout->redirect_url = add_query_arg( array( 'e_reg_url_link' => $this->checkout->reg_url_link ), $this->checkout->thank_you_page_url );
1130
+			$this->checkout->redirect_url = add_query_arg(array('e_reg_url_link' => $this->checkout->reg_url_link), $this->checkout->thank_you_page_url);
1131 1131
 		}
1132 1132
 		return $success;
1133 1133
 	}
@@ -1147,24 +1147,24 @@  discard block
 block discarded – undo
1147 1147
 		// clear any previous errors related to not selecting a payment method
1148 1148
 //		EE_Error::overwrite_errors();
1149 1149
 		// ya gotta make a choice man
1150
-		if ( empty( $this->checkout->selected_method_of_payment )) {
1151
-			$this->checkout->json_response->set_plz_select_method_of_payment( __( 'Please select a method of payment before proceeding.', 'event_espresso' ));
1150
+		if (empty($this->checkout->selected_method_of_payment)) {
1151
+			$this->checkout->json_response->set_plz_select_method_of_payment(__('Please select a method of payment before proceeding.', 'event_espresso'));
1152 1152
 			return FALSE;
1153 1153
 		}
1154 1154
 		// get EE_Payment_Method object
1155
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1155
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1156 1156
 			return FALSE;
1157 1157
 		}
1158 1158
 		// setup billing form
1159
-		if ( $this->checkout->payment_method->is_on_site() ) {
1160
-			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
1159
+		if ($this->checkout->payment_method->is_on_site()) {
1160
+			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
1161 1161
 			// bad billing form ?
1162
-			if ( ! $this->_billing_form_is_valid() ) {
1162
+			if ( ! $this->_billing_form_is_valid()) {
1163 1163
 				return FALSE;
1164 1164
 			}
1165 1165
 		}
1166 1166
 		// ensure primary registrant has been fully processed
1167
-		if ( ! $this->_setup_primary_registrant_prior_to_payment() ) {
1167
+		if ( ! $this->_setup_primary_registrant_prior_to_payment()) {
1168 1168
 			return FALSE;
1169 1169
 		}
1170 1170
 		/** @type EE_Transaction_Processor $transaction_processor */
@@ -1172,24 +1172,24 @@  discard block
 block discarded – undo
1172 1172
 		// in case a registrant leaves to an Off-Site Gateway and never returns, we want to approve any registrations for events with a default reg status of Approved
1173 1173
 		//$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params );
1174 1174
 		// attempt payment
1175
-		$payment = $this->_attempt_payment( $this->checkout->payment_method );
1175
+		$payment = $this->_attempt_payment($this->checkout->payment_method);
1176 1176
 		// process results
1177
-		$payment = $this->_validate_payment( $payment );
1178
-		$payment = $this->_post_payment_processing( $payment );
1177
+		$payment = $this->_validate_payment($payment);
1178
+		$payment = $this->_post_payment_processing($payment);
1179 1179
 		// verify payment
1180
-		if ( $payment instanceof EE_Payment ) {
1180
+		if ($payment instanceof EE_Payment) {
1181 1181
 			// store that for later
1182 1182
 			$this->checkout->payment = $payment;
1183 1183
 			/** @type EE_Transaction_Processor $transaction_processor */
1184
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1184
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1185 1185
 			// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1186
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1187
-			if ( $payment->status() == EEM_Payment::status_id_approved || $payment->status() == EEM_Payment::status_id_pending ) {
1186
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1187
+			if ($payment->status() == EEM_Payment::status_id_approved || $payment->status() == EEM_Payment::status_id_pending) {
1188 1188
 				return true;
1189 1189
 			} else {
1190 1190
 				return false;
1191 1191
 			}
1192
-		} else if ( $payment === true ) {
1192
+		} else if ($payment === true) {
1193 1193
 			// please note that offline payment methods will NOT make a payment,
1194 1194
 			// but instead just mark themselves as the PMD_ID on the transaction, and return true
1195 1195
 			$this->checkout->payment = $payment;
@@ -1208,10 +1208,10 @@  discard block
 block discarded – undo
1208 1208
 	 * @return bool
1209 1209
 	 */
1210 1210
 	public function redirect_form() {
1211
-		$payment_method_billing_info = $this->_payment_method_billing_info( $this->_get_payment_method_for_selected_method_of_payment() );
1211
+		$payment_method_billing_info = $this->_payment_method_billing_info($this->_get_payment_method_for_selected_method_of_payment());
1212 1212
 		$html = $payment_method_billing_info->get_html_and_js();
1213 1213
 		$html .= $this->checkout->redirect_form;
1214
-		EE_Registry::instance()->REQ->add_output( $html );
1214
+		EE_Registry::instance()->REQ->add_output($html);
1215 1215
 		return TRUE;
1216 1216
 	}
1217 1217
 
@@ -1224,33 +1224,33 @@  discard block
 block discarded – undo
1224 1224
 	 * @return bool
1225 1225
 	 */
1226 1226
 	private function _billing_form_is_valid() {
1227
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) {
1228
-			if ( $this->checkout->billing_form->was_submitted() ) {
1227
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) {
1228
+			if ($this->checkout->billing_form->was_submitted()) {
1229 1229
 				$this->checkout->billing_form->receive_form_submission();
1230
-				if ( $this->checkout->billing_form->is_valid() ) {
1230
+				if ($this->checkout->billing_form->is_valid()) {
1231 1231
 					return TRUE;
1232 1232
 				}
1233 1233
 				$validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated();
1234 1234
 				$error_strings = array();
1235
-				foreach( $validation_errors as $validation_error ){
1236
-					if( $validation_error instanceof EE_Validation_Error ){
1235
+				foreach ($validation_errors as $validation_error) {
1236
+					if ($validation_error instanceof EE_Validation_Error) {
1237 1237
 						$form_section = $validation_error->get_form_section();
1238
-						if( $form_section instanceof EE_Form_Input_Base ){
1238
+						if ($form_section instanceof EE_Form_Input_Base) {
1239 1239
 							$label = $form_section->html_label_text();
1240
-						}elseif( $form_section instanceof EE_Form_Section_Base ){
1240
+						}elseif ($form_section instanceof EE_Form_Section_Base) {
1241 1241
 							$label = $form_section->name();
1242
-						}else{
1243
-							$label = __( 'Validation Error', 'event_espresso' );
1242
+						} else {
1243
+							$label = __('Validation Error', 'event_espresso');
1244 1244
 						}
1245
-						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage() );
1245
+						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage());
1246 1246
 					}
1247 1247
 				}
1248
-				EE_Error::add_error( sprintf( __( 'One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso' ), '<br/>', implode( '<br/>', $error_strings )  ), __FILE__, __FUNCTION__, __LINE__ );
1248
+				EE_Error::add_error(sprintf(__('One or more billing form inputs are invalid and require correction before proceeding. %1$s %2$s', 'event_espresso'), '<br/>', implode('<br/>', $error_strings)), __FILE__, __FUNCTION__, __LINE__);
1249 1249
 			} else {
1250
-				EE_Error::add_error( __( 'The billing form was not submitted or something prevented it\'s submission.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1250
+				EE_Error::add_error(__('The billing form was not submitted or something prevented it\'s submission.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1251 1251
 			}
1252 1252
 		} else {
1253
-			EE_Error::add_error( __( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1253
+			EE_Error::add_error(__('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1254 1254
 		}
1255 1255
 		return FALSE;
1256 1256
 	}
@@ -1268,9 +1268,9 @@  discard block
 block discarded – undo
1268 1268
 	 */
1269 1269
 		private function _setup_primary_registrant_prior_to_payment() {
1270 1270
 			// check if transaction has a primary registrant and that it has a related Attendee object
1271
-			if ( ! $this->checkout->transaction_has_primary_registrant() ) {
1271
+			if ( ! $this->checkout->transaction_has_primary_registrant()) {
1272 1272
 				// need to at least gather some primary registrant data before attempting payment
1273
-				if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form() ) {
1273
+				if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form && ! $this->_capture_primary_registration_data_from_billing_form()) {
1274 1274
 					return FALSE;
1275 1275
 				}
1276 1276
 			}
@@ -1278,13 +1278,13 @@  discard block
 block discarded – undo
1278 1278
 			// grab the primary_registration object
1279 1279
 			$primary_registration = $this->checkout->transaction->primary_registration();
1280 1280
 			/** @type EE_Transaction_Processor $transaction_processor */
1281
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1281
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1282 1282
 			// at this point we'll consider a TXN to not have been failed
1283
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1283
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1284 1284
 			// save the TXN ( which clears cached copy of primary_registration)
1285 1285
 			$this->checkout->transaction->save();
1286 1286
 			// grab TXN ID and save it to the primary_registration
1287
-			$primary_registration->set_transaction_id( $this->checkout->transaction->ID() );
1287
+			$primary_registration->set_transaction_id($this->checkout->transaction->ID());
1288 1288
 			// save what we have so far
1289 1289
 			$primary_registration->save();
1290 1290
 			return TRUE;
@@ -1301,41 +1301,41 @@  discard block
 block discarded – undo
1301 1301
 		private function _capture_primary_registration_data_from_billing_form() {
1302 1302
 			// convert billing form data into an attendee
1303 1303
 			$this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data();
1304
-			if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) {
1304
+			if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) {
1305 1305
 				EE_Error::add_error(
1306 1306
 					sprintf(
1307
-						__( 'The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1307
+						__('The billing form details could not be used for attendee details due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1308 1308
 						'<br/>',
1309
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1309
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1310 1310
 					), __FILE__, __FUNCTION__, __LINE__
1311 1311
 				);
1312 1312
 				return FALSE;
1313 1313
 			}
1314 1314
 			$primary_registration = $this->checkout->transaction->primary_registration();
1315
-			if ( ! $primary_registration instanceof EE_Registration ) {
1315
+			if ( ! $primary_registration instanceof EE_Registration) {
1316 1316
 				EE_Error::add_error(
1317 1317
 					sprintf(
1318
-						__( 'The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1318
+						__('The primary registrant for this transaction could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1319 1319
 						'<br/>',
1320
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1320
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1321 1321
 					), __FILE__, __FUNCTION__, __LINE__
1322 1322
 				);
1323 1323
 				return FALSE;
1324 1324
 			}
1325
-			if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' ) instanceof EE_Attendee ) {
1325
+			if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee') instanceof EE_Attendee) {
1326 1326
 				EE_Error::add_error(
1327 1327
 					sprintf(
1328
-						__( 'The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1328
+						__('The primary registrant could not be associated with this transaction due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1329 1329
 						'<br/>',
1330
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1330
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1331 1331
 					), __FILE__, __FUNCTION__, __LINE__
1332 1332
 				);
1333 1333
 				return FALSE;
1334 1334
 			}
1335 1335
 			/** @type EE_Registration_Processor $registration_processor */
1336
-			$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1336
+			$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1337 1337
 			// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1338
-			$registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration );
1338
+			$registration_processor->toggle_incomplete_registration_status_to_default($primary_registration);
1339 1339
 
1340 1340
 			return TRUE;
1341 1341
 		}
@@ -1351,35 +1351,35 @@  discard block
 block discarded – undo
1351 1351
 	 */
1352 1352
 		private function _get_payment_method_for_selected_method_of_payment() {
1353 1353
 			// get EE_Payment_Method object
1354
-			if ( isset( $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ] )) {
1355
-				$payment_method = $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ];
1354
+			if (isset($this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment])) {
1355
+				$payment_method = $this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment];
1356 1356
 			} else {
1357 1357
 				// load EEM_Payment_Method
1358
-				EE_Registry::instance()->load_model( 'Payment_Method' );
1358
+				EE_Registry::instance()->load_model('Payment_Method');
1359 1359
 				/** @type EEM_Payment_Method $EEM_Payment_Method */
1360 1360
 				$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
1361
-				$payment_method = $EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment );
1361
+				$payment_method = $EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment);
1362 1362
 			}
1363 1363
 			// verify $payment_method
1364
-			if ( ! $payment_method instanceof EE_Payment_Method ) {
1364
+			if ( ! $payment_method instanceof EE_Payment_Method) {
1365 1365
 				// not a payment
1366 1366
 				EE_Error::add_error(
1367 1367
 					sprintf(
1368
-						__( 'The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1368
+						__('The selected method of payment could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1369 1369
 						'<br/>',
1370
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1370
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1371 1371
 					), __FILE__, __FUNCTION__, __LINE__
1372 1372
 				);
1373 1373
 				return NULL;
1374 1374
 			}
1375 1375
 			// and verify it has a valid Payment_Method Type object
1376
-			if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) {
1376
+			if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) {
1377 1377
 				// not a payment
1378 1378
 				EE_Error::add_error(
1379 1379
 					sprintf(
1380
-						__( 'A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1380
+						__('A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1381 1381
 						'<br/>',
1382
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1382
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1383 1383
 					), __FILE__, __FUNCTION__, __LINE__
1384 1384
 				);
1385 1385
 				return NULL;
@@ -1398,30 +1398,30 @@  discard block
 block discarded – undo
1398 1398
 	 * 	@type 	EE_Payment_Method $payment_method
1399 1399
 	 * 	@return 	mixed	EE_Payment | boolean
1400 1400
 	 */
1401
-	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1402
-		$payment =NULL;
1401
+	private function _attempt_payment(EE_Payment_Method $payment_method) {
1402
+		$payment = NULL;
1403 1403
 		$this->checkout->transaction->save();
1404
-		$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1405
-		if ( ! $payment_processor instanceof EE_Payment_Processor ) {
1404
+		$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1405
+		if ( ! $payment_processor instanceof EE_Payment_Processor) {
1406 1406
 			return FALSE;
1407 1407
 		}
1408 1408
 		try {
1409
-			$payment_processor->set_revisit( $this->checkout->revisit );
1409
+			$payment_processor->set_revisit($this->checkout->revisit);
1410 1410
 			// generate payment object
1411 1411
 			$payment = $payment_processor->process_payment(
1412 1412
 				$payment_method,
1413 1413
 				$this->checkout->transaction,
1414 1414
 				$this->checkout->amount_owing,
1415 1415
 				$this->checkout->billing_form,
1416
-				$this->_get_return_url( $payment_method ),
1416
+				$this->_get_return_url($payment_method),
1417 1417
 				'CART',
1418 1418
 				$this->checkout->admin_request,
1419 1419
 				TRUE,
1420 1420
 				$this->reg_step_url()
1421 1421
 			);
1422 1422
 
1423
-		} catch( Exception $e ) {
1424
-			$this->_handle_payment_processor_exception( $e );
1423
+		} catch (Exception $e) {
1424
+			$this->_handle_payment_processor_exception($e);
1425 1425
 		}
1426 1426
 		return $payment;
1427 1427
 	}
@@ -1435,12 +1435,12 @@  discard block
 block discarded – undo
1435 1435
 	 * @param \Exception $e
1436 1436
 	 * @return void
1437 1437
 	 */
1438
-	protected function _handle_payment_processor_exception( Exception $e ) {
1438
+	protected function _handle_payment_processor_exception(Exception $e) {
1439 1439
 		EE_Error::add_error(
1440 1440
 			sprintf(
1441
-				__( 'The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso' ),
1441
+				__('The payment could not br processed due to a technical issue.%1$sPlease try again or contact %2$s for assistance.||The following Exception was thrown in %4$s on line %5$s:%1$s%3$s', 'event_espresso'),
1442 1442
 				'<br/>',
1443
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' ),
1443
+				EE_Registry::instance()->CFG->organization->get_pretty('email'),
1444 1444
 				$e->getMessage(),
1445 1445
 				$e->getFile(),
1446 1446
 				$e->getLine()
@@ -1457,9 +1457,9 @@  discard block
 block discarded – undo
1457 1457
 	 * @param \EE_Payment_Method $payment_method
1458 1458
 	 * @return string
1459 1459
 	 */
1460
-	protected function _get_return_url( EE_Payment_Method $payment_method ) {
1460
+	protected function _get_return_url(EE_Payment_Method $payment_method) {
1461 1461
 		$return_url = '';
1462
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1462
+		switch ($payment_method->type_obj()->payment_occurs()) {
1463 1463
 
1464 1464
 			case EE_PMT_Base::offsite :
1465 1465
 				$return_url = add_query_arg(
@@ -1490,28 +1490,28 @@  discard block
 block discarded – undo
1490 1490
 	 * @param EE_Payment $payment
1491 1491
 	 * @return EE_Payment | FALSE
1492 1492
 	 */
1493
-	private function _validate_payment( $payment = NULL ) {
1494
-		if (  $this->checkout->payment_method->is_off_line() ) {
1493
+	private function _validate_payment($payment = NULL) {
1494
+		if ($this->checkout->payment_method->is_off_line()) {
1495 1495
 			return TRUE;
1496 1496
 		}
1497 1497
 		// verify payment object
1498
-		if ( $payment instanceof EE_Payment ) {
1498
+		if ($payment instanceof EE_Payment) {
1499 1499
 			if (
1500 1500
 				$payment->status() != EEM_Payment::status_id_approved
1501 1501
 				&& $payment->status() != EEM_Payment::status_id_pending
1502 1502
 				&& $payment->status() != EEM_Payment::status_id_cancelled
1503 1503
 				&& $payment->gateway_response() != ''
1504 1504
 			) {
1505
-				EE_Error::add_error( $payment->gateway_response(), __FILE__, __FUNCTION__, __LINE__ );
1505
+				EE_Error::add_error($payment->gateway_response(), __FILE__, __FUNCTION__, __LINE__);
1506 1506
 			}
1507 1507
 		} else {
1508 1508
 			// not a payment
1509 1509
 			EE_Error::add_error(
1510 1510
 				sprintf(
1511
-					__( 'A valid payment was not generated due to a technical issue.%1$sPlease try again or contact
1512
-					%2$s for assistance.', 'event_espresso' ),
1511
+					__('A valid payment was not generated due to a technical issue.%1$sPlease try again or contact
1512
+					%2$s for assistance.', 'event_espresso'),
1513 1513
 					'<br/>',
1514
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1514
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1515 1515
 				), __FILE__, __FUNCTION__, __LINE__
1516 1516
 			);
1517 1517
 			return FALSE;
@@ -1528,23 +1528,23 @@  discard block
 block discarded – undo
1528 1528
 	 * @param EE_Payment $payment
1529 1529
 	 * @return bool
1530 1530
 	 */
1531
-	private function _post_payment_processing( $payment = NULL ) {
1531
+	private function _post_payment_processing($payment = NULL) {
1532 1532
 		// On-Site payment?
1533
-		if ( $this->checkout->payment_method->is_on_site() ) {
1534
-			if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite )) {
1533
+		if ($this->checkout->payment_method->is_on_site()) {
1534
+			if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) {
1535 1535
 				//$this->_setup_redirect_for_next_step();
1536 1536
 				$this->checkout->continue_reg = false;
1537 1537
 			}
1538 1538
 			// Off-Site payment?
1539
-		} else if ( $this->checkout->payment_method->is_off_site() ) {
1539
+		} else if ($this->checkout->payment_method->is_off_site()) {
1540 1540
 			// if a payment object was made and it specifies a redirect url, then we'll setup that redirect info
1541
-			if ( $payment instanceof EE_Payment && $payment->redirect_url() ){
1542
-				do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()' );
1541
+			if ($payment instanceof EE_Payment && $payment->redirect_url()) {
1542
+				do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()');
1543 1543
 				$this->checkout->redirect = TRUE;
1544 1544
 				$this->checkout->redirect_form = $payment->redirect_form();
1545
-				$this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' );
1545
+				$this->checkout->redirect_url = $this->reg_step_url('redirect_form');
1546 1546
 				// set JSON response
1547
-				$this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form );
1547
+				$this->checkout->json_response->set_redirect_form($this->checkout->redirect_form);
1548 1548
 				// set cron job for finalizing the TXN
1549 1549
 				// in case the user does not return from the off-site gateway
1550 1550
 				EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check(
@@ -1552,21 +1552,21 @@  discard block
 block discarded – undo
1552 1552
 					$this->checkout->transaction->ID()
1553 1553
 				);
1554 1554
 				// and lastly, let's bump the payment status to pending
1555
-				$payment->set_status( EEM_Payment::status_id_pending );
1555
+				$payment->set_status(EEM_Payment::status_id_pending);
1556 1556
 				$payment->save();
1557 1557
 			} else {
1558 1558
 				// not a payment
1559 1559
 				$this->checkout->continue_reg = false;
1560 1560
 				EE_Error::add_error(
1561 1561
 					sprintf(
1562
-						__( 'It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1562
+						__('It appears the Off Site Payment Method was not configured properly.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1563 1563
 						'<br/>',
1564
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1564
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1565 1565
 					), __FILE__, __FUNCTION__, __LINE__
1566 1566
 				);
1567 1567
 			}
1568 1568
 			// Off-Line payment?
1569
-		} else if ( $payment === TRUE ) {
1569
+		} else if ($payment === TRUE) {
1570 1570
 			//$this->_setup_redirect_for_next_step();
1571 1571
 			return TRUE;
1572 1572
 		} else {
@@ -1602,65 +1602,65 @@  discard block
 block discarded – undo
1602 1602
 	 * @return bool
1603 1603
 	 * @throws \EE_Error
1604 1604
 	 */
1605
-	private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) {
1605
+	private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) {
1606 1606
 		// off-line payment? carry on
1607
-		if ( $payment_occurs == EE_PMT_Base::offline ) {
1607
+		if ($payment_occurs == EE_PMT_Base::offline) {
1608 1608
 			return true;
1609 1609
 		}
1610 1610
 		// verify payment validity
1611
-		if ( $payment instanceof EE_Payment ) {
1612
-			do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()' );
1611
+		if ($payment instanceof EE_Payment) {
1612
+			do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()');
1613 1613
 			$msg = $payment->gateway_response();
1614 1614
 			// check results
1615
-			switch ( $payment->status() ) {
1615
+			switch ($payment->status()) {
1616 1616
 
1617 1617
 				// good payment
1618 1618
 				case EEM_Payment::status_id_approved :
1619
-					EE_Error::add_success( __( 'Your payment was processed successfully.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1619
+					EE_Error::add_success(__('Your payment was processed successfully.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
1620 1620
 					return TRUE;
1621 1621
 					break;
1622 1622
 
1623 1623
 				// slow payment
1624 1624
 				case EEM_Payment::status_id_pending :
1625
-					if ( empty( $msg )) {
1626
-						$msg = __( 'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso' );
1625
+					if (empty($msg)) {
1626
+						$msg = __('Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.', 'event_espresso');
1627 1627
 					}
1628
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
1628
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
1629 1629
 					return TRUE;
1630 1630
 					break;
1631 1631
 
1632 1632
 				// don't wanna payment
1633 1633
 				case EEM_Payment::status_id_cancelled :
1634
-					if ( empty( $msg )) {
1634
+					if (empty($msg)) {
1635 1635
 						$msg = _n(
1636 1636
 							'Payment cancelled. Please try again.',
1637 1637
 							'Payment cancelled. Please try again or select another method of payment.',
1638
-							count( $this->checkout->available_payment_methods ),
1638
+							count($this->checkout->available_payment_methods),
1639 1639
 							'event_espresso'
1640 1640
 						);
1641 1641
 					}
1642
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
1642
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
1643 1643
 					return FALSE;
1644 1644
 					break;
1645 1645
 
1646 1646
 				// not enough payment
1647 1647
 				case EEM_Payment::status_id_declined :
1648
-					if ( empty( $msg )) {
1648
+					if (empty($msg)) {
1649 1649
 						$msg = _n(
1650 1650
 							'We\'re sorry but your payment was declined. Please try again.',
1651 1651
 							'We\'re sorry but your payment was declined. Please try again or select another method of payment.',
1652
-							count( $this->checkout->available_payment_methods ),
1652
+							count($this->checkout->available_payment_methods),
1653 1653
 							'event_espresso'
1654 1654
 						);
1655 1655
 					}
1656
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
1656
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
1657 1657
 					return FALSE;
1658 1658
 					break;
1659 1659
 
1660 1660
 				// bad payment
1661 1661
 				case EEM_Payment::status_id_failed :
1662
-					if ( ! empty( $msg ) ) {
1663
-						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
1662
+					if ( ! empty($msg)) {
1663
+						EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
1664 1664
 						return false;
1665 1665
 					}
1666 1666
 					// default to error below
@@ -1670,14 +1670,14 @@  discard block
 block discarded – undo
1670 1670
 		}
1671 1671
 		// off-site payment gateway responses are too unreliable, so let's just assume that
1672 1672
 		// the payment processing is just running slower than the registrant's request
1673
-		if ( $payment_occurs == EE_PMT_Base::offsite ) {
1673
+		if ($payment_occurs == EE_PMT_Base::offsite) {
1674 1674
 			return true;
1675 1675
 		}
1676 1676
 		EE_Error::add_error(
1677 1677
 				sprintf(
1678
-					__( 'Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso' ),
1678
+					__('Your payment could not be processed successfully due to a technical issue.%sPlease try again or contact %s for assistance.', 'event_espresso'),
1679 1679
 					'<br/>',
1680
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1680
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1681 1681
 				),
1682 1682
 				__FILE__, __FUNCTION__, __LINE__
1683 1683
 			);
@@ -1710,13 +1710,13 @@  discard block
 block discarded – undo
1710 1710
 	public function process_gateway_response() {
1711 1711
 		$payment = null;
1712 1712
 		// how have they chosen to pay?
1713
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
1713
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
1714 1714
 		// get EE_Payment_Method object
1715
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1715
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1716 1716
 			$this->checkout->continue_reg = false;
1717 1717
 			return false;
1718 1718
 		}
1719
-		if ( ! $this->checkout->payment_method->is_off_site() ) {
1719
+		if ( ! $this->checkout->payment_method->is_off_site()) {
1720 1720
 			return false;
1721 1721
 		}
1722 1722
 		$this->_validate_offsite_return();
@@ -1730,23 +1730,23 @@  discard block
 block discarded – undo
1730 1730
 		//	true
1731 1731
 		//);
1732 1732
 		// verify TXN
1733
-		if ( $this->checkout->transaction instanceof EE_Transaction ) {
1733
+		if ($this->checkout->transaction instanceof EE_Transaction) {
1734 1734
 			$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
1735
-			if ( ! $gateway instanceof EE_Offsite_Gateway ) {
1735
+			if ( ! $gateway instanceof EE_Offsite_Gateway) {
1736 1736
 				$this->checkout->continue_reg = false;
1737 1737
 				return false;
1738 1738
 			}
1739
-			$payment = $this->_process_off_site_payment( $gateway );
1740
-			$payment = $this->_process_cancelled_payments( $payment );
1741
-			$payment = $this->_validate_payment( $payment );
1739
+			$payment = $this->_process_off_site_payment($gateway);
1740
+			$payment = $this->_process_cancelled_payments($payment);
1741
+			$payment = $this->_validate_payment($payment);
1742 1742
 			// if payment was not declined by the payment gateway or cancelled by the registrant
1743
-			if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) {
1743
+			if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) {
1744 1744
 				//$this->_setup_redirect_for_next_step();
1745 1745
 				// store that for later
1746 1746
 				$this->checkout->payment = $payment;
1747 1747
 				// mark this reg step as completed, as long as gateway doesn't use a separate IPN request,
1748 1748
 				// because we will complete this step during the IPN processing then
1749
-				if ( $gateway instanceof EE_Offsite_Gateway && ! $gateway->uses_separate_IPN_request() ) {
1749
+				if ($gateway instanceof EE_Offsite_Gateway && ! $gateway->uses_separate_IPN_request()) {
1750 1750
 					$this->checkout->current_step->set_completed();
1751 1751
 				}
1752 1752
 				return true;
@@ -1769,19 +1769,19 @@  discard block
 block discarded – undo
1769 1769
 	 * @return bool
1770 1770
 	 */
1771 1771
 	private function _validate_offsite_return() {
1772
-		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
1773
-		if ( $TXN_ID != $this->checkout->transaction->ID() ) {
1772
+		$TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0);
1773
+		if ($TXN_ID != $this->checkout->transaction->ID()) {
1774 1774
 			// Houston... we might have a problem
1775 1775
 			$invalid_TXN = false;
1776 1776
 			// first gather some info
1777
-			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
1777
+			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
1778 1778
 			$primary_registrant = $valid_TXN instanceof EE_Transaction ? $valid_TXN->primary_registration() : null;
1779 1779
 			// let's start by retrieving the cart for this TXN
1780
-			$cart = EE_Cart::get_cart_from_txn( $this->checkout->transaction );
1781
-			if ( $cart instanceof EE_Cart ) {
1780
+			$cart = EE_Cart::get_cart_from_txn($this->checkout->transaction);
1781
+			if ($cart instanceof EE_Cart) {
1782 1782
 				// verify that the current cart has tickets
1783 1783
 				$tickets = $cart->get_tickets();
1784
-				if ( empty( $tickets ) ) {
1784
+				if (empty($tickets)) {
1785 1785
 					$invalid_TXN = true;
1786 1786
 				}
1787 1787
 			} else {
@@ -1789,39 +1789,39 @@  discard block
 block discarded – undo
1789 1789
 			}
1790 1790
 			$valid_TXN_SID = $primary_registrant instanceof EE_Registration ? $primary_registrant->session_ID() : null;
1791 1791
 			// validate current Session ID and compare against valid TXN session ID
1792
-			if ( EE_Session::instance()->id() === null ) {
1792
+			if (EE_Session::instance()->id() === null) {
1793 1793
 				$invalid_TXN = true;
1794
-			} else if ( EE_Session::instance()->id() === $valid_TXN_SID ) {
1794
+			} else if (EE_Session::instance()->id() === $valid_TXN_SID) {
1795 1795
 				// WARNING !!!
1796 1796
 				// this could be PayPal sending back duplicate requests (ya they do that)
1797 1797
 				// or it **could** mean someone is simply registering AGAIN after having just done so
1798 1798
 				// so now we need to determine if this current TXN looks valid or not
1799 1799
 				/** @type EE_Transaction_Processor $transaction_processor */
1800
-				$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1800
+				$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1801 1801
 				// has this step even been started ?
1802
-				if ( $transaction_processor->reg_step_completed( $this->checkout->transaction, $this->slug() === false )
1802
+				if ($transaction_processor->reg_step_completed($this->checkout->transaction, $this->slug() === false)
1803 1803
 				) {
1804 1804
 					// really? you're half way through this reg step, but you never started it ?
1805 1805
 					$invalid_TXN = true;
1806 1806
 				}
1807 1807
 			}
1808
-			if ( $invalid_TXN ) {
1808
+			if ($invalid_TXN) {
1809 1809
 				// is the valid TXN completed ?
1810
-				if ( $valid_TXN instanceof EE_Transaction ) {
1810
+				if ($valid_TXN instanceof EE_Transaction) {
1811 1811
 					/** @type EE_Transaction_Processor $transaction_processor */
1812
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1812
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1813 1813
 					// has this step even been started ?
1814
-					$reg_step_completed = $transaction_processor->reg_step_completed( $valid_TXN, $this->slug() );
1815
-					if ( $reg_step_completed !== false && $reg_step_completed !== true ) {
1814
+					$reg_step_completed = $transaction_processor->reg_step_completed($valid_TXN, $this->slug());
1815
+					if ($reg_step_completed !== false && $reg_step_completed !== true) {
1816 1816
 						// so it **looks** like this is a double request from PayPal
1817 1817
 						// so let's try to pick up where we left off
1818 1818
 						$this->checkout->transaction = $valid_TXN;
1819
-						$this->checkout->refresh_all_entities( true );
1819
+						$this->checkout->refresh_all_entities(true);
1820 1820
 						return;
1821 1821
 					}
1822 1822
 				}
1823 1823
 				// you appear to be lost?
1824
-				$this->_redirect_wayward_request( $primary_registrant );
1824
+				$this->_redirect_wayward_request($primary_registrant);
1825 1825
 			}
1826 1826
 		}
1827 1827
 	}
@@ -1835,18 +1835,18 @@  discard block
 block discarded – undo
1835 1835
 	 * @param \EE_Registration $primary_registrant
1836 1836
 	 * @return bool
1837 1837
 	 */
1838
-	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
1839
-		if ( ! $primary_registrant instanceof EE_Registration ) {
1838
+	private function _redirect_wayward_request(EE_Registration $primary_registrant) {
1839
+		if ( ! $primary_registrant instanceof EE_Registration) {
1840 1840
 			// try redirecting based on the current TXN
1841 1841
 			$primary_registrant = $this->checkout->transaction instanceof EE_Transaction ? $this->checkout->transaction->primary_registration() : null;
1842
-			if ( ! $primary_registrant instanceof EE_Registration ) {
1842
+			if ( ! $primary_registrant instanceof EE_Registration) {
1843 1843
 				EE_Error::add_error(
1844 1844
 					sprintf(
1845
-						__( 'Invalid information was received from the Off-Site Payment Processor and your
1845
+						__('Invalid information was received from the Off-Site Payment Processor and your
1846 1846
 						Transaction details could not be retrieved from the database.%1$sPlease try again or contact
1847
-						%2$s for assistance.', 'event_espresso' ),
1847
+						%2$s for assistance.', 'event_espresso'),
1848 1848
 						'<br/>',
1849
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1849
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1850 1850
 					),
1851 1851
 					__FILE__, __FUNCTION__, __LINE__
1852 1852
 				);
@@ -1874,16 +1874,16 @@  discard block
 block discarded – undo
1874 1874
 	 * @param \EE_Offsite_Gateway $gateway
1875 1875
 	 * @return \EE_Payment
1876 1876
 	 */
1877
-	private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) {
1877
+	private function _process_off_site_payment(EE_Offsite_Gateway $gateway) {
1878 1878
 		try {
1879 1879
 			// if gateway uses_separate_IPN_request, then we don't have to process the IPN manually
1880
-			if ( $gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request() ) {
1880
+			if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) {
1881 1881
 				$payment = $this->checkout->transaction->last_payment();
1882 1882
 				//$payment_source = 'last_payment';
1883 1883
 			} else {
1884 1884
 				// get payment details and process results
1885 1885
 				/** @type EE_Payment_Processor $payment_processor */
1886
-				$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1886
+				$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1887 1887
 				$payment = $payment_processor->process_ipn(
1888 1888
 					$_REQUEST,
1889 1889
 					$this->checkout->transaction,
@@ -1893,14 +1893,14 @@  discard block
 block discarded – undo
1893 1893
 				);
1894 1894
 				//$payment_source = 'process_ipn';
1895 1895
 			}
1896
-		} catch ( Exception $e ) {
1896
+		} catch (Exception $e) {
1897 1897
 			// let's just eat the exception and try to move on using any previously set payment info
1898 1898
 			$payment = $this->checkout->transaction->last_payment();
1899 1899
 			//$payment_source = 'last_payment after Exception';
1900 1900
 			// but if we STILL don't have a payment object
1901
-			if ( ! $payment instanceof EE_Payment ) {
1901
+			if ( ! $payment instanceof EE_Payment) {
1902 1902
 				// then we'll object ! ( not object like a thing... but object like what a lawyer says ! )
1903
-				$this->_handle_payment_processor_exception( $e );
1903
+				$this->_handle_payment_processor_exception($e);
1904 1904
 			}
1905 1905
 		}
1906 1906
 		// DEBUG LOG
@@ -1924,13 +1924,13 @@  discard block
 block discarded – undo
1924 1924
 	 * @param EE_Payment $payment
1925 1925
 	 * @return EE_Payment | FALSE
1926 1926
 	 */
1927
-	private function _process_cancelled_payments( $payment = NULL ) {
1927
+	private function _process_cancelled_payments($payment = NULL) {
1928 1928
 		if (
1929
-			isset( $_REQUEST[ 'ee_cancel_payment' ] )
1929
+			isset($_REQUEST['ee_cancel_payment'])
1930 1930
 			&& $payment instanceof EE_Payment
1931 1931
 			&& $payment->status() == EEM_Payment::status_id_failed
1932 1932
 		) {
1933
-			$payment->set_status( EEM_Payment::status_id_cancelled );
1933
+			$payment->set_status(EEM_Payment::status_id_cancelled);
1934 1934
 		}
1935 1935
 		return $payment;
1936 1936
 	}
@@ -1947,23 +1947,23 @@  discard block
 block discarded – undo
1947 1947
 	public function get_transaction_details_for_gateways() {
1948 1948
 		$txn_details = array();
1949 1949
 		// ya gotta make a choice man
1950
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1950
+		if (empty($this->checkout->selected_method_of_payment)) {
1951 1951
 			$txn_details = array(
1952
-				'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' )
1952
+				'error' => __('Please select a method of payment before proceeding.', 'event_espresso')
1953 1953
 			);
1954 1954
 		}
1955 1955
 		// get EE_Payment_Method object
1956 1956
 		if (
1957
-			empty( $txn_details ) &&
1957
+			empty($txn_details) &&
1958 1958
 			! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()
1959 1959
 		) {
1960 1960
 			$txn_details = array(
1961 1961
 				'selected_method_of_payment' => $this->checkout->selected_method_of_payment,
1962
-				'error' => __( 'A valid Payment Method could not be determined.', 'event_espresso' )
1962
+				'error' => __('A valid Payment Method could not be determined.', 'event_espresso')
1963 1963
 			);
1964 1964
 		}
1965
-		if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) {
1966
-			$return_url = $this->_get_return_url( $this->checkout->payment_method );
1965
+		if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) {
1966
+			$return_url = $this->_get_return_url($this->checkout->payment_method);
1967 1967
 			$txn_details = array(
1968 1968
 				'TXN_ID'        			=> $this->checkout->transaction->ID(),
1969 1969
 				'TXN_timestamp' 	=> $this->checkout->transaction->datetime(),
@@ -1974,7 +1974,7 @@  discard block
 block discarded – undo
1974 1974
 				'PMD_ID'        			=> $this->checkout->transaction->payment_method_ID(),
1975 1975
 				'payment_amount' => $this->checkout->amount_owing,
1976 1976
 				'return_url' 				=> $return_url,
1977
-				'cancel_url' 				=> add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ),
1977
+				'cancel_url' 				=> add_query_arg(array('ee_cancel_payment' => true), $return_url),
1978 1978
 				'notify_url' 				=> EE_Config::instance()->core->txn_page_url(
1979 1979
 					array(
1980 1980
 						'e_reg_url_link'    			=> $this->checkout->transaction->primary_registration()->reg_url_link(),
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 				)
1984 1984
 			);
1985 1985
 		}
1986
-		echo json_encode( $txn_details );
1986
+		echo json_encode($txn_details);
1987 1987
 		exit();
1988 1988
 	}
1989 1989
 
Please login to merge, or discard this patch.
EE_SPCO_Reg_Step_Registration_Confirmation.class.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
 	/**
43
-	 * @return boolean
43
+	 * @return boolean|null
44 44
 	 */
45 45
 	public function initialize_reg_step() {
46 46
 		$this->checkout->remove_reg_step( $this->_slug );
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 
60 60
 	/**
61
-	 * @return boolean
61
+	 * @return boolean|null
62 62
 	 */
63 63
 	public function process_reg_step() {
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 
69 69
 	/**
70
-	 * @return boolean
70
+	 * @return boolean|null
71 71
 	 */
72 72
 	public function update_reg_step() {
73 73
 
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 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_Registration_Confirmation
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_Registration_Confirmation
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_Registration_Confirmation extends EE_SPCO_Reg_Step {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 * @param    EE_Checkout $checkout
21 21
 	 * @return 	\EE_SPCO_Reg_Step_Registration_Confirmation
22 22
 	 */
23
-	public function __construct( EE_Checkout $checkout ) {
23
+	public function __construct(EE_Checkout $checkout) {
24 24
 		$this->_slug = 'registration_confirmation';
25 25
 		$this->_name = __('Registration Confirmation', 'event_espresso');
26
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'registration_page_confirmation.template.php';
26
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'registration_page_confirmation.template.php';
27 27
 		$this->checkout = $checkout;
28 28
 	}
29 29
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return boolean
44 44
 	 */
45 45
 	public function initialize_reg_step() {
46
-		$this->checkout->remove_reg_step( $this->_slug );
46
+		$this->checkout->remove_reg_step($this->_slug);
47 47
 	}
48 48
 
49 49
 
Please login to merge, or discard this patch.