Completed
Branch BUG-9548-transaction-completio... (b1c41e)
by
unknown
519:42 queued 503:28
created
modules/gateways/Invoice/lib/Invoice.class.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -21,23 +21,23 @@  discard block
 block discarded – undo
21 21
 	private $EE;
22 22
 	public function __construct($url_link = 0) {
23 23
 
24
-		if ( $this->registration = EE_Registry::instance()->load_model( 'Registration' )->get_registration_for_reg_url_link( $url_link)) {
24
+		if ($this->registration = EE_Registry::instance()->load_model('Registration')->get_registration_for_reg_url_link($url_link)) {
25 25
 			$this->transaction = $this->registration->transaction();
26 26
 
27
-			$payment_settings = EE_Config::instance()->gateway->payment_settings;//get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
-			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Invoice' );
27
+			$payment_settings = EE_Config::instance()->gateway->payment_settings; //get_user_meta(EE_Registry::instance()->CFG->wp_user, 'payment_settings', TRUE);
28
+			$this->invoice_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Invoice');
29 29
 		} else {
30
-			EE_Error::add_error( __( 'Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
30
+			EE_Error::add_error(__('Your request appears to be missing some required data, and no information for your transaction could be retrieved.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
31 31
 		}
32 32
 
33 33
 	}
34 34
 
35
-	public function send_invoice( $download = FALSE ) {
35
+	public function send_invoice($download = FALSE) {
36 36
 		$template_args = array();
37 37
 		$EE = EE_Registry::instance();
38 38
 
39 39
 		//allow the request to override the default theme defined in the invoice settings
40
-		$theme_requested = ( isset( $_REQUEST['theme'] ) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8 ) ? absint( $_REQUEST['theme'] ) : null;
40
+		$theme_requested = (isset($_REQUEST['theme']) && $_REQUEST['theme'] > 0 && $_REQUEST['theme'] < 8) ? absint($_REQUEST['theme']) : null;
41 41
 		$themes = array(
42 42
 										1 => "simple.css",
43 43
 										2 => "bauhaus.css",
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 										7 => "union.css"
49 49
 									);
50 50
 		//Get the CSS file
51
-		if( isset( $themes[ $theme_requested ] ) ) {
52
-			$template_args['invoice_css'] = $themes[ $theme_requested ];
53
-		}else{
54
-			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta( 'legacy_invoice_css', TRUE, 'simple.css' );
51
+		if (isset($themes[$theme_requested])) {
52
+			$template_args['invoice_css'] = $themes[$theme_requested];
53
+		} else {
54
+			$template_args['invoice_css'] = $this->invoice_payment_method->get_extra_meta('legacy_invoice_css', TRUE, 'simple.css');
55 55
 		}
56 56
 
57
-		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) {
58
-			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/';
57
+		if (is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) {
58
+			$template_args['base_url'] = EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/';
59 59
 		} else {
60
-			$template_args['base_url'] = EE_GATEWAYS . '/Invoice/lib/templates/';
60
+			$template_args['base_url'] = EE_GATEWAYS.'/Invoice/lib/templates/';
61 61
 		}
62 62
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
63 63
 
64
-		$template_args['organization'] = $EE->CFG->organization->get_pretty( 'name' );
65
-		$template_args['street'] = empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' );
66
-		$template_args['city'] = $EE->CFG->organization->get_pretty( 'city' );
67
-		$template_args['state'] = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
68
-		$template_args['country'] = EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $EE->CFG->organization->CNT_ISO );
69
-		$template_args['zip'] = $EE->CFG->organization->get_pretty( 'zip' );
70
-		$template_args['email'] = $EE->CFG->organization->get_pretty( 'email' );
64
+		$template_args['organization'] = $EE->CFG->organization->get_pretty('name');
65
+		$template_args['street'] = empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2');
66
+		$template_args['city'] = $EE->CFG->organization->get_pretty('city');
67
+		$template_args['state'] = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
68
+		$template_args['country'] = EE_Registry::instance()->load_model('Country')->get_one_by_ID($EE->CFG->organization->CNT_ISO);
69
+		$template_args['zip'] = $EE->CFG->organization->get_pretty('zip');
70
+		$template_args['email'] = $EE->CFG->organization->get_pretty('email');
71 71
 
72 72
 		$template_args['registration_code'] = $this->registration->reg_code();
73 73
 		$template_args['registration_date'] = $this->registration->date();
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 		$template_args['attendee_address2'] = $primary_attendee->address2();
77 77
 		$template_args['attendee_city'] = $primary_attendee->city();
78 78
 		$attendee_state = $primary_attendee->state_obj();
79
-		if($attendee_state){
79
+		if ($attendee_state) {
80 80
 			$attendee_state_name = $attendee_state->name();
81
-		}else{
81
+		} else {
82 82
 			$attendee_state_name = '';
83 83
 		}
84 84
 		$template_args['attendee_state'] = $attendee_state_name;
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 		if ($template_args['amount_pd'] != $template_args['total_cost']) {
103 103
 			//$template_args['net_total'] = $this->espressoInvoiceTotals( __('SubTotal', 'event_espresso'), $this->transaction->total());//$this->session_data['cart']['REG']['sub_total']);
104 104
 			$tax_items = $this->transaction->tax_items();
105
-			if(!empty($tax_items) ){
105
+			if ( ! empty($tax_items)) {
106 106
 				foreach ($tax_items as $tax) {
107
-					$template_args['net_total'] .= $this->espressoInvoiceTotals( $tax->name(), $tax->total());
107
+					$template_args['net_total'] .= $this->espressoInvoiceTotals($tax->name(), $tax->total());
108 108
 				}
109 109
 			}
110 110
 
@@ -114,30 +114,30 @@  discard block
 block discarded – undo
114 114
 			} else {
115 115
 				$text = __('Extra', 'event_espresso');
116 116
 			}
117
-			$template_args['discount'] = $this->espressoInvoiceTotals( $text, $difference );
117
+			$template_args['discount'] = $this->espressoInvoiceTotals($text, $difference);
118 118
 		}
119 119
 
120 120
 		$template_args['currency_symbol'] = $EE->CFG->currency->sign;
121
-		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ), ENT_QUOTES)));
122
-		$template_args['shameless_plug'] = apply_filters( 'FHEE_Invoice__send_invoice__shameless_plug',true );
123
-		if(isset($_GET['receipt'])){
121
+		$template_args['template_payment_instructions'] = wpautop(stripslashes_deep(html_entity_decode($this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE), ENT_QUOTES)));
122
+		$template_args['shameless_plug'] = apply_filters('FHEE_Invoice__send_invoice__shameless_plug', true);
123
+		if (isset($_GET['receipt'])) {
124 124
 			//receipt-specific stuff
125 125
 			$events_for_txn = EEM_Event::instance()->get_all(array(array('Registration.TXN_ID'=>$this->transaction->ID())));
126 126
 			$ticket_line_items_per_event = array();
127 127
 			$registrations_per_line_item = array();
128 128
 			$venues_for_events = array();
129
-			foreach($events_for_txn as $event_id => $event){
130
-				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id,'TXN_ID'=>$this->transaction->ID())));
129
+			foreach ($events_for_txn as $event_id => $event) {
130
+				$line_items_for_this_event = EEM_Line_Item::instance()->get_all(array(array('Ticket.Datetime.EVT_ID'=>$event_id, 'TXN_ID'=>$this->transaction->ID())));
131 131
 				$ticket_line_items_per_event[$event_id] = $line_items_for_this_event;
132
-				foreach($line_items_for_this_event as $line_item_id => $line_item){
132
+				foreach ($line_items_for_this_event as $line_item_id => $line_item) {
133 133
 					$ticket = $line_item->ticket();
134
-					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(),'TXN_ID'=>$this->transaction->ID())));
134
+					$registrations_for_this_ticket = EEM_Registration::instance()->get_all(array(array('TKT_ID'=>$ticket->ID(), 'TXN_ID'=>$this->transaction->ID())));
135 135
 					$registrations_per_line_item[$line_item_id] = $registrations_for_this_ticket;
136 136
 				}
137 137
 				$venues_for_events = array_merge($venues_for_events, $event->venues());
138 138
 			}
139
-			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(),'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
-			$questions_to_skip = array(EEM_Attendee::system_question_fname,EEM_Attendee::system_question_lname,  EEM_Attendee::system_question_email);
139
+			$tax_total_line_item = EEM_Line_Item::instance()->get_one(array(array('TXN_ID'=>$this->transaction->ID(), 'LIN_type'=>  EEM_Line_Item::type_tax_sub_total)));
140
+			$questions_to_skip = array(EEM_Attendee::system_question_fname, EEM_Attendee::system_question_lname, EEM_Attendee::system_question_email);
141 141
 
142 142
 
143 143
 			$template_args['events_for_txn'] = $events_for_txn;
@@ -148,53 +148,53 @@  discard block
 block discarded – undo
148 148
 			$template_args['questions_to_skip'] = $questions_to_skip;
149 149
 //			d($template_args);
150 150
 			$template_args['download_link'] = $this->registration->receipt_url('download');
151
-		}else{
151
+		} else {
152 152
 			//it's just an invoice we're accessing
153 153
 			$template_args['download_link'] = $this->registration->invoice_url('download');
154 154
 		}
155 155
 
156 156
 		//Get the HTML as an object
157 157
 		$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
158
-		$template_header = EEH_Template::locate_template( $templates_relative_path . 'invoice_header.template.php', $template_args, TRUE, TRUE );
159
-		if(isset($_GET['receipt'])){
160
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'receipt_body.template.php', $template_args, TRUE, TRUE );
161
-		}else{
162
-			$template_body = EEH_Template::locate_template( $templates_relative_path . 'invoice_body.template.php', $template_args, TRUE, TRUE );
158
+		$template_header = EEH_Template::locate_template($templates_relative_path.'invoice_header.template.php', $template_args, TRUE, TRUE);
159
+		if (isset($_GET['receipt'])) {
160
+			$template_body = EEH_Template::locate_template($templates_relative_path.'receipt_body.template.php', $template_args, TRUE, TRUE);
161
+		} else {
162
+			$template_body = EEH_Template::locate_template($templates_relative_path.'invoice_body.template.php', $template_args, TRUE, TRUE);
163 163
 		}
164 164
 
165 165
 
166
-		$template_footer = EEH_Template::locate_template( $templates_relative_path . 'invoice_footer.template.php', $template_args, TRUE, TRUE );
166
+		$template_footer = EEH_Template::locate_template($templates_relative_path.'invoice_footer.template.php', $template_args, TRUE, TRUE);
167 167
 
168
-		$copies =  ! empty( $_REQUEST['copies'] ) ? $_REQUEST['copies'] : 1;
168
+		$copies = ! empty($_REQUEST['copies']) ? $_REQUEST['copies'] : 1;
169 169
 
170 170
 		$content = $this->espresso_replace_invoice_shortcodes($template_header);
171
-		for( $x = 1; $x <= $copies; $x++ ) {
171
+		for ($x = 1; $x <= $copies; $x++) {
172 172
 			$content .= $this->espresso_replace_invoice_shortcodes($template_body);
173 173
 		}
174 174
 		$content .= $this->espresso_replace_invoice_shortcodes($template_footer);
175 175
 
176 176
 		//Check if debugging or mobile is set
177
-		if (!empty($_REQUEST['html'])) {
177
+		if ( ! empty($_REQUEST['html'])) {
178 178
 			echo $content;
179 179
 			exit(0);
180 180
 		}
181
-		$invoice_name = $template_args['organization'] . ' ' . __('Invoice #', 'event_espresso') . $template_args['registration_code'] . __(' for ', 'event_espresso') . $template_args['name'];
182
-		$invoice_name = str_replace( ' ', '_', $invoice_name );
181
+		$invoice_name = $template_args['organization'].' '.__('Invoice #', 'event_espresso').$template_args['registration_code'].__(' for ', 'event_espresso').$template_args['name'];
182
+		$invoice_name = str_replace(' ', '_', $invoice_name);
183 183
 		//Create the PDF
184
-		if(array_key_exists('html',$_GET)){
184
+		if (array_key_exists('html', $_GET)) {
185 185
 			echo $content;
186
-		}else{
186
+		} else {
187 187
 			//only load dompdf if nobody else has yet...
188
-			if( ! defined('DOMPDF_DIR')){
188
+			if ( ! defined('DOMPDF_DIR')) {
189 189
 				define('DOMPDF_ENABLE_REMOTE', TRUE);
190 190
 				define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
191 191
 				define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
192
-				require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
192
+				require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
193 193
 			}
194 194
 			$dompdf = new DOMPDF();
195 195
 			$dompdf->load_html($content);
196 196
 			$dompdf->render();
197
-			$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => $download ));
197
+			$dompdf->stream($invoice_name.".pdf", array('Attachment' => $download));
198 198
 		}
199 199
 		exit(0);
200 200
 	}
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 	 * @param EE_Line_Item $line_item
205 205
 	 * @return boolean
206 206
 	 */
207
-	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item){
208
-		if($line_item->desc()){
207
+	function check_if_any_line_items_have_a_description(EE_Line_Item $line_item) {
208
+		if ($line_item->desc()) {
209 209
 			return true;
210
-		}else{
211
-			foreach($line_item->children() as $child_line_item){
212
-				if($this->check_if_any_line_items_have_a_description($child_line_item)){
210
+		} else {
211
+			foreach ($line_item->children() as $child_line_item) {
212
+				if ($this->check_if_any_line_items_have_a_description($child_line_item)) {
213 213
 					return true;
214 214
 				}
215 215
 			}
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
 	}
220 220
 
221 221
 //Perform the shortcode replacement
222
-	function espresso_replace_invoice_shortcodes( $content ) {
222
+	function espresso_replace_invoice_shortcodes($content) {
223 223
 
224 224
 		$EE = EE_Registry::instance();
225 225
 		//Create the logo
226
-		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE,  $EE->CFG->organization->logo_url );
227
-		if (!empty($invoice_logo_url)) {
226
+		$invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url);
227
+		if ( ! empty($invoice_logo_url)) {
228 228
 			$image_size = getimagesize($invoice_logo_url);
229
-			$invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
229
+			$invoice_logo_image = '<img class="logo screen" src="'.$invoice_logo_url.'" '.$image_size[3].' alt="logo" /> ';
230 230
 		} else {
231 231
 			$invoice_logo_image = '';
232 232
 		}
@@ -248,28 +248,28 @@  discard block
 block discarded – undo
248 248
 				"[instructions]",
249 249
 		);
250 250
 		$primary_attendee = $this->transaction->primary_registration()->attendee();
251
-		$org_state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $EE->CFG->organization->STA_ID );
252
-		if($org_state){
251
+		$org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
252
+		if ($org_state) {
253 253
 			$org_state_name = $org_state->name();
254
-		}else{
254
+		} else {
255 255
 			$org_state_name = '';
256 256
 		}
257 257
 		$ReplaceValues = array(
258
-				$EE->CFG->organization->get_pretty( 'name' ),
258
+				$EE->CFG->organization->get_pretty('name'),
259 259
 				$this->registration->reg_code(),
260 260
 				$this->transaction->ID(),
261 261
 				$primary_attendee->full_name(),
262
-				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/',
263
-				$this->registration->invoice_url(),//home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
262
+				(is_dir(EVENT_ESPRESSO_GATEWAY_DIR.'/invoice')) ? EVENT_ESPRESSO_GATEWAY_URL.'Invoice/lib/templates/' : EE_GATEWAYS_URL.'Invoice/lib/templates/',
263
+				$this->registration->invoice_url(), //home_url() . '/?download_invoice=true&amp;id=' . $this->registration->reg_url_link(),
264 264
 				$invoice_logo_image,
265
-				empty( $EE->CFG->organization->address_2 ) ? $EE->CFG->organization->get_pretty( 'address_1' ) : $EE->CFG->organization->get_pretty( 'address_1' ) . '<br>' . $EE->CFG->organization->get_pretty( 'address_2' ),
266
-				$EE->CFG->organization->get_pretty( 'city' ),
265
+				empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1').'<br>'.$EE->CFG->organization->get_pretty('address_2'),
266
+				$EE->CFG->organization->get_pretty('city'),
267 267
 				$org_state_name,
268
-				$EE->CFG->organization->get_pretty( 'zip' ),
269
-				$EE->CFG->organization->get_pretty( 'email' ),
268
+				$EE->CFG->organization->get_pretty('zip'),
269
+				$EE->CFG->organization->get_pretty('email'),
270 270
 				$EE->CFG->organization->vat,
271
-				$this->registration->get_i18n_datetime( 'REG_date', get_option( 'date_format' ) ),
272
-				$this->invoice_payment_method->get_extra_meta( 'pdf_instructions', TRUE ),
271
+				$this->registration->get_i18n_datetime('REG_date', get_option('date_format')),
272
+				$this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE),
273 273
 		);
274 274
 
275 275
 		return str_replace($SearchValues, $ReplaceValues, $content);
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
 		if ($total_cost < 0) {
293 293
 			$total_cost = (-1) * $total_cost;
294 294
 		}
295
-		$find = array( ' ' );
296
-		$replace = array( '-' );
297
-		$row_id = strtolower( str_replace( $find, $replace, $text ));
295
+		$find = array(' ');
296
+		$replace = array('-');
297
+		$row_id = strtolower(str_replace($find, $replace, $text));
298 298
 		$html .= '<tr id="'.$row_id.'-tr"><td colspan="4">&nbsp;</td>';
299
-		$html .= '<td class="item_r">' . $text . '</td>';
300
-		$html .= '<td class="item_r">' . $total_cost . '</td>';
299
+		$html .= '<td class="item_r">'.$text.'</td>';
300
+		$html .= '<td class="item_r">'.$total_cost.'</td>';
301 301
 		$html .= '</tr>';
302 302
 		return $html;
303 303
 	}
Please login to merge, or discard this patch.
modules/messages/EED_Messages.module.php 1 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__with_registrations', 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__with_registrations', 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,10 +271,10 @@  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
-			foreach ( self::$_MSG_PATHS as $path ) {
277
-				EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $path );
276
+			foreach (self::$_MSG_PATHS as $path) {
277
+				EEH_Autoloader::register_autoloaders_for_each_file_in_folder($path);
278 278
 			}
279 279
 		}
280 280
 	}
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
 			'shortcodes'
305 305
 			);
306 306
 		$paths = array();
307
-		foreach ( $dir_ref as $index => $dir ) {
308
-			$paths[$index] = EE_LIBRARIES . $dir;
307
+		foreach ($dir_ref as $index => $dir) {
308
+			$paths[$index] = EE_LIBRARIES.$dir;
309 309
 		}
310
-		self::$_MSG_PATHS = apply_filters( 'FHEE__EED_Messages___set_messages_paths___MSG_PATHS', $paths );
310
+		self::$_MSG_PATHS = apply_filters('FHEE__EED_Messages___set_messages_paths___MSG_PATHS', $paths);
311 311
 	}
312 312
 
313 313
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @return void
320 320
 	 */
321 321
 	protected static function _load_controller() {
322
-		if ( ! self::$_EEMSG instanceof EE_messages ) {
322
+		if ( ! self::$_EEMSG instanceof EE_messages) {
323 323
 			self::set_autoloaders();
324 324
 			self::$_EEMSG = new EE_messages();
325 325
 		}
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 	/**
331 331
 	 * @param EE_Transaction $transaction
332 332
 	 */
333
-	public static function payment_reminder( EE_Transaction $transaction ) {
333
+	public static function payment_reminder(EE_Transaction $transaction) {
334 334
 		self::_load_controller();
335
-		$data = array( $transaction, null );
336
-		if ( self::$_EEMSG->send_message( 'payment_reminder', $data ) ) {
335
+		$data = array($transaction, null);
336
+		if (self::$_EEMSG->send_message('payment_reminder', $data)) {
337 337
 			//self::log(
338 338
 			//	__CLASS__, __FUNCTION__, __LINE__,
339 339
 			//	$transaction,
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
 	 * @param  EE_Payment object
355 355
 	 * @return void
356 356
 	 */
357
-	public static function payment( EE_Transaction $transaction, EE_Payment $payment ) {
357
+	public static function payment(EE_Transaction $transaction, EE_Payment $payment) {
358 358
 		self::_load_controller();
359
-		$data = array( $transaction, $payment );
359
+		$data = array($transaction, $payment);
360 360
 
361
-		$message_type = self::_get_payment_message_type( $payment->STS_ID() );
361
+		$message_type = self::_get_payment_message_type($payment->STS_ID());
362 362
 
363 363
 		//if payment amount is less than 0 then switch to payment_refund message type.
364 364
 		$message_type = $payment->amount() < 0 ? 'payment_refund' : $message_type;
@@ -366,15 +366,15 @@  discard block
 block discarded – undo
366 366
 		//verify this message type is present and active.  If it isn't then no message is sent.
367 367
 		$active_mts = self::$_EEMSG->get_active_message_types();
368 368
 
369
-		$message_type = in_array( $message_type, $active_mts ) ? $message_type : false;
370
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, current_time( 'mysql' ), 'delivered' );
371
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $message_type, '$message_type' );
372
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $transaction->status_ID(), '$transaction->status_ID()' );
373
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, $payment->status(), '$payment->status()' );
374
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, print_r( $active_mts, true ), '$active_mts' );
369
+		$message_type = in_array($message_type, $active_mts) ? $message_type : false;
370
+		do_action('AHEE_log', __FILE__, __FUNCTION__, current_time('mysql'), 'delivered');
371
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $message_type, '$message_type');
372
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $transaction->status_ID(), '$transaction->status_ID()');
373
+		do_action('AHEE_log', __FILE__, __FUNCTION__, $payment->status(), '$payment->status()');
374
+		do_action('AHEE_log', __FILE__, __FUNCTION__, print_r($active_mts, true), '$active_mts');
375 375
 
376
-		if ( $message_type ) {
377
-			if ( self::$_EEMSG->send_message( $message_type, $data ) ) {
376
+		if ($message_type) {
377
+			if (self::$_EEMSG->send_message($message_type, $data)) {
378 378
 				//self::log(
379 379
 				//	__CLASS__, __FUNCTION__, __LINE__,
380 380
 				//	$transaction,
@@ -394,15 +394,15 @@  discard block
 block discarded – undo
394 394
 	/**
395 395
 	 * @param EE_Transaction $transaction
396 396
 	 */
397
-	public static function cancelled_registration( EE_Transaction $transaction ) {
397
+	public static function cancelled_registration(EE_Transaction $transaction) {
398 398
 		self::_load_controller();
399 399
 
400
-		$data = array( $transaction, NULL );
400
+		$data = array($transaction, NULL);
401 401
 
402 402
 		$active_mts = self::$_EEMSG->get_active_message_types();
403 403
 
404
-		if ( in_array( 'cancelled_registration', $active_mts ) ) {
405
-			self::$_EEMSG->send_message( 'cancelled_registration', $data );
404
+		if (in_array('cancelled_registration', $active_mts)) {
405
+			self::$_EEMSG->send_message('cancelled_registration', $data);
406 406
 		}
407 407
 		return;
408 408
 	}
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
 	 * @param array $extra_details
418 418
 	 * @return void
419 419
 	 */
420
-	public static function maybe_registration( EE_Registration $registration, $extra_details = array() ) {
420
+	public static function maybe_registration(EE_Registration $registration, $extra_details = array()) {
421 421
 
422
-		if ( ! self::_verify_registration_notification_send( $registration, $extra_details ) ) {
422
+		if ( ! self::_verify_registration_notification_send($registration, $extra_details)) {
423 423
 			//no messages please
424 424
 			return;
425 425
 		}
@@ -432,19 +432,19 @@  discard block
 block discarded – undo
432 432
 		$statuses_sent = array();
433 433
 
434 434
 		//loop through registrations and trigger messages once per status.
435
-		foreach ( $all_registrations as $reg ) {
435
+		foreach ($all_registrations as $reg) {
436 436
 
437 437
 			//already triggered?
438
-			if ( in_array( $reg->status_ID(), $statuses_sent ) ) {
438
+			if (in_array($reg->status_ID(), $statuses_sent)) {
439 439
 				continue;
440 440
 			}
441 441
 
442
-			$message_type = self::_get_reg_status_array( $reg->status_ID() );
443
-			if ( EEH_MSG_Template::is_mt_active( $message_type ) ) {
442
+			$message_type = self::_get_reg_status_array($reg->status_ID());
443
+			if (EEH_MSG_Template::is_mt_active($message_type)) {
444 444
 				self::_load_controller();
445 445
 
446 446
 				//send away, send away, uhhuh
447
-				if ( self::$_EEMSG->send_message( $message_type, array( $registration->transaction(), null, $reg->status_ID() ) ) ) {
447
+				if (self::$_EEMSG->send_message($message_type, array($registration->transaction(), null, $reg->status_ID()))) {
448 448
 					// DEBUG LOG
449 449
 					// self::log(
450 450
 					// 	__CLASS__, __FUNCTION__, __LINE__,
@@ -463,9 +463,9 @@  discard block
 block discarded – undo
463 463
 		}
464 464
 
465 465
 		//now send summary (registration_summary) if active
466
-		if ( EEH_MSG_Template::is_mt_active( 'registration_summary' ) ) {
466
+		if (EEH_MSG_Template::is_mt_active('registration_summary')) {
467 467
 			self::_load_controller();
468
-			if ( self::$_EEMSG->send_message( 'registration_summary', array( $registration->transaction(), null ) ) ) {
468
+			if (self::$_EEMSG->send_message('registration_summary', array($registration->transaction(), null))) {
469 469
 					// DEBUG LOG
470 470
 					// self::log(
471 471
 					// 	__CLASS__, __FUNCTION__, __LINE__,
@@ -491,18 +491,18 @@  discard block
 block discarded – undo
491 491
 	 *
492 492
 	 * @return bool          true = send away, false = nope halt the presses.
493 493
 	 */
494
-	protected static function _verify_registration_notification_send( EE_Registration $registration, $extra_details = array() ) {
494
+	protected static function _verify_registration_notification_send(EE_Registration $registration, $extra_details = array()) {
495 495
 		 //self::log(
496 496
 		 //	__CLASS__, __FUNCTION__, __LINE__,
497 497
 		 //	$registration->transaction(),
498 498
 		 //	array( '$extra_details' => $extra_details )
499 499
 		 //);
500 500
 		// currently only using this to send messages for the primary registrant
501
-		if ( ! $registration->is_primary_registrant() ) {
501
+		if ( ! $registration->is_primary_registrant()) {
502 502
 			return false;
503 503
 		}
504 504
 		if (
505
-			! apply_filters( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', false ) &&
505
+			! apply_filters('FHEE__EED_Messages___maybe_registration__deliver_notifications', false) &&
506 506
 			$registration->status_ID() !== EEM_Registration::status_id_not_approved
507 507
 		) {
508 508
 			return false;
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	 * @param string $reg_status
520 520
 	 * @return array
521 521
 	 */
522
-	protected static function _get_reg_status_array( $reg_status = '' ) {
522
+	protected static function _get_reg_status_array($reg_status = '') {
523 523
 		$reg_status_array = array(
524 524
 			EEM_Registration::status_id_approved => 'registration',
525 525
 			EEM_Registration::status_id_pending_payment => 'pending_approval',
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 			EEM_Registration::status_id_cancelled => 'cancelled_registration',
528 528
 			EEM_Registration::status_id_declined => 'declined_registration'
529 529
 		);
530
-		return isset( $reg_status_array[ $reg_status ] ) ? $reg_status_array[ $reg_status ] : $reg_status_array;
530
+		return isset($reg_status_array[$reg_status]) ? $reg_status_array[$reg_status] : $reg_status_array;
531 531
 	}
532 532
 
533 533
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 	 *
540 540
 	 * @return string|bool The payment message type slug matching the status or false if no match.
541 541
 	 */
542
-	protected static function _get_payment_message_type( $payment_status ) {
542
+	protected static function _get_payment_message_type($payment_status) {
543 543
 		$matches = array(
544 544
 			EEM_Payment::status_id_approved => 'payment',
545 545
 			EEM_Payment::status_id_pending => 'payment_pending',
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 			EEM_Payment::status_id_failed => 'payment_failed'
549 549
 			);
550 550
 
551
-		return isset( $matches[$payment_status] ) ? $matches[$payment_status] : false;
551
+		return isset($matches[$payment_status]) ? $matches[$payment_status] : false;
552 552
 	}
553 553
 
554 554
 
@@ -561,22 +561,22 @@  discard block
 block discarded – undo
561 561
 	 * @param array $req_data This is the $_POST & $_GET data sent from EE_Admin Pages
562 562
 	 * @return bool          success/fail
563 563
 	 */
564
-	public static function process_resend( $req_data ) {
564
+	public static function process_resend($req_data) {
565 565
 		$regs_to_send = array();
566 566
 
567 567
 		//first let's make sure we have the reg id (needed for resending!);
568
-		if ( ! isset( $req_data['_REG_ID'] ) ) {
569
-			EE_Error::add_error( __('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
568
+		if ( ! isset($req_data['_REG_ID'])) {
569
+			EE_Error::add_error(__('Something went wrong because we\'re missing the registration ID', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
570 570
 			return false;
571 571
 		}
572 572
 
573 573
 		//if $req_data['_REG_ID'] is an array then let's group the registrations by transaction and reg status
574 574
 		// so we can only trigger messages per group.
575
-		if ( is_array( $req_data['_REG_ID'] ) ) {
576
-			foreach ( $req_data['_REG_ID'] as $reg_id ) {
577
-				$reg = EE_Registry::instance()->load_model( 'Registration' )->get_one_by_ID( $reg_id );
578
-				if ( ! $reg instanceof EE_Registration ) {
579
-					EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID'] ) );
575
+		if (is_array($req_data['_REG_ID'])) {
576
+			foreach ($req_data['_REG_ID'] as $reg_id) {
577
+				$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID($reg_id);
578
+				if ( ! $reg instanceof EE_Registration) {
579
+					EE_Error::add_error(sprintf(__('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID']));
580 580
 					return false;
581 581
 				}
582 582
 				$regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg;
@@ -584,11 +584,11 @@  discard block
 block discarded – undo
584 584
 		} else {
585 585
 			//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.
586 586
 			//get reg object from reg_id
587
-			$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID( $req_data['_REG_ID'] );
587
+			$reg = EE_Registry::instance()->load_model('Registration')->get_one_by_ID($req_data['_REG_ID']);
588 588
 
589 589
 			//if no reg object then send error
590
-			if ( ! $reg instanceof EE_Registration ) {
591
-				EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID'] ) );
590
+			if ( ! $reg instanceof EE_Registration) {
591
+				EE_Error::add_error(sprintf(__('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $req_data['_REG_ID']));
592 592
 				return false;
593 593
 			}
594 594
 
@@ -600,26 +600,26 @@  discard block
 block discarded – undo
600 600
 		$active_mts = self::$_EEMSG->get_active_message_types();
601 601
 		$success = false;
602 602
 		//loop through and send!
603
-		foreach( $regs_to_send as $status_group ) {
604
-			foreach ( $status_group as $status_id => $registrations ) {
605
-				if ( ! in_array( $status_match_array[ $status_id ], $active_mts ) ) {
603
+		foreach ($regs_to_send as $status_group) {
604
+			foreach ($status_group as $status_id => $registrations) {
605
+				if ( ! in_array($status_match_array[$status_id], $active_mts)) {
606 606
 					EE_Error::add_error(
607 607
 						sprintf(
608 608
 							__('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'),
609
-							$status_match_array[ $reg->status_ID() ],
610
-							'<a href="' . admin_url('admin.php?page=espresso_messages&action=settings') . '">',
609
+							$status_match_array[$reg->status_ID()],
610
+							'<a href="'.admin_url('admin.php?page=espresso_messages&action=settings').'">',
611 611
 							'</a>'
612 612
 						)
613 613
 					);
614 614
 					return false;
615 615
 				}
616 616
 
617
-				if ( self::$_EEMSG->send_message( $status_match_array[$status_id], array( $registrations, $status_id ) ) ) {
617
+				if (self::$_EEMSG->send_message($status_match_array[$status_id], array($registrations, $status_id))) {
618 618
 					EE_Error::overwrite_success();
619
-					EE_Error::add_success( __('The message for this registration has been re-sent', 'event_espresso') );
619
+					EE_Error::add_success(__('The message for this registration has been re-sent', 'event_espresso'));
620 620
 					$success = true;
621 621
 				} else {
622
-					EE_Error::add_error( __('Something went wrong and the message for this registration was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
622
+					EE_Error::add_error(__('Something went wrong and the message for this registration was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
623 623
 				}
624 624
 			}
625 625
 		}
@@ -641,12 +641,12 @@  discard block
 block discarded – undo
641 641
 	 * @param  EE_Payment $payment EE_payment object
642 642
 	 * @return bool              success/fail
643 643
 	 */
644
-	public static function process_admin_payment( $success = TRUE, EE_Payment $payment ) {
644
+	public static function process_admin_payment($success = TRUE, EE_Payment $payment) {
645 645
 		//we need to get the transaction object
646 646
 		$transaction = $payment->transaction();
647
-		if ( $transaction instanceof EE_Transaction ) {
648
-			$data = array( $transaction, $payment );
649
-			$message_type = self::_get_payment_message_type( $payment->STS_ID() );
647
+		if ($transaction instanceof EE_Transaction) {
648
+			$data = array($transaction, $payment);
649
+			$message_type = self::_get_payment_message_type($payment->STS_ID());
650 650
 
651 651
 			//if payment amount is less than 0 then switch to payment_refund message type.
652 652
 			$message_type = $payment->amount() < 0 ? 'payment_refund' : $message_type;
@@ -657,18 +657,18 @@  discard block
 block discarded – undo
657 657
 			self::_load_controller();
658 658
 			//verify this message type is present and active.  If it isn't then no message is sent.
659 659
 			$active_mts = self::$_EEMSG->get_active_message_types();
660
-			$message_type = in_array( $message_type, $active_mts ) ? $message_type : false;
660
+			$message_type = in_array($message_type, $active_mts) ? $message_type : false;
661 661
 
662 662
 
663
-			if ( $message_type ) {
663
+			if ($message_type) {
664 664
 
665
-				$success = self::$_EEMSG->send_message( $message_type, $data );
666
-				if ( ! $success ) {
667
-					EE_Error::add_error( __('Something went wrong and the payment confirmation was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
665
+				$success = self::$_EEMSG->send_message($message_type, $data);
666
+				if ( ! $success) {
667
+					EE_Error::add_error(__('Something went wrong and the payment confirmation was NOT resent', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
668 668
 				}
669 669
 
670 670
 			} else {
671
-				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__ );
671
+				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__);
672 672
 			}
673 673
 
674 674
 		}
@@ -686,12 +686,12 @@  discard block
 block discarded – undo
686 686
 	 * @param  int      	      $grp_id     a specific message template group id.
687 687
 	 * @return void
688 688
 	 */
689
-	public static function send_newsletter_message( $registrations, $grp_id ) {
689
+	public static function send_newsletter_message($registrations, $grp_id) {
690 690
 		//make sure mtp is id and set it in the EE_Request Handler later messages setup.
691
-		EE_Registry::instance()->REQ->set( 'GRP_ID', (int) $grp_id );
691
+		EE_Registry::instance()->REQ->set('GRP_ID', (int) $grp_id);
692 692
 
693 693
 		self::_load_controller();
694
-		self::$_EEMSG->send_message( 'newsletter', $registrations );
694
+		self::$_EEMSG->send_message('newsletter', $registrations);
695 695
 	}
696 696
 
697 697
 
@@ -706,9 +706,9 @@  discard block
 block discarded – undo
706 706
 	 * @param string 	$message_type
707 707
 	 * @return 	string
708 708
 	 */
709
-	public static function registration_message_trigger_url( $registration_message_trigger_url, EE_Registration $registration, $messenger = 'html', $message_type = 'invoice' ) {
709
+	public static function registration_message_trigger_url($registration_message_trigger_url, EE_Registration $registration, $messenger = 'html', $message_type = 'invoice') {
710 710
 		// whitelist $messenger
711
-		switch ( $messenger ) {
711
+		switch ($messenger) {
712 712
 			case 'pdf' :
713 713
 				$sending_messenger = 'pdf';
714 714
 				$generating_messenger = 'html';
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 				break;
721 721
 		}
722 722
 		// whitelist $message_type
723
-		switch ( $message_type ) {
723
+		switch ($message_type) {
724 724
 			case 'receipt' :
725 725
 				$message_type = 'receipt';
726 726
 				break;
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 				break;
731 731
 		}
732 732
 		// verify that both the messenger AND the message type are active
733
-		if ( EEH_MSG_Template::is_messenger_active( $sending_messenger ) && EEH_MSG_Template::is_mt_active( $message_type )) {
733
+		if (EEH_MSG_Template::is_messenger_active($sending_messenger) && EEH_MSG_Template::is_mt_active($message_type)) {
734 734
 			//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?)
735 735
 			$template_query_params = array(
736 736
 				'MTP_is_active' => TRUE,
@@ -739,16 +739,16 @@  discard block
 block discarded – undo
739 739
 				'Event.EVT_ID' => $registration->event_ID()
740 740
 			);
741 741
 			//get the message template group.
742
-			$msg_template_group = EEM_Message_Template_Group::instance()->get_one( array( $template_query_params ));
742
+			$msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params));
743 743
 			//if we don't have an EE_Message_Template_Group then return
744
-			if ( ! $msg_template_group instanceof EE_Message_Template_Group ) {
744
+			if ( ! $msg_template_group instanceof EE_Message_Template_Group) {
745 745
 				// remove EVT_ID from query params so that global templates get picked up
746
-				unset( $template_query_params[ 'Event.EVT_ID' ] );
746
+				unset($template_query_params['Event.EVT_ID']);
747 747
 				//get global template as the fallback
748
-				$msg_template_group = EEM_Message_Template_Group::instance()->get_one( array( $template_query_params ));
748
+				$msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params));
749 749
 			}
750 750
 			//if we don't have an EE_Message_Template_Group then return
751
-			if ( ! $msg_template_group instanceof EE_Message_Template_Group ) {
751
+			if ( ! $msg_template_group instanceof EE_Message_Template_Group) {
752 752
 				return '';
753 753
 			}
754 754
 			// generate the URL
@@ -778,16 +778,16 @@  discard block
 block discarded – undo
778 778
 	 * @param array $info
779 779
 	 * @param bool $display_request
780 780
 	 */
781
-	protected static function log( $class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false ) {
782
-		if ( WP_DEBUG && false ) {
783
-			if ( $transaction instanceof EE_Transaction ) {
781
+	protected static function log($class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false) {
782
+		if (WP_DEBUG && false) {
783
+			if ($transaction instanceof EE_Transaction) {
784 784
 				// don't serialize objects
785
-				$info = EEH_Debug_Tools::strip_objects( $info );
786
-				$info[ 'TXN_status' ] = $transaction->status_ID();
787
-				$info[ 'TXN_reg_steps' ] = $transaction->reg_steps();
788
-				if ( $transaction->ID() ) {
789
-					$index = 'EE_Transaction: ' . $transaction->ID();
790
-					EEH_Debug_Tools::log( $class, $func, $line, $info, $display_request, $index );
785
+				$info = EEH_Debug_Tools::strip_objects($info);
786
+				$info['TXN_status'] = $transaction->status_ID();
787
+				$info['TXN_reg_steps'] = $transaction->reg_steps();
788
+				if ($transaction->ID()) {
789
+					$index = 'EE_Transaction: '.$transaction->ID();
790
+					EEH_Debug_Tools::log($class, $func, $line, $info, $display_request, $index);
791 791
 				}
792 792
 			}
793 793
 		}
Please login to merge, or discard this patch.
modules/events_archive/EED_Events_Archive.module.php 1 patch
Spacing   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return EED_Events_Archive
44 44
 	 */
45 45
 	public static function instance() {
46
-		return parent::get_instance( __CLASS__ );
46
+		return parent::get_instance(__CLASS__);
47 47
 	}
48 48
 
49 49
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	 *  @return 	void
56 56
 	 */
57 57
 	public static function set_hooks() {
58
-		EE_Config::register_route( EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run' );
59
-		EE_Config::register_route( 'event_list', 'Events_Archive', 'event_list' );
60
-		add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 );
58
+		EE_Config::register_route(EE_Registry::instance()->CFG->core->event_cpt_slug, 'Events_Archive', 'run');
59
+		EE_Config::register_route('event_list', 'Events_Archive', 'event_list');
60
+		add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2);
61 61
 	}
62 62
 
63 63
 	/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 *  @return 	void
68 68
 	 */
69 69
 	public static function set_hooks_admin() {
70
-		add_action( 'wp_loaded', array( 'EED_Events_Archive', 'set_definitions' ), 2 );
70
+		add_action('wp_loaded', array('EED_Events_Archive', 'set_definitions'), 2);
71 71
 	}
72 72
 
73 73
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 *  @return 	void
81 81
 	 */
82 82
 	public static function set_definitions() {
83
-		define( 'EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
84
-		define( 'EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
83
+		define('EVENTS_ARCHIVE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
84
+		define('EVENTS_ARCHIVE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
85 85
 	}
86 86
 
87 87
 
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 	 *
92 92
 	 * @return \EE_Events_Archive_Config
93 93
 	 */
94
-	protected function set_config(){
95
-		$this->set_config_section( 'template_settings' );
96
-		$this->set_config_class( 'EE_Events_Archive_Config' );
97
-		$this->set_config_name( 'EED_Events_Archive' );
94
+	protected function set_config() {
95
+		$this->set_config_section('template_settings');
96
+		$this->set_config_class('EE_Events_Archive_Config');
97
+		$this->set_config_name('EED_Events_Archive');
98 98
 	}
99 99
 
100 100
 
@@ -106,35 +106,35 @@  discard block
 block discarded – undo
106 106
 	 * @param \EE_Events_Archive_Config $config
107 107
 	 * @return \EE_Template_Part_Manager
108 108
 	 */
109
-	public function initialize_template_parts( EE_Events_Archive_Config $config = null ) {
109
+	public function initialize_template_parts(EE_Events_Archive_Config $config = null) {
110 110
 		$config = $config instanceof EE_Events_Archive_Config ? $config : $this->config();
111 111
 		EEH_Autoloader::instance()->register_template_part_autoloaders();
112 112
 		$template_parts = new EE_Template_Part_Manager();
113 113
 		$template_parts->add_template_part(
114 114
 			'tickets',
115
-			__( 'Ticket Selector', 'event_espresso' ),
115
+			__('Ticket Selector', 'event_espresso'),
116 116
 			'content-espresso_events-tickets.php',
117 117
 			$config->display_order_tickets
118 118
 		);
119 119
 		$template_parts->add_template_part(
120 120
 			'datetimes',
121
-			__( 'Dates and Times', 'event_espresso' ),
121
+			__('Dates and Times', 'event_espresso'),
122 122
 			'content-espresso_events-datetimes.php',
123 123
 			$config->display_order_datetimes
124 124
 		);
125 125
 		$template_parts->add_template_part(
126 126
 			'event',
127
-			__( 'Event Description', 'event_espresso' ),
127
+			__('Event Description', 'event_espresso'),
128 128
 			'content-espresso_events-details.php',
129 129
 			$config->display_order_event
130 130
 		);
131 131
 		$template_parts->add_template_part(
132 132
 			'venue',
133
-			__( 'Venue Information', 'event_espresso' ),
133
+			__('Venue Information', 'event_espresso'),
134 134
 			'content-espresso_events-venues.php',
135 135
 			$config->display_order_venue
136 136
 		);
137
-		do_action( 'AHEE__EED_Event_Archive__initialize_template_parts', $template_parts );
137
+		do_action('AHEE__EED_Event_Archive__initialize_template_parts', $template_parts);
138 138
 		return $template_parts;
139 139
 	}
140 140
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param WP $WP
148 148
 	 * @return    void
149 149
 	 */
150
-	public function run( $WP ) {
151
-		do_action( 'AHEE__EED_Events_Archive__before_run' );
150
+	public function run($WP) {
151
+		do_action('AHEE__EED_Events_Archive__before_run');
152 152
 		// ensure valid EE_Events_Archive_Config() object exists
153 153
 		$this->set_config();
154 154
 		/** @type EE_Events_Archive_Config $config */
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
 		EEH_Event_Query::add_query_filters();
161 161
 		// set params that will get used by the filters
162 162
 		EEH_Event_Query::set_query_params(
163
-			'', 	// month
164
-			'', 	// category
165
-			$config->display_expired_events, 	// show_expired
166
-			'start_date', 	// orderby
163
+			'', // month
164
+			'', // category
165
+			$config->display_expired_events, // show_expired
166
+			'start_date', // orderby
167 167
 			'ASC' 	// sort
168 168
 		);
169 169
 		// check what template is loaded
170
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
170
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
171 171
 	}
172 172
 
173 173
 
@@ -199,31 +199,31 @@  discard block
 block discarded – undo
199 199
 	 * @param string $template
200 200
 	 * @return    string
201 201
 	 */
202
-	public function template_include( $template = '' ) {
202
+	public function template_include($template = '') {
203 203
 		// don't add content filter for dedicated EE child themes or private posts
204
-		if ( ! EEH_Template::is_espresso_theme() ) {
204
+		if ( ! EEH_Template::is_espresso_theme()) {
205 205
 			/** @type EE_Events_Archive_Config $config */
206 206
 			$config = $this->config();
207 207
 			// add status banner ?
208
-			if ( $config->display_status_banner ) {
209
-				add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 );
208
+			if ($config->display_status_banner) {
209
+				add_filter('the_title', array('EED_Events_Archive', 'the_title'), 100, 2);
210 210
 			}
211 211
 			// if NOT a custom template
212
-			if ( EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php'
213
-				|| apply_filters( 'FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE )
212
+			if (EE_Front_Controller::instance()->get_selected_template() != 'archive-espresso_events.php'
213
+				|| apply_filters('FHEE__EED_Event_Archive__template_include__allow_custom_selected_template', FALSE)
214 214
 			) {
215 215
 				// don't display entry meta because the existing theme will take care of that
216
-				add_filter( 'FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true' );
216
+				add_filter('FHEE__EED_Events_Archive__template_include__events_list_active', '__return_true');
217 217
 				// load functions.php file for the theme (loaded by WP if using child theme)
218 218
 				EEH_Template::load_espresso_theme_functions();
219 219
 				// because we don't know if the theme is using the_excerpt()
220
-				add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
220
+				add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1);
221 221
 				// or the_content
222
-				add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
222
+				add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1);
223 223
 				// and just in case they are running get_the_excerpt() which DESTROYS things
224
-				add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 );
224
+				add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1);
225 225
 				// don't display entry meta because the existing theme will take care of that
226
-				add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
226
+				add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
227 227
 			}
228 228
 		}
229 229
 		return $template;
@@ -238,17 +238,17 @@  discard block
 block discarded – undo
238 238
 	 * 	@param		string 	$excerpt
239 239
 	 * 	@return 		string
240 240
 	 */
241
-	public static function get_the_excerpt( $excerpt = '' ) {
242
-		if ( post_password_required() ) {
241
+	public static function get_the_excerpt($excerpt = '') {
242
+		if (post_password_required()) {
243 243
 			return $excerpt;
244 244
 		}
245
-		if ( apply_filters( 'FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false ) ) {
246
-			remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 );
247
-			remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 );
248
-			$excerpt = EED_Events_Archive::event_details( $excerpt );
245
+		if (apply_filters('FHEE__EED_Events_Archive__get_the_excerpt__theme_uses_get_the_excerpt', false)) {
246
+			remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100);
247
+			remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100);
248
+			$excerpt = EED_Events_Archive::event_details($excerpt);
249 249
 		} else {
250 250
 			EED_Events_Archive::$using_get_the_excerpt = true;
251
-			add_filter( 'wp_trim_excerpt', array( 'EED_Events_Archive', 'end_get_the_excerpt' ), 999, 1 );
251
+			add_filter('wp_trim_excerpt', array('EED_Events_Archive', 'end_get_the_excerpt'), 999, 1);
252 252
 		}
253 253
 		return $excerpt;
254 254
 	}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @param  string $text
263 263
 	 * @return string
264 264
 	 */
265
-	public static function end_get_the_excerpt( $text = '' ) {
265
+	public static function end_get_the_excerpt($text = '') {
266 266
 		EED_Events_Archive::$using_get_the_excerpt = false;
267 267
 		return $text;
268 268
 	}
@@ -277,10 +277,10 @@  discard block
 block discarded – undo
277 277
 	 * @param 		string 		$id
278 278
 	 * @return 		string
279 279
 	 */
280
-	public static function the_title( $title = '', $id = '' ) {
280
+	public static function the_title($title = '', $id = '') {
281 281
 	global $post;
282
-	if ( $post instanceof WP_Post ) {
283
-		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID  ) . $title :  $title;
282
+	if ($post instanceof WP_Post) {
283
+		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title;
284 284
 	}
285 285
 	return $title;
286 286
 }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 * 	@param		string 	$content
295 295
 	 * 	@return 		string
296 296
 	 */
297
-	public static function event_details( $content ) {
297
+	public static function event_details($content) {
298 298
 		global $post;
299 299
 		static $current_post_ID = 0;
300 300
 		if (
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
 			&& ! EED_Events_Archive::$using_get_the_excerpt
304 304
 			&& ! post_password_required()
305 305
 			&& (
306
-				apply_filters( 'FHEE__EES_Espresso_Events__process_shortcode__true', false )
307
-				|| ! apply_filters( 'FHEE__content_espresso_events__template_loaded', false )
306
+				apply_filters('FHEE__EES_Espresso_Events__process_shortcode__true', false)
307
+				|| ! apply_filters('FHEE__content_espresso_events__template_loaded', false)
308 308
 			)
309 309
 		) {
310 310
 			// Set current post ID to prevent showing content twice, but only if headers have definitely been sent.
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 			// We want to allow those plugins to still do their thing and have access to our content, but depending on
314 314
 			// how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice,
315 315
 			// so the following allows this filter to be applied multiple times, but only once for real
316
-			$current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0;
317
-			if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order ) {
316
+			$current_post_ID = did_action('loop_start') ? $post->ID : 0;
317
+			if (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->use_sortable_display_order) {
318 318
 				$content = \EED_Events_Archive::use_sortable_display_order();
319 319
 			} else {
320 320
 				$content = \EED_Events_Archive::use_filterable_display_order();
@@ -333,20 +333,20 @@  discard block
 block discarded – undo
333 333
 	 */
334 334
 	protected static function use_sortable_display_order() {
335 335
 		// no further password checks required atm
336
-		add_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' );
336
+		add_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true');
337 337
 		// we need to first remove this callback from being applied to the_content() or the_excerpt() (otherwise it will recurse and blow up the interweb)
338
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 );
339
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 );
340
-		remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 );
338
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100);
339
+		remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100);
340
+		remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1);
341 341
 		// now add additional content depending on whether event is using the_excerpt() or the_content()
342 342
 		EED_Events_Archive::instance()->template_parts = EED_Events_Archive::instance()->initialize_template_parts();
343
-		$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
344
-		$content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters( $content );
343
+		$content = EEH_Template::locate_template('content-espresso_events-details.php');
344
+		$content = EED_Events_Archive::instance()->template_parts->apply_template_part_filters($content);
345 345
 		// re-add our main filters (or else the next event won't have them)
346
-		add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
347
-		add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
348
-		add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 );
349
-		remove_filter( 'FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true' );
346
+		add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1);
347
+		add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1);
348
+		add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1);
349
+		remove_filter('FHEE__EED_Events_Archive__event_details__no_post_password_required', '__return_true');
350 350
 		return $content;
351 351
 	}
352 352
 
@@ -361,22 +361,22 @@  discard block
 block discarded – undo
361 361
 	protected static function use_filterable_display_order() {
362 362
 		// we need to first remove this callback from being applied to the_content()
363 363
 		// (otherwise it will recurse and blow up the interweb)
364
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 );
365
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 );
366
-		remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 );
364
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100);
365
+		remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100);
366
+		remove_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1);
367 367
 		//now add additional content depending on whether event is using the_excerpt() or the_content()
368 368
 		EED_Events_Archive::_add_additional_excerpt_filters();
369 369
 		EED_Events_Archive::_add_additional_content_filters();
370
-		do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters' );
370
+		do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters');
371 371
 		// now load our template
372
-		$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
372
+		$content = EEH_Template::locate_template('content-espresso_events-details.php');
373 373
 		// re-add our main filters (or else the next event won't have them)
374
-		add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
375
-		add_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100, 1 );
376
-		add_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1, 1 );
374
+		add_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100, 1);
375
+		add_filter('the_content', array('EED_Events_Archive', 'event_details'), 100, 1);
376
+		add_filter('get_the_excerpt', array('EED_Events_Archive', 'get_the_excerpt'), 1, 1);
377 377
 		// but remove the other filters so that they don't get applied to the next post
378 378
 		EED_Events_Archive::_remove_additional_events_archive_filters();
379
-		do_action( 'AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters' );
379
+		do_action('AHEE__EED_Events_Archive__use_filterable_display_order__after_remove_filters');
380 380
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
381 381
 		//return ! empty( $template ) ? $template : $content;
382 382
 		return $content;
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
 	 * 	@param		string 	$content
392 392
 	 *  	@return 		string
393 393
 	 */
394
-	public static function event_datetimes( $content ) {
395
-		if ( post_password_required() ) {
394
+	public static function event_datetimes($content) {
395
+		if (post_password_required()) {
396 396
 			return $content;
397 397
 		}
398
-		return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content;
398
+		return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content;
399 399
 	}
400 400
 
401 401
 	/**
@@ -405,11 +405,11 @@  discard block
 block discarded – undo
405 405
 	 * 	@param		string 	$content
406 406
 	 *  	@return 		string
407 407
 	 */
408
-	public static function event_tickets( $content ) {
409
-		if ( post_password_required() ) {
408
+	public static function event_tickets($content) {
409
+		if (post_password_required()) {
410 410
 			return $content;
411 411
 		}
412
-		return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content;
412
+		return EEH_Template::locate_template('content-espresso_events-tickets.php').$content;
413 413
 	}
414 414
 
415 415
 
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
 	 * @param    string $content
422 422
 	 * @return    string
423 423
 	 */
424
-	public static function event_venue( $content ) {
425
-		return EED_Events_Archive::event_venues( $content );
424
+	public static function event_venue($content) {
425
+		return EED_Events_Archive::event_venues($content);
426 426
 	}
427 427
 
428 428
 	/**
@@ -432,11 +432,11 @@  discard block
 block discarded – undo
432 432
 	 * 	@param		string 	$content
433 433
 	 *  	@return 		string
434 434
 	 */
435
-	public static function event_venues( $content ) {
436
-		if ( post_password_required() ) {
435
+	public static function event_venues($content) {
436
+		if (post_password_required()) {
437 437
 			return $content;
438 438
 		}
439
-		return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' );
439
+		return $content.EEH_Template::locate_template('content-espresso_events-venues.php');
440 440
 	}
441 441
 
442 442
 
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
 	 * @return        void
449 449
 	 */
450 450
 	private static function _add_additional_excerpt_filters() {
451
-		add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 );
452
-		add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 );
453
-		add_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 );
451
+		add_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110, 1);
452
+		add_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120, 1);
453
+		add_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130, 1);
454 454
 	}
455 455
 
456 456
 
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
 	 * @return        void
463 463
 	 */
464 464
 	private static function _add_additional_content_filters() {
465
-		add_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110, 1 );
466
-		add_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120, 1 );
467
-		add_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130, 1 );
465
+		add_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110, 1);
466
+		add_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120, 1);
467
+		add_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130, 1);
468 468
 	}
469 469
 
470 470
 
@@ -476,12 +476,12 @@  discard block
 block discarded – undo
476 476
 	 * @return        void
477 477
 	 */
478 478
 	private static function _remove_additional_events_archive_filters() {
479
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 );
480
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 );
481
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 );
482
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 );
483
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 );
484
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 );
479
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110);
480
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120);
481
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130);
482
+		remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110);
483
+		remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120);
484
+		remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130);
485 485
 	}
486 486
 
487 487
 
@@ -494,17 +494,17 @@  discard block
 block discarded – undo
494 494
 	 */
495 495
 	public static function remove_all_events_archive_filters() {
496 496
 		//remove_filter( 'get_the_excerpt', array( 'EED_Events_Archive', 'get_the_excerpt' ), 1 );
497
-		remove_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100 );
498
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_details' ), 100 );
499
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_datetimes' ), 110 );
500
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_tickets' ), 120 );
501
-		remove_filter( 'the_excerpt', array( 'EED_Events_Archive', 'event_venues' ), 130 );
502
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_details' ), 100 );
503
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_datetimes' ), 110 );
504
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_tickets' ), 120 );
505
-		remove_filter( 'the_content', array( 'EED_Events_Archive', 'event_venues' ), 130 );
497
+		remove_filter('the_title', array('EED_Events_Archive', 'the_title'), 100);
498
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_details'), 100);
499
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_datetimes'), 110);
500
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_tickets'), 120);
501
+		remove_filter('the_excerpt', array('EED_Events_Archive', 'event_venues'), 130);
502
+		remove_filter('the_content', array('EED_Events_Archive', 'event_details'), 100);
503
+		remove_filter('the_content', array('EED_Events_Archive', 'event_datetimes'), 110);
504
+		remove_filter('the_content', array('EED_Events_Archive', 'event_tickets'), 120);
505
+		remove_filter('the_content', array('EED_Events_Archive', 'event_venues'), 130);
506 506
 		// don't display entry meta because the existing theme will take care of that
507
-		remove_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
507
+		remove_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
508 508
 	}
509 509
 
510 510
 
@@ -519,12 +519,12 @@  discard block
 block discarded – undo
519 519
 	 *  @return 	void
520 520
 	 */
521 521
 	public function load_event_list_assets() {
522
-		do_action( 'AHEE__EED_Events_Archive__before_load_assets' );
523
-		add_filter( 'FHEE_load_EE_Session', '__return_true' );
524
-		add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
525
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
526
-		if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
527
-			add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
522
+		do_action('AHEE__EED_Events_Archive__before_load_assets');
523
+		add_filter('FHEE_load_EE_Session', '__return_true');
524
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
525
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
526
+		if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
527
+			add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
528 528
 		}
529 529
 	}
530 530
 
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 	 */
542 542
 	public function wp_enqueue_scripts() {
543 543
 		// get some style
544
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) {
544
+		if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) {
545 545
 			// first check uploads folder
546
-			if ( EEH_File::is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
547
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
546
+			if (EEH_File::is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
547
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
548 548
 			} else {
549 549
 		}
550
-		wp_enqueue_style( $this->theme );
550
+		wp_enqueue_style($this->theme);
551 551
 
552 552
 	}
553 553
 }
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 	 */
566 566
 	public static function template_settings_form() {
567 567
 	$template_settings = EE_Registry::instance()->CFG->template_settings;
568
-	$template_settings->EED_Events_Archive = isset( $template_settings->EED_Events_Archive ) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config();
569
-	$template_settings->EED_Events_Archive = apply_filters( 'FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive );
568
+	$template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config();
569
+	$template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive);
570 570
 	$events_archive_settings = array(
571 571
 		'display_status_banner' => 0,
572 572
 		'display_description' => 1,
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
 		'display_venue' => 0,
576 576
 		'display_expired_events' => 0
577 577
 	);
578
-	$events_archive_settings = array_merge( $events_archive_settings, (array)$template_settings->EED_Events_Archive );
579
-	EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings );
578
+	$events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive);
579
+	EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $events_archive_settings);
580 580
 }
581 581
 
582 582
 
@@ -592,16 +592,16 @@  discard block
 block discarded – undo
592 592
 	 *  @param 	EE_Request_Handler $REQ
593 593
 	 *  @return 	EE_Template_Config
594 594
 	 */
595
-	public static function update_template_settings( $CFG, $REQ ) {
595
+	public static function update_template_settings($CFG, $REQ) {
596 596
 		$CFG->EED_Events_Archive = new EE_Events_Archive_Config();
597 597
 		// unless we are resetting the config...
598
-		if ( ! isset( $REQ['EED_Events_Archive_reset_event_list_settings'] ) || absint( $REQ['EED_Events_Archive_reset_event_list_settings'] ) !== 1 ) {
599
-			$CFG->EED_Events_Archive->display_status_banner = isset( $REQ['EED_Events_Archive_display_status_banner'] ) ? absint( $REQ['EED_Events_Archive_display_status_banner'] ) : 0;
600
-			$CFG->EED_Events_Archive->display_description = isset( $REQ['EED_Events_Archive_display_description'] ) ? absint( $REQ['EED_Events_Archive_display_description'] ) : 1;
601
-			$CFG->EED_Events_Archive->display_ticket_selector = isset( $REQ['EED_Events_Archive_display_ticket_selector'] ) ? absint( $REQ['EED_Events_Archive_display_ticket_selector'] ) : 0;
602
-			$CFG->EED_Events_Archive->display_datetimes = isset( $REQ['EED_Events_Archive_display_datetimes'] ) ? absint( $REQ['EED_Events_Archive_display_datetimes'] ) : 1;
603
-			$CFG->EED_Events_Archive->display_venue = isset( $REQ['EED_Events_Archive_display_venue'] ) ? absint( $REQ['EED_Events_Archive_display_venue'] ) : 0;
604
-			$CFG->EED_Events_Archive->display_expired_events = isset( $REQ['EED_Events_Archive_display_expired_events'] ) ? absint( $REQ['EED_Events_Archive_display_expired_events'] ) : 0;			}
598
+		if ( ! isset($REQ['EED_Events_Archive_reset_event_list_settings']) || absint($REQ['EED_Events_Archive_reset_event_list_settings']) !== 1) {
599
+			$CFG->EED_Events_Archive->display_status_banner = isset($REQ['EED_Events_Archive_display_status_banner']) ? absint($REQ['EED_Events_Archive_display_status_banner']) : 0;
600
+			$CFG->EED_Events_Archive->display_description = isset($REQ['EED_Events_Archive_display_description']) ? absint($REQ['EED_Events_Archive_display_description']) : 1;
601
+			$CFG->EED_Events_Archive->display_ticket_selector = isset($REQ['EED_Events_Archive_display_ticket_selector']) ? absint($REQ['EED_Events_Archive_display_ticket_selector']) : 0;
602
+			$CFG->EED_Events_Archive->display_datetimes = isset($REQ['EED_Events_Archive_display_datetimes']) ? absint($REQ['EED_Events_Archive_display_datetimes']) : 1;
603
+			$CFG->EED_Events_Archive->display_venue = isset($REQ['EED_Events_Archive_display_venue']) ? absint($REQ['EED_Events_Archive_display_venue']) : 0;
604
+			$CFG->EED_Events_Archive->display_expired_events = isset($REQ['EED_Events_Archive_display_expired_events']) ? absint($REQ['EED_Events_Archive_display_expired_events']) : 0; }
605 605
 		return $CFG;
606 606
 	}
607 607
 
@@ -614,10 +614,10 @@  discard block
 block discarded – undo
614 614
 	 * @param string $extra_class
615 615
 	 * @return    string
616 616
 	 */
617
-	public static function event_list_css( $extra_class = '' ) {
618
-		$event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array();
617
+	public static function event_list_css($extra_class = '') {
618
+		$event_list_css = ! empty($extra_class) ? array($extra_class) : array();
619 619
 		$event_list_css[] = 'espresso-event-list-event';
620
-		return implode( ' ', $event_list_css );
620
+		return implode(' ', $event_list_css);
621 621
 	}
622 622
 
623 623
 
@@ -644,9 +644,9 @@  discard block
 block discarded – undo
644 644
 	 * @param $value
645 645
 	 * @return    bool
646 646
 	 */
647
-	public static function display_description( $value ) {
647
+	public static function display_description($value) {
648 648
 		$config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive;
649
-		$display_description= isset( $config->display_description ) ? $config->display_description : 1;
649
+		$display_description = isset($config->display_description) ? $config->display_description : 1;
650 650
 		return $display_description === $value ? TRUE : FALSE;
651 651
 	}
652 652
 
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 	 */
660 660
 	public static function display_ticket_selector() {
661 661
 		$config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive;
662
-		return isset( $config->display_ticket_selector ) && $config->display_ticket_selector ? TRUE : FALSE;
662
+		return isset($config->display_ticket_selector) && $config->display_ticket_selector ? TRUE : FALSE;
663 663
 	}
664 664
 
665 665
 
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	 */
673 673
 	public static function display_venue() {
674 674
 		$config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive;
675
-		return isset( $config->display_venue ) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE;
675
+		return isset($config->display_venue) && $config->display_venue && EEH_Venue_View::venue_name() ? TRUE : FALSE;
676 676
 	}
677 677
 
678 678
 
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 	 */
685 685
 	public static function display_datetimes() {
686 686
 		$config = EE_Registry::instance()->CFG->template_settings->EED_Events_Archive;
687
-		return isset( $config->display_datetimes ) && $config->display_datetimes ? TRUE : FALSE;
687
+		return isset($config->display_datetimes) && $config->display_datetimes ? TRUE : FALSE;
688 688
 }
689 689
 
690 690
 
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	 *  @return 	string
700 700
 	 */
701 701
 	public static function event_list_title() {
702
-		return apply_filters( 'FHEE__archive_espresso_events_template__upcoming_events_h1', __( 'Upcoming Events', 'event_espresso' ));
702
+		return apply_filters('FHEE__archive_espresso_events_template__upcoming_events_h1', __('Upcoming Events', 'event_espresso'));
703 703
 	}
704 704
 
705 705
 
@@ -708,11 +708,11 @@  discard block
 block discarded – undo
708 708
 	/**
709 709
 	 * 	@since 4.4.0
710 710
 	 */
711
-	public static function _doing_it_wrong_notice( $function = '' ) {
711
+	public static function _doing_it_wrong_notice($function = '') {
712 712
 		EE_Error::doing_it_wrong(
713 713
 			__FUNCTION__,
714 714
 			sprintf(
715
-				__( 'EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso' ),
715
+				__('EED_Events_Archive::%1$s was moved to EEH_Event_Query::%1$s:%2$sPlease update your existing code because the method it calls will be removed in version %3$s', 'event_espresso'),
716 716
 				$function,
717 717
 				'<br />',
718 718
 				'4.6.0'
@@ -734,89 +734,89 @@  discard block
 block discarded – undo
734 734
 	 * 	@deprecated
735 735
 	 * 	@since 4.4.0
736 736
 	 */
737
-	public function posts_fields( $SQL, WP_Query $wp_query ) {
738
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
739
-		return EEH_Event_Query::posts_fields( $SQL, $wp_query );
737
+	public function posts_fields($SQL, WP_Query $wp_query) {
738
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
739
+		return EEH_Event_Query::posts_fields($SQL, $wp_query);
740 740
 	}
741 741
 	/**
742 742
 	 * 	@deprecated
743 743
 	 * 	@since 4.4.0
744 744
 	 */
745
-	public static function posts_fields_sql_for_orderby( $orderby_params = array() ) {
746
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
747
-		return EEH_Event_Query::posts_fields_sql_for_orderby( $orderby_params );
745
+	public static function posts_fields_sql_for_orderby($orderby_params = array()) {
746
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
747
+		return EEH_Event_Query::posts_fields_sql_for_orderby($orderby_params);
748 748
 	}
749 749
 	/**
750 750
 	 * 	@deprecated
751 751
 	 * 	@since 4.4.0
752 752
 	 */
753
-	public function posts_join( $SQL, WP_Query $wp_query ) {
754
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
755
-		return EEH_Event_Query::posts_join( $SQL, $wp_query );
753
+	public function posts_join($SQL, WP_Query $wp_query) {
754
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
755
+		return EEH_Event_Query::posts_join($SQL, $wp_query);
756 756
 	}
757 757
 	/**
758 758
 	 * 	@deprecated
759 759
 	 * 	@since 4.4.0
760 760
 	 */
761
-	public static function posts_join_sql_for_terms( $join_terms = NULL ) {
762
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
763
-		return EEH_Event_Query::posts_join_sql_for_terms( $join_terms );
761
+	public static function posts_join_sql_for_terms($join_terms = NULL) {
762
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
763
+		return EEH_Event_Query::posts_join_sql_for_terms($join_terms);
764 764
 	}
765 765
 	/**
766 766
 	 * 	@deprecated
767 767
 	 * 	@since 4.4.0
768 768
 	 */
769
-	public static function posts_join_for_orderby( $orderby_params = array() ) {
770
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
771
-		return EEH_Event_Query::posts_join_for_orderby( $orderby_params );
769
+	public static function posts_join_for_orderby($orderby_params = array()) {
770
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
771
+		return EEH_Event_Query::posts_join_for_orderby($orderby_params);
772 772
 	}
773 773
 	/**
774 774
 	 * 	@deprecated
775 775
 	 * 	@since 4.4.0
776 776
 	 */
777
-	public function posts_where( $SQL, WP_Query $wp_query ) {
778
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
779
-		return EEH_Event_Query::posts_where( $SQL, $wp_query );
777
+	public function posts_where($SQL, WP_Query $wp_query) {
778
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
779
+		return EEH_Event_Query::posts_where($SQL, $wp_query);
780 780
 	}
781 781
 	/**
782 782
 	 * 	@deprecated
783 783
 	 * 	@since 4.4.0
784 784
 	 */
785
-	public static function posts_where_sql_for_show_expired( $show_expired = FALSE ) {
786
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
787
-		return EEH_Event_Query::posts_where_sql_for_show_expired( $show_expired );
785
+	public static function posts_where_sql_for_show_expired($show_expired = FALSE) {
786
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
787
+		return EEH_Event_Query::posts_where_sql_for_show_expired($show_expired);
788 788
 	}
789 789
 	/**
790 790
 	 * 	@deprecated
791 791
 	 * 	@since 4.4.0
792 792
 	 */
793
-	public static function posts_where_sql_for_event_category_slug( $event_category_slug = NULL ) {
794
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
795
-		return EEH_Event_Query::posts_where_sql_for_event_category_slug( $event_category_slug );
793
+	public static function posts_where_sql_for_event_category_slug($event_category_slug = NULL) {
794
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
795
+		return EEH_Event_Query::posts_where_sql_for_event_category_slug($event_category_slug);
796 796
 	}
797 797
 	/**
798 798
 	 * 	@deprecated
799 799
 	 * 	@since 4.4.0
800 800
 	 */
801
-	public static function posts_where_sql_for_event_list_month( $month = NULL ) {
802
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
803
-		return EEH_Event_Query::posts_where_sql_for_event_list_month( $month );
801
+	public static function posts_where_sql_for_event_list_month($month = NULL) {
802
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
803
+		return EEH_Event_Query::posts_where_sql_for_event_list_month($month);
804 804
 	}
805 805
 	/**
806 806
 	 * 	@deprecated
807 807
 	 * 	@since 4.4.0
808 808
 	 */
809
-	public function posts_orderby( $SQL, WP_Query $wp_query ) {
810
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
811
-		return EEH_Event_Query::posts_orderby( $SQL, $wp_query );
809
+	public function posts_orderby($SQL, WP_Query $wp_query) {
810
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
811
+		return EEH_Event_Query::posts_orderby($SQL, $wp_query);
812 812
 	}
813 813
 	/**
814 814
 	 * 	@deprecated
815 815
 	 * 	@since 4.4.0
816 816
 	 */
817
-	public static function posts_orderby_sql( $orderby_params = array(), $sort = 'ASC' ) {
818
-		EED_Events_Archive::_doing_it_wrong_notice( __FUNCTION__ );
819
-		return EEH_Event_Query::posts_orderby_sql( $orderby_params, $sort );
817
+	public static function posts_orderby_sql($orderby_params = array(), $sort = 'ASC') {
818
+		EED_Events_Archive::_doing_it_wrong_notice(__FUNCTION__);
819
+		return EEH_Event_Query::posts_orderby_sql($orderby_params, $sort);
820 820
 	}
821 821
 
822 822
 
@@ -847,8 +847,8 @@  discard block
 block discarded – undo
847 847
  * @param string $extra_class
848 848
  * @return string
849 849
  */
850
-function espresso_event_list_css( $extra_class = '' ) {
851
-	return EED_Events_Archive::event_list_css( $extra_class );
850
+function espresso_event_list_css($extra_class = '') {
851
+	return EED_Events_Archive::event_list_css($extra_class);
852 852
 }
853 853
 
854 854
 /**
@@ -862,14 +862,14 @@  discard block
 block discarded – undo
862 862
  * @return bool
863 863
  */
864 864
 function espresso_display_full_description_in_event_list() {
865
-	return EED_Events_Archive::display_description( 2 );
865
+	return EED_Events_Archive::display_description(2);
866 866
 }
867 867
 
868 868
 /**
869 869
  * @return bool
870 870
  */
871 871
 function espresso_display_excerpt_in_event_list() {
872
-	return EED_Events_Archive::display_description( 1 );
872
+	return EED_Events_Archive::display_description(1);
873 873
 }
874 874
 
875 875
 /**
Please login to merge, or discard this patch.
modules/ical/EED_Ical.module.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @return EED_Ical
33 33
 	 */
34 34
 	public static function instance() {
35
-		return parent::get_instance( __CLASS__ );
35
+		return parent::get_instance(__CLASS__);
36 36
 	}
37 37
 
38 38
 
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public static function set_hooks() {
47 47
 		// create download buttons
48
-		add_filter( 'FHEE__espresso_list_of_event_dates__datetime_html', array( 'EED_Ical', 'generate_add_to_iCal_button' ), 10, 2 );
48
+		add_filter('FHEE__espresso_list_of_event_dates__datetime_html', array('EED_Ical', 'generate_add_to_iCal_button'), 10, 2);
49 49
 		 // process ics download request
50
-		EE_Config::register_route( 'download_ics_file', 'EED_Ical', 'download_ics_file' );
50
+		EE_Config::register_route('download_ics_file', 'EED_Ical', 'download_ics_file');
51 51
 	}
52 52
 
53 53
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param    WP $WP
71 71
 	 * @return    void
72 72
 	 */
73
-	public function run( $WP ) {}
73
+	public function run($WP) {}
74 74
 
75 75
 
76 76
 
@@ -82,30 +82,30 @@  discard block
 block discarded – undo
82 82
 	 * @param $datetime
83 83
 	 * @return    string
84 84
 	 */
85
-	public static function generate_add_to_iCal_button( $html, $datetime ) {
85
+	public static function generate_add_to_iCal_button($html, $datetime) {
86 86
 		// first verify a proper datetime object has been received
87
-		if ( $datetime instanceof EE_Datetime ) {
87
+		if ($datetime instanceof EE_Datetime) {
88 88
 			// set whether a link or submit button is shown
89
-			$iCal_type = apply_filters( 'FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit' );
89
+			$iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
90 90
 			// generate a link to the route we registered in set_hooks()
91
-			$URL = add_query_arg( array( 'ee' => 'download_ics_file', 'ics_id' => $datetime->ID() ), site_url() );
91
+			$URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
92 92
 			// what type ?
93
-			switch ( $iCal_type ) {
93
+			switch ($iCal_type) {
94 94
 				// submit buttons appear as buttons and are very compatible with a theme's style
95 95
 				case 'submit' :
96
-					$html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
97
-					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '"/>';
96
+					$html .= '<form id="download-iCal-frm-'.$datetime->ID().'" class="download-iCal-frm" action="'.$URL.'" method="post" >';
97
+					$html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="'.__('Add to iCal Calendar', 'event_espresso').'"/>';
98 98
 					$html .= '</form>';
99 99
 					break;
100 100
 				// buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
101 101
 				case 'button' :
102
-					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
102
+					$html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
103 103
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
104 104
 					$html .= '</a>';
105 105
 					break;
106 106
 				// links are just links that use the calendar dashicon
107 107
 				case 'icon' :
108
-					$html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __( 'Add to iCal Calendar', 'event_espresso' ) . '">';
108
+					$html .= '<a class="ee-ical-lnk" href="'.$URL.'" title="'.__('Add to iCal Calendar', 'event_espresso').'">';
109 109
 					$html .= ' <span class="dashicons dashicons-calendar"></span>';
110 110
 					$html .= '</a>';
111 111
 					break;
@@ -123,72 +123,72 @@  discard block
 block discarded – undo
123 123
 	 *  @return 	void
124 124
 	 */
125 125
 	public static function download_ics_file() {
126
-		if ( EE_Registry::instance()->REQ->is_set( 'ics_id' )) {
127
-			$DTT_ID = absint( EE_Registry::instance()->REQ->get( 'ics_id' ));
128
-			$datetime = EE_Registry::instance()->load_model( 'Datetime' )->get_one_by_ID( $DTT_ID );
129
-			if ( $datetime instanceof EE_Datetime ) {
126
+		if (EE_Registry::instance()->REQ->is_set('ics_id')) {
127
+			$DTT_ID = absint(EE_Registry::instance()->REQ->get('ics_id'));
128
+			$datetime = EE_Registry::instance()->load_model('Datetime')->get_one_by_ID($DTT_ID);
129
+			if ($datetime instanceof EE_Datetime) {
130 130
 				// get related event, venues, and event categories
131 131
 				$event = $datetime->event();
132 132
 				// get related category Term object and it's name
133 133
 				$category = $event->first_event_category();
134
-				if ( $category instanceof EE_Term ) {
134
+				if ($category instanceof EE_Term) {
135 135
 					$category = $category->name();
136 136
 				}
137 137
 				$location = '';
138 138
 				// get first related venue and convert to CSV string
139
-				$venue = $event->venues(array( 'limit'=>1 ));
140
-				if ( is_array( $venue ) && ! empty( $venue )) {
141
-					$venue = array_shift( $venue );
142
-					if ( $venue instanceof EE_Venue ) {
143
-						$location = espresso_venue_raw_address( 'inline', $venue->ID(), FALSE );
139
+				$venue = $event->venues(array('limit'=>1));
140
+				if (is_array($venue) && ! empty($venue)) {
141
+					$venue = array_shift($venue);
142
+					if ($venue instanceof EE_Venue) {
143
+						$location = espresso_venue_raw_address('inline', $venue->ID(), FALSE);
144 144
 					}
145 145
 				}
146 146
 				// set variables, escape strings, convert timestamps to ics format, etc
147
-				$filename = $event->slug() . '-' . $datetime->start_date( 'Y-m-d' ) . '.ics';
148
-				$organizer = EED_Ical::_escape_ICal_data( EE_Registry::instance()->CFG->organization->name );
149
-				$UID = EED_Ical::_escape_ICal_data( md5( $event->name() . $event->ID() . $datetime->ID() ));
150
-				$org_email = EED_Ical::_escape_ICal_data( $datetime->ID() );
151
-				$timestamp = date( EED_Ical::iCal_datetime_format );
152
-				$location = EED_Ical::_escape_ICal_data( $location );
153
-				$summary = EED_Ical::_escape_ICal_data( $event->name() );
154
-				$description = EED_Ical::_escape_ICal_description( wp_strip_all_tags( $event->description() ));
147
+				$filename = $event->slug().'-'.$datetime->start_date('Y-m-d').'.ics';
148
+				$organizer = EED_Ical::_escape_ICal_data(EE_Registry::instance()->CFG->organization->name);
149
+				$UID = EED_Ical::_escape_ICal_data(md5($event->name().$event->ID().$datetime->ID()));
150
+				$org_email = EED_Ical::_escape_ICal_data($datetime->ID());
151
+				$timestamp = date(EED_Ical::iCal_datetime_format);
152
+				$location = EED_Ical::_escape_ICal_data($location);
153
+				$summary = EED_Ical::_escape_ICal_data($event->name());
154
+				$description = EED_Ical::_escape_ICal_description(wp_strip_all_tags($event->description()));
155 155
 				$status = $datetime->get_active_status();
156 156
 				$status = $status == EE_Datetime::cancelled ? 'Cancelled' : 'Confirmed';
157
-				$status = EED_Ical::_escape_ICal_data( $status );
158
-				$categories = EED_Ical::_escape_ICal_data( $category );
159
-				$url = EED_Ical::_escape_ICal_data( get_permalink( $event->ID() ));
160
-				$dtt_start = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->start() ));
161
-				$dtt_end = EED_Ical::_escape_ICal_data( date( EED_Ical::iCal_datetime_format, $datetime->end() ));
157
+				$status = EED_Ical::_escape_ICal_data($status);
158
+				$categories = EED_Ical::_escape_ICal_data($category);
159
+				$url = EED_Ical::_escape_ICal_data(get_permalink($event->ID()));
160
+				$dtt_start = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->start()));
161
+				$dtt_end = EED_Ical::_escape_ICal_data(date(EED_Ical::iCal_datetime_format, $datetime->end()));
162 162
 				// set headers
163
-				header( 'Content-type: text/calendar; charset=utf-8' );
164
-				header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
165
-				header( 'Cache-Control: private, max-age=0, must-revalidate' );
166
-				header( 'Pragma: public' );
167
-				header( 'Content-Type: application/octet-stream' );
168
-				header( 'Content-Type: application/force-download' );
169
-				header( 'Cache-Control: no-cache, must-revalidate' );
170
-				header( 'Content-Transfer-Encoding: binary' );
171
-				header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); // past date
172
-				ini_set( 'zlib.output_compression', '0' );
163
+				header('Content-type: text/calendar; charset=utf-8');
164
+				header('Content-Disposition: attachment; filename="'.$filename.'"');
165
+				header('Cache-Control: private, max-age=0, must-revalidate');
166
+				header('Pragma: public');
167
+				header('Content-Type: application/octet-stream');
168
+				header('Content-Type: application/force-download');
169
+				header('Cache-Control: no-cache, must-revalidate');
170
+				header('Content-Transfer-Encoding: binary');
171
+				header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // past date
172
+				ini_set('zlib.output_compression', '0');
173 173
 				// echo the output
174
-				echo "BEGIN:VCALENDAR" . PHP_EOL;
175
-				echo "VERSION:2.0" . PHP_EOL;
176
-				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN" . PHP_EOL;
177
-				echo "CALSCALE:GREGORIAN" . PHP_EOL;
178
-				echo "BEGIN:VEVENT" . PHP_EOL;
179
-				echo "UID:{$UID}" . PHP_EOL;
180
-				echo "ORGANIZER:MAILTO:{$org_email}" . PHP_EOL;
181
-				echo "DTSTAMP:{$timestamp}" . PHP_EOL;
182
-				echo "LOCATION:{$location}" . PHP_EOL;
183
-				echo "SUMMARY:{$summary}" . PHP_EOL;
184
-				echo "DESCRIPTION:{$description}" . PHP_EOL;
185
-				echo "STATUS:{$status}" . PHP_EOL;
186
-				echo "CATEGORIES:{$categories}" . PHP_EOL;
187
-				echo "URL;VALUE=URI:{$url}" . PHP_EOL;
188
-				echo "DTSTART:{$dtt_start}" . PHP_EOL;
189
-				echo "DTEND:{$dtt_end}" . PHP_EOL;
190
-				echo "END:VEVENT" . PHP_EOL;
191
-				echo "END:VCALENDAR" . PHP_EOL;
174
+				echo "BEGIN:VCALENDAR".PHP_EOL;
175
+				echo "VERSION:2.0".PHP_EOL;
176
+				echo "PRODID:-//{$organizer}//NONSGML PDA Calendar Version 1.0//EN".PHP_EOL;
177
+				echo "CALSCALE:GREGORIAN".PHP_EOL;
178
+				echo "BEGIN:VEVENT".PHP_EOL;
179
+				echo "UID:{$UID}".PHP_EOL;
180
+				echo "ORGANIZER:MAILTO:{$org_email}".PHP_EOL;
181
+				echo "DTSTAMP:{$timestamp}".PHP_EOL;
182
+				echo "LOCATION:{$location}".PHP_EOL;
183
+				echo "SUMMARY:{$summary}".PHP_EOL;
184
+				echo "DESCRIPTION:{$description}".PHP_EOL;
185
+				echo "STATUS:{$status}".PHP_EOL;
186
+				echo "CATEGORIES:{$categories}".PHP_EOL;
187
+				echo "URL;VALUE=URI:{$url}".PHP_EOL;
188
+				echo "DTSTART:{$dtt_start}".PHP_EOL;
189
+				echo "DTEND:{$dtt_end}".PHP_EOL;
190
+				echo "END:VEVENT".PHP_EOL;
191
+				echo "END:VCALENDAR".PHP_EOL;
192 192
 			}
193 193
 		}
194 194
 		die();
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	 *  	@param	string $string
204 204
 	 *  	@return	string
205 205
 	 */
206
-	private static function _escape_ICal_data( $string = '' ) {
207
-		return preg_replace( '/([\,;])/', '\\\$1', $string );
206
+	private static function _escape_ICal_data($string = '') {
207
+		return preg_replace('/([\,;])/', '\\\$1', $string);
208 208
 	}
209 209
 
210 210
 	/**
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 	 *  	@param	string $description
215 215
 	 *  	@return	string
216 216
 	 */
217
-	private static function _escape_ICal_description( $description = '' ) {
217
+	private static function _escape_ICal_description($description = '') {
218 218
 			
219 219
 			//Escape spcial chars within the decription
220
-			$description = EED_Ical::_escape_ICal_data( $description );
220
+			$description = EED_Ical::_escape_ICal_data($description);
221 221
 
222 222
 		    //Remove line breaks and output in iCal format
223
-		    $description = str_replace( array( "\r\n", "\n"), '\n', $description );
223
+		    $description = str_replace(array("\r\n", "\n"), '\n', $description);
224 224
 
225 225
 		return $description;
226 226
 	}
Please login to merge, or discard this patch.
modules/event_single/EED_Event_Single.module.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @return EED_Event_Single
41 41
 	 */
42 42
 	public static function instance() {
43
-		return parent::get_instance( __CLASS__ );
43
+		return parent::get_instance(__CLASS__);
44 44
 	}
45 45
 
46 46
 
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	 *  @return 	void
53 53
 	 */
54 54
 	public static function set_hooks() {
55
-		add_filter( 'FHEE_run_EE_wp', '__return_true' );
56
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
57
-		EE_Config::register_route( __( 'event', 'event_espresso' ), 'Event_Single', 'run' );
55
+		add_filter('FHEE_run_EE_wp', '__return_true');
56
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
57
+		EE_Config::register_route(__('event', 'event_espresso'), 'Event_Single', 'run');
58 58
 	}
59 59
 
60 60
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *  @return 	void
65 65
 	 */
66 66
 	public static function set_hooks_admin() {
67
-		add_action( 'wp_loaded', array( 'EED_Event_Single', 'set_definitions' ), 2 );
67
+		add_action('wp_loaded', array('EED_Event_Single', 'set_definitions'), 2);
68 68
 	}
69 69
 
70 70
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	 * @return void
79 79
 	 */
80 80
 	public static function set_definitions() {
81
-		define( 'EVENT_SINGLE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS );
82
-		define( 'EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS );
81
+		define('EVENT_SINGLE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS);
82
+		define('EVENT_SINGLE_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS);
83 83
 	}
84 84
 
85 85
 
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @void
91 91
 	 */
92
-	protected function set_config(){
93
-		$this->set_config_section( 'template_settings' );
94
-		$this->set_config_class( 'EE_Event_Single_Config' );
95
-		$this->set_config_name( 'EED_Event_Single' );
92
+	protected function set_config() {
93
+		$this->set_config_section('template_settings');
94
+		$this->set_config_class('EE_Event_Single_Config');
95
+		$this->set_config_name('EED_Event_Single');
96 96
 	}
97 97
 
98 98
 
@@ -105,35 +105,35 @@  discard block
 block discarded – undo
105 105
 	 * @param \EE_Event_Single_Config $config
106 106
 	 * @return \EE_Template_Part_Manager
107 107
 	 */
108
-	public function initialize_template_parts( EE_Event_Single_Config $config = null ) {
108
+	public function initialize_template_parts(EE_Event_Single_Config $config = null) {
109 109
 		$config = $config instanceof EE_Event_Single_Config ? $config : $this->config();
110 110
 		EEH_Autoloader::instance()->register_template_part_autoloaders();
111 111
 		$template_parts = new EE_Template_Part_Manager();
112 112
 		$template_parts->add_template_part(
113 113
 			'tickets',
114
-			__( 'Ticket Selector', 'event_espresso' ),
114
+			__('Ticket Selector', 'event_espresso'),
115 115
 			'content-espresso_events-tickets.php',
116 116
 			$config->display_order_tickets
117 117
 		);
118 118
 		$template_parts->add_template_part(
119 119
 			'datetimes',
120
-			__( 'Dates and Times', 'event_espresso' ),
120
+			__('Dates and Times', 'event_espresso'),
121 121
 			'content-espresso_events-datetimes.php',
122 122
 			$config->display_order_datetimes
123 123
 		);
124 124
 		$template_parts->add_template_part(
125 125
 			'event',
126
-			__( 'Event Description', 'event_espresso' ),
126
+			__('Event Description', 'event_espresso'),
127 127
 			'content-espresso_events-details.php',
128 128
 			$config->display_order_event
129 129
 		);
130 130
 		$template_parts->add_template_part(
131 131
 			'venue',
132
-			__( 'Venue Information', 'event_espresso' ),
132
+			__('Venue Information', 'event_espresso'),
133 133
 			'content-espresso_events-venues.php',
134 134
 			$config->display_order_venue
135 135
 		);
136
-		do_action( 'AHEE__EED_Event_Single__initialize_template_parts', $template_parts );
136
+		do_action('AHEE__EED_Event_Single__initialize_template_parts', $template_parts);
137 137
 		return $template_parts;
138 138
 	}
139 139
 
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 	 * @param WP $WP
148 148
 	 * @return    void
149 149
 	 */
150
-	public function run( $WP ) {
150
+	public function run($WP) {
151 151
 		// ensure valid EE_Events_Single_Config() object exists
152 152
 		$this->set_config();
153 153
 		// check what template is loaded
154
-		add_filter( 'template_include',  array( $this, 'template_include' ), 999, 1 );
155
-		add_filter( 'FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' );
154
+		add_filter('template_include', array($this, 'template_include'), 999, 1);
155
+		add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true');
156 156
 		// load css
157
-		add_action('wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ), 10 );
157
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 10);
158 158
 	}
159 159
 
160 160
 
@@ -166,27 +166,27 @@  discard block
 block discarded – undo
166 166
 	 * @param 	string $template
167 167
 	 * @return 	string
168 168
 	 */
169
-	public function template_include( $template ) {
169
+	public function template_include($template) {
170 170
 		global $post;
171 171
 		/** @type EE_Event_Single_Config $config */
172 172
 		$config = $this->config();
173
-		if ( $config->display_status_banner_single ) {
174
-			add_filter( 'the_title', array( 'EED_Event_Single', 'the_title' ), 100, 2 );
173
+		if ($config->display_status_banner_single) {
174
+			add_filter('the_title', array('EED_Event_Single', 'the_title'), 100, 2);
175 175
 		}
176 176
 		// not a custom template?
177 177
 		if (
178 178
 			EE_Front_Controller::instance()->get_selected_template() != 'single-espresso_events.php'
179
-			|| apply_filters( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE )
180
-			&& ! post_password_required( $post )
179
+			|| apply_filters('FHEE__EED_Event_Single__template_include__allow_custom_selected_template', FALSE)
180
+			&& ! post_password_required($post)
181 181
 		) {
182 182
 			EEH_Template::load_espresso_theme_functions();
183 183
 			// then add extra event data via hooks
184
-			add_action( 'loop_start', array( 'EED_Event_Single', 'loop_start' ));
185
-			add_filter( 'get_the_excerpt', array( 'EED_Event_Single', 'get_the_excerpt' ), 1, 1 );
186
-			add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
187
-			add_action( 'loop_end', array( 'EED_Event_Single', 'loop_end' ));
184
+			add_action('loop_start', array('EED_Event_Single', 'loop_start'));
185
+			add_filter('get_the_excerpt', array('EED_Event_Single', 'get_the_excerpt'), 1, 1);
186
+			add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
187
+			add_action('loop_end', array('EED_Event_Single', 'loop_end'));
188 188
 			// don't display entry meta because the existing theme will take car of that
189
-			add_filter( 'FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false' );
189
+			add_filter('FHEE__content_espresso_events_details_template__display_entry_meta', '__return_false');
190 190
 		}
191 191
 		return $template;
192 192
 	}
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	 * @param 	array $wp_query_array an array containing the WP_Query object
201 201
 	 * @return 	void
202 202
 	 */
203
-	public static function loop_start( $wp_query_array ) {
203
+	public static function loop_start($wp_query_array) {
204 204
 		global $post;
205
-		do_action( 'AHEE_event_details_before_post', $post, $wp_query_array );
205
+		do_action('AHEE_event_details_before_post', $post, $wp_query_array);
206 206
 	}
207 207
 
208 208
 
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 	 * @param 	int 	$id
216 216
 	 * @return 	string
217 217
 	 */
218
-	public static function the_title( $title = '', $id = 0 ) {
218
+	public static function the_title($title = '', $id = 0) {
219 219
 		global $post;
220
-		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner( $post->ID ) . $title :  $title;
220
+		return in_the_loop() && $post->ID == $id ? espresso_event_status_banner($post->ID).$title : $title;
221 221
 	}
222 222
 
223 223
 
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 	 * @param        string $excerpt
230 230
 	 * @return        string
231 231
 	 */
232
-	public static function get_the_excerpt( $excerpt = '' ) {
232
+	public static function get_the_excerpt($excerpt = '') {
233 233
 		EED_Event_Single::$using_get_the_excerpt = true;
234
-		add_filter( 'wp_trim_excerpt', array( 'EED_Event_Single', 'end_get_the_excerpt' ), 999, 1 );
234
+		add_filter('wp_trim_excerpt', array('EED_Event_Single', 'end_get_the_excerpt'), 999, 1);
235 235
 		return $excerpt;
236 236
 	}
237 237
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 * @param  string $text
245 245
 	 * @return string
246 246
 	 */
247
-	public static function end_get_the_excerpt( $text = '' ) {
247
+	public static function end_get_the_excerpt($text = '') {
248 248
 		EED_Event_Single::$using_get_the_excerpt = false;
249 249
 		return $text;
250 250
 	}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 	 * @param 	string 	$content
259 259
 	 * @return 	string
260 260
 	 */
261
-	public static function event_details( $content ) {
261
+	public static function event_details($content) {
262 262
 		global $post;
263 263
 		static $current_post_ID = 0;
264 264
 		if (
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 			// We want to allow those plugins to still do their thing and have access to our content, but depending on
274 274
 			// how your event content is being displayed (shortcode, CPT route, etc), this filter can get applied twice,
275 275
 			// so the following allows this filter to be applied multiple times, but only once for real
276
-			$current_post_ID = did_action( 'loop_start' ) ? $post->ID : 0;
277
-			if ( EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order ) {
276
+			$current_post_ID = did_action('loop_start') ? $post->ID : 0;
277
+			if (EE_Registry::instance()->CFG->template_settings->EED_Event_Single->use_sortable_display_order) {
278 278
 				// we need to first remove this callback from being applied to the_content()
279 279
 				// (otherwise it will recurse and blow up the interweb)
280
-				remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
280
+				remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
281 281
 				EED_Event_Single::instance()->template_parts = EED_Event_Single::instance()->initialize_template_parts();
282
-				$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
283
-				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters( $content );
284
-				add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
282
+				$content = EEH_Template::locate_template('content-espresso_events-details.php');
283
+				$content = EED_Event_Single::instance()->template_parts->apply_template_part_filters($content);
284
+				add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
285 285
 			} else {
286 286
 				$content = EED_Event_Single::use_filterable_display_order();
287 287
 			}
@@ -302,19 +302,19 @@  discard block
 block discarded – undo
302 302
 		// it uses the_content() for displaying the $post->post_content
303 303
 		// so in order to load a template that uses the_content() from within a callback being used to filter the_content(),
304 304
 		// we need to first remove this callback from being applied to the_content() (otherwise it will recurse and blow up the interweb)
305
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
305
+		remove_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
306 306
 		//now add additional content
307
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110, 1 );
308
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120, 1 );
309
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130, 1 );
310
-		do_action( 'AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters' );
307
+		add_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110, 1);
308
+		add_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120, 1);
309
+		add_filter('the_content', array('EED_Event_Single', 'event_venues'), 130, 1);
310
+		do_action('AHEE__EED_Event_Single__use_filterable_display_order__after_add_filters');
311 311
 		// now load our template
312
-		$content = EEH_Template::locate_template( 'content-espresso_events-details.php' );
312
+		$content = EEH_Template::locate_template('content-espresso_events-details.php');
313 313
 		//now add our filter back in, plus some others
314
-		add_filter( 'the_content', array( 'EED_Event_Single', 'event_details' ), 100 );
315
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
316
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
317
-		remove_filter( 'the_content', array( 'EED_Event_Single', 'event_venues' ), 130 );
314
+		add_filter('the_content', array('EED_Event_Single', 'event_details'), 100);
315
+		remove_filter('the_content', array('EED_Event_Single', 'event_datetimes'), 110);
316
+		remove_filter('the_content', array('EED_Event_Single', 'event_tickets'), 120);
317
+		remove_filter('the_content', array('EED_Event_Single', 'event_venues'), 130);
318 318
 		// we're not returning the $content directly because the template we are loading uses the_content (or the_excerpt)
319 319
 		return $content;
320 320
 	}
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * @param        string $content
329 329
 	 * @return        string
330 330
 	 */
331
-	public static function event_datetimes( $content ) {
332
-		return EEH_Template::locate_template( 'content-espresso_events-datetimes.php' ) . $content;
331
+	public static function event_datetimes($content) {
332
+		return EEH_Template::locate_template('content-espresso_events-datetimes.php').$content;
333 333
 	}
334 334
 
335 335
 
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 	 * @param        string $content
342 342
 	 * @return        string
343 343
 	 */
344
-	public static function event_tickets( $content ) {
345
-		return EEH_Template::locate_template( 'content-espresso_events-tickets.php' ) . $content;
344
+	public static function event_tickets($content) {
345
+		return EEH_Template::locate_template('content-espresso_events-tickets.php').$content;
346 346
 	}
347 347
 
348 348
 
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 	 * @param 	string $content
355 355
 	 * @return 	string
356 356
 	 */
357
-	public static function event_venue( $content ) {
358
-		return EED_Event_Single::event_venues( $content );
357
+	public static function event_venue($content) {
358
+		return EED_Event_Single::event_venues($content);
359 359
 	}
360 360
 
361 361
 
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
 	 * @param        string $content
368 368
 	 * @return        string
369 369
 	 */
370
-	public static function event_venues( $content ) {
371
-		return $content . EEH_Template::locate_template( 'content-espresso_events-venues.php' );
370
+	public static function event_venues($content) {
371
+		return $content.EEH_Template::locate_template('content-espresso_events-venues.php');
372 372
 	}
373 373
 
374 374
 
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
 	 * 	@param		array 	$wp_query_array an array containing the WP_Query object
381 381
 	 *  	@return 		void
382 382
 	 */
383
-	public static function loop_end( $wp_query_array ) {
383
+	public static function loop_end($wp_query_array) {
384 384
 		global $post;
385
-		do_action( 'AHEE_event_details_after_post', $post, $wp_query_array );
385
+		do_action('AHEE_event_details_after_post', $post, $wp_query_array);
386 386
 	}
387 387
 
388 388
 
@@ -395,16 +395,16 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	public function wp_enqueue_scripts() {
397 397
 		// get some style
398
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', TRUE ) && apply_filters( 'FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE )) {
398
+		if (apply_filters('FHEE_enable_default_espresso_css', TRUE) && apply_filters('FHEE__EED_Event_Single__wp_enqueue_scripts__enable_css', TRUE)) {
399 399
 			// first check uploads folder
400
-			if ( is_readable( get_stylesheet_directory() . $this->theme . DS . 'style.css' )) {
401
-				wp_register_style( $this->theme, get_stylesheet_directory_uri() . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
400
+			if (is_readable(get_stylesheet_directory().$this->theme.DS.'style.css')) {
401
+				wp_register_style($this->theme, get_stylesheet_directory_uri().$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
402 402
 			} else {
403
-				wp_register_style( $this->theme, EE_TEMPLATES_URL . $this->theme . DS . 'style.css', array( 'dashicons', 'espresso_default' ));
403
+				wp_register_style($this->theme, EE_TEMPLATES_URL.$this->theme.DS.'style.css', array('dashicons', 'espresso_default'));
404 404
 			}
405
-			wp_enqueue_script( $this->theme );
406
-			if ( EE_Registry::instance()->CFG->map_settings->use_google_maps ) {
407
-				add_action('wp_enqueue_scripts', array( 'EEH_Maps', 'espresso_google_map_js' ), 11 );
405
+			wp_enqueue_script($this->theme);
406
+			if (EE_Registry::instance()->CFG->map_settings->use_google_maps) {
407
+				add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
408 408
 			}
409 409
 		}
410 410
 	}
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
 	public static function display_venue() {
426 426
 		/** @type EE_Event_Single_Config $config */
427 427
 		$config = EED_Event_Single::instance()->config();
428
-		$display_venue= isset( $config->display_venue ) ? $config->display_venue : TRUE;
428
+		$display_venue = isset($config->display_venue) ? $config->display_venue : TRUE;
429 429
 		$venue_name = EEH_Venue_View::venue_name();
430
-		return $display_venue && ! empty( $venue_name ) ? TRUE : FALSE;
430
+		return $display_venue && ! empty($venue_name) ? TRUE : FALSE;
431 431
 	}
432 432
 
433 433
 
Please login to merge, or discard this patch.
modules/events_archive_filters/EED_Events_Archive_Filters.module.php 1 patch
Spacing   +165 added lines, -165 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,12 +586,12 @@  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
-			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
+			add_action('wp_enqueue_scripts', array('EEH_Maps', 'espresso_google_map_js'), 11);
595 595
 		}
596 596
 		//add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), 999 );
597 597
 	}
@@ -606,8 +606,8 @@  discard block
 block discarded – undo
606 606
 	 *  @access 	private
607 607
 	 *  @return 	string
608 608
 	 */
609
-	private function _get_template( $which = 'part' ) {
610
-		return EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php';
609
+	private function _get_template($which = 'part') {
610
+		return EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php';
611 611
 	}
612 612
 
613 613
 
@@ -618,13 +618,13 @@  discard block
 block discarded – undo
618 618
 	 *  @access 	public
619 619
 	 *  @return 	void
620 620
 	 */
621
-	public function excerpt_length( $length ) {
621
+	public function excerpt_length($length) {
622 622
 
623
-		if ( self::$_type == 'grid' ) {
623
+		if (self::$_type == 'grid') {
624 624
 			return 36;
625 625
 		}
626 626
 
627
-		switch ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size ) {
627
+		switch (EE_Registry::instance()->CFG->template_settings->EED_Events_Archive_Filters->event_list_grid_size) {
628 628
 			case 'tiny' :
629 629
 				return 12;
630 630
 				break;
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 	 *  @access 	public
649 649
 	 *  @return 	void
650 650
 	 */
651
-	public function excerpt_more( $more ) {
651
+	public function excerpt_more($more) {
652 652
 		return '&hellip;';
653 653
 	}
654 654
 
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
 	 */
679 679
 	public function wp_enqueue_scripts() {
680 680
 		// get some style
681
-		if ( apply_filters( 'FHEE_enable_default_espresso_css', FALSE ) ) {
681
+		if (apply_filters('FHEE_enable_default_espresso_css', FALSE)) {
682 682
 			// first check uploads folder
683
-			if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css' )) {
684
-				wp_register_style( 'archive-espresso_events', get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' ));
683
+			if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.css')) {
684
+				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 685
 			} else {
686
-				wp_register_style( 'archive-espresso_events', EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'archive-espresso_events.css', array( 'dashicons', 'espresso_default' ));
686
+				wp_register_style('archive-espresso_events', EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'archive-espresso_events.css', array('dashicons', 'espresso_default'));
687 687
 			}
688
-			if ( is_readable( get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'archive-espresso_events.js' )) {
689
-				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  );
688
+			if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'archive-espresso_events.js')) {
689
+				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);
690 690
 			} else {
691
-				wp_register_script( 'archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL . 'archive-espresso_events.js', array( 'jquery-masonry' ), '1.0', TRUE );
691
+				wp_register_script('archive-espresso_events', EVENTS_ARCHIVE_ASSETS_URL.'archive-espresso_events.js', array('jquery-masonry'), '1.0', TRUE);
692 692
 			}
693
-			wp_enqueue_style( 'archive-espresso_events' );
694
-			wp_enqueue_script( 'jquery-masonry' );
695
-			wp_enqueue_script( 'archive-espresso_events' );
696
-			add_action( 'wp_footer', array( 'EED_Events_Archive_Filters', 'localize_grid_event_lists' ), 1 );
693
+			wp_enqueue_style('archive-espresso_events');
694
+			wp_enqueue_script('jquery-masonry');
695
+			wp_enqueue_script('archive-espresso_events');
696
+			add_action('wp_footer', array('EED_Events_Archive_Filters', 'localize_grid_event_lists'), 1);
697 697
 		}
698 698
 	}
699 699
 
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 	 *  @return 	void
709 709
 	 */
710 710
 	public static function localize_grid_event_lists() {
711
-		wp_localize_script( 'archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists );
711
+		wp_localize_script('archive-espresso_events', 'espresso_grid_event_lists', EED_Events_Archive_Filters::$espresso_grid_event_lists);
712 712
 	}
713 713
 
714 714
 
@@ -723,9 +723,9 @@  discard block
 block discarded – undo
723 723
 	 */
724 724
 	public static function template_settings_form() {
725 725
 		$EE = EE_Registry::instance();
726
-		$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();
727
-		$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 );
728
-		EEH_Template::display_template( EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters );
726
+		$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();
727
+		$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);
728
+		EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH.'admin-event-list-settings.template.php', $EE->CFG->template_settings->EED_Events_Archive_Filters);
729 729
 	}
730 730
 
731 731
 
@@ -739,16 +739,16 @@  discard block
 block discarded – undo
739 739
 	 *  @static
740 740
 	 *  @return 	void
741 741
 	 */
742
-	public static function set_default_settings( $CFG ) {
742
+	public static function set_default_settings($CFG) {
743 743
 		//EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
744
-		$CFG->display_description = isset( $CFG->display_description ) && ! empty( $CFG->display_description ) ? $CFG->display_description : 1;
745
-		$CFG->display_address = isset( $CFG->display_address ) && ! empty( $CFG->display_address ) ? $CFG->display_address : TRUE;
746
-		$CFG->display_venue_details = isset( $CFG->display_venue_details ) && ! empty( $CFG->display_venue_details ) ? $CFG->display_venue_details : TRUE;
747
-		$CFG->display_expired_events = isset( $CFG->display_expired_events ) && ! empty( $CFG->display_expired_events ) ? $CFG->display_expired_events : FALSE;
748
-		$CFG->default_type = isset( $CFG->default_type ) && ! empty( $CFG->default_type ) ? $CFG->default_type : 'grid';
749
-		$CFG->event_list_grid_size = isset( $CFG->event_list_grid_size ) && ! empty( $CFG->event_list_grid_size ) ? $CFG->event_list_grid_size : 'medium';
750
-		$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';
751
-		$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';
744
+		$CFG->display_description = isset($CFG->display_description) && ! empty($CFG->display_description) ? $CFG->display_description : 1;
745
+		$CFG->display_address = isset($CFG->display_address) && ! empty($CFG->display_address) ? $CFG->display_address : TRUE;
746
+		$CFG->display_venue_details = isset($CFG->display_venue_details) && ! empty($CFG->display_venue_details) ? $CFG->display_venue_details : TRUE;
747
+		$CFG->display_expired_events = isset($CFG->display_expired_events) && ! empty($CFG->display_expired_events) ? $CFG->display_expired_events : FALSE;
748
+		$CFG->default_type = isset($CFG->default_type) && ! empty($CFG->default_type) ? $CFG->default_type : 'grid';
749
+		$CFG->event_list_grid_size = isset($CFG->event_list_grid_size) && ! empty($CFG->event_list_grid_size) ? $CFG->event_list_grid_size : 'medium';
750
+		$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';
751
+		$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';
752 752
 		return $CFG;
753 753
 	}
754 754
 
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 	 *  @access 	public
761 761
 	 *  @return 	void
762 762
 	 */
763
-	public function filter_config( $CFG ) {
763
+	public function filter_config($CFG) {
764 764
 		return $CFG;
765 765
 	}
766 766
 
@@ -773,32 +773,32 @@  discard block
 block discarded – undo
773 773
 	 *  @access 	public
774 774
 	 *  @return 	void
775 775
 	 */
776
-	public static function update_template_settings( $CFG, $REQ ) {
776
+	public static function update_template_settings($CFG, $REQ) {
777 777
 //		EEH_Debug_Tools::printr( $REQ, '$REQ  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
778 778
 //		EEH_Debug_Tools::printr( $CFG, '$CFG  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
779 779
 		//$CFG->template_settings->EED_Events_Archive_Filters = new stdClass();
780
-		$CFG->EED_Events_Archive_Filters->display_description = isset( $REQ['display_description_in_event_list'] ) ? absint( $REQ['display_description_in_event_list'] ) : 1;
781
-		$CFG->EED_Events_Archive_Filters->display_address = isset( $REQ['display_address_in_event_list'] ) ? absint( $REQ['display_address_in_event_list'] ) : TRUE;
782
-		$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;
783
-		$CFG->EED_Events_Archive_Filters->display_expired_events = isset( $REQ['display_expired_events'] ) ? absint( $REQ['display_expired_events'] ) : FALSE;
784
-		$CFG->EED_Events_Archive_Filters->default_type = isset( $REQ['default_type'] ) ? sanitize_text_field( $REQ['default_type'] ) : 'grid';
785
-		$CFG->EED_Events_Archive_Filters->event_list_grid_size = isset( $REQ['event_list_grid_size'] ) ? sanitize_text_field( $REQ['event_list_grid_size'] ) : 'medium';
780
+		$CFG->EED_Events_Archive_Filters->display_description = isset($REQ['display_description_in_event_list']) ? absint($REQ['display_description_in_event_list']) : 1;
781
+		$CFG->EED_Events_Archive_Filters->display_address = isset($REQ['display_address_in_event_list']) ? absint($REQ['display_address_in_event_list']) : TRUE;
782
+		$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;
783
+		$CFG->EED_Events_Archive_Filters->display_expired_events = isset($REQ['display_expired_events']) ? absint($REQ['display_expired_events']) : FALSE;
784
+		$CFG->EED_Events_Archive_Filters->default_type = isset($REQ['default_type']) ? sanitize_text_field($REQ['default_type']) : 'grid';
785
+		$CFG->EED_Events_Archive_Filters->event_list_grid_size = isset($REQ['event_list_grid_size']) ? sanitize_text_field($REQ['event_list_grid_size']) : 'medium';
786 786
 		$CFG->EED_Events_Archive_Filters->templates = array(
787
-				'full'  => EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events.php'
787
+				'full'  => EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events.php'
788 788
 			);
789 789
 
790
-		switch ( $CFG->EED_Events_Archive_Filters->default_type ) {
790
+		switch ($CFG->EED_Events_Archive_Filters->default_type) {
791 791
 			case 'dates' :
792
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-dates-view.php';
792
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-dates-view.php';
793 793
 				break;
794 794
 			case 'text' :
795
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-text-view.php';
795
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-text-view.php';
796 796
 				break;
797 797
 			default :
798
-					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-grid-view.php';
798
+					$CFG->EED_Events_Archive_Filters->templates['part'] = EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-grid-view.php';
799 799
 		}
800 800
 
801
-		$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;
801
+		$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;
802 802
 		return $CFG;
803 803
 	}
804 804
 
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 	 *  @return 	void
814 814
 	 */
815 815
 	public static function get_template_part() {
816
-		switch ( self::$_type ) {
816
+		switch (self::$_type) {
817 817
 			case 'dates' :
818 818
 					return 'archive-espresso_events-dates-view.php';
819 819
 				break;
@@ -837,13 +837,13 @@  discard block
 block discarded – undo
837 837
 	 */
838 838
 	public function event_list_template_filters() {
839 839
 		$args = array(
840
-			'form_url' => get_post_type_archive_link( 'espresso_events' ), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
840
+			'form_url' => get_post_type_archive_link('espresso_events'), //add_query_arg( array( 'post_type' => 'espresso_events' ), home_url() ),
841 841
 			'elf_month' => EED_Events_Archive_Filters::_display_month(),
842 842
 			'elf_category' => EED_Events_Archive_Filters::_event_category_slug(),
843 843
 			'elf_show_expired' => EED_Events_Archive_Filters::_show_expired(),
844 844
 			'elf_type' => self::$_type
845 845
 		);
846
-		EEH_Template::display_template( EE_TEMPLATES . EE_Config::get_current_theme() . DS . 'archive-espresso_events-filters.php', $args );
846
+		EEH_Template::display_template(EE_TEMPLATES.EE_Config::get_current_theme().DS.'archive-espresso_events-filters.php', $args);
847 847
 	}
848 848
 
849 849
 
@@ -856,16 +856,16 @@  discard block
 block discarded – undo
856 856
 	 *  @access 	public
857 857
 	 *  @return 	void
858 858
 	 */
859
-	public static function event_list_css( $extra_class = '' ) {
859
+	public static function event_list_css($extra_class = '') {
860 860
 		$EE = EE_Registry::instance();
861
-		$event_list_css = ! empty( $extra_class ) ? array( $extra_class ) : array();
861
+		$event_list_css = ! empty($extra_class) ? array($extra_class) : array();
862 862
 		$event_list_css[] = 'espresso-event-list-event';
863
-		if ( self::$_type == 'grid' ) {
864
-			$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';
865
-			$event_list_css[] = $event_list_grid_size . '-event-list-grid';
863
+		if (self::$_type == 'grid') {
864
+			$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';
865
+			$event_list_css[] = $event_list_grid_size.'-event-list-grid';
866 866
 		}
867
-		$event_list_css = apply_filters( 'EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css );
868
-		return implode( ' ', $event_list_css );
867
+		$event_list_css = apply_filters('EED_Events_Archive_Filters__event_list_css__event_list_css_array', $event_list_css);
868
+		return implode(' ', $event_list_css);
869 869
 	}
870 870
 
871 871
 
@@ -891,9 +891,9 @@  discard block
 block discarded – undo
891 891
 	 *  @access 	public
892 892
 	 *  @return 	void
893 893
 	 */
894
-	public static function display_description( $value ) {
894
+	public static function display_description($value) {
895 895
 		$EE = EE_Registry::instance();
896
-		$display_description= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
896
+		$display_description = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_description) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_description : 1;
897 897
 		return $display_description === $value ? TRUE : FALSE;
898 898
 	}
899 899
 
@@ -907,9 +907,9 @@  discard block
 block discarded – undo
907 907
 	 */
908 908
 	public static function display_venue_details() {
909 909
 		$EE = EE_Registry::instance();
910
-		$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;
910
+		$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;
911 911
 		$venue_name = EEH_Venue_View::venue_name();
912
-		return $display_venue_details && ! empty( $venue_name ) ? TRUE : FALSE;
912
+		return $display_venue_details && ! empty($venue_name) ? TRUE : FALSE;
913 913
 	}
914 914
 
915 915
 
@@ -921,9 +921,9 @@  discard block
 block discarded – undo
921 921
 	 */
922 922
 	public static function display_address() {
923 923
 		$EE = EE_Registry::instance();
924
-		$display_address= isset( $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address ) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE;
924
+		$display_address = isset($EE->CFG->template_settings->EED_Events_Archive_Filters->display_address) ? $EE->CFG->template_settings->EED_Events_Archive_Filters->display_address : FALSE;
925 925
 		$venue_name = EEH_Venue_View::venue_name();
926
-		return $display_address && ! empty( $venue_name ) ? TRUE : FALSE;
926
+		return $display_address && ! empty($venue_name) ? TRUE : FALSE;
927 927
 	}
928 928
 
929 929
 
@@ -937,22 +937,22 @@  discard block
 block discarded – undo
937 937
 	public static function pagination() {
938 938
 		global $wp_query;
939 939
 		$big = 999999999; // need an unlikely integer
940
-		$pagination = paginate_links( array(
941
-			'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
940
+		$pagination = paginate_links(array(
941
+			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
942 942
 			'format' => '?paged=%#%',
943
-			'current' => max( 1, get_query_var('paged') ),
943
+			'current' => max(1, get_query_var('paged')),
944 944
 			'total' => $wp_query->max_num_pages,
945 945
 			'show_all'     => TRUE,
946 946
 			'end_size'     => 10,
947 947
 			'mid_size'     => 6,
948 948
 			'prev_next'    => TRUE,
949
-			'prev_text'    => __( '&lsaquo; PREV', 'event_espresso' ),
950
-			'next_text'    => __( 'NEXT &rsaquo;', 'event_espresso' ),
949
+			'prev_text'    => __('&lsaquo; PREV', 'event_espresso'),
950
+			'next_text'    => __('NEXT &rsaquo;', 'event_espresso'),
951 951
 			'type'         => 'plain',
952 952
 			'add_args'     => FALSE,
953 953
 			'add_fragment' => ''
954 954
 		));
955
-		return ! empty( $pagination ) ? '<div class="ee-pagination-dv clear">' . $pagination . '</div>' : '';
955
+		return ! empty($pagination) ? '<div class="ee-pagination-dv clear">'.$pagination.'</div>' : '';
956 956
 	}
957 957
 
958 958
 
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 	 *  @return 	void
967 967
 	 */
968 968
 	public static function event_list_title() {
969
-		return apply_filters( 'EED_Events_Archive_Filters__event_list_title__event_list_title', __( 'Upcoming Events', 'event_espresso' ));
969
+		return apply_filters('EED_Events_Archive_Filters__event_list_title__event_list_title', __('Upcoming Events', 'event_espresso'));
970 970
 	}
971 971
 
972 972
 
Please login to merge, or discard this patch.
modules/single_page_checkout/inc/EE_SPCO_JSON_Response.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -107,71 +107,71 @@  discard block
 block discarded – undo
107 107
 	public function __toString() {
108 108
 		$JSON_response = array();
109 109
 		// grab notices
110
-		$notices = EE_Error::get_notices( FALSE );
111
-		$this->set_attention( isset( $notices['attention'] ) ? $notices['attention'] : '' );
112
-		$this->set_errors( isset( $notices['errors'] ) ? $notices['errors'] : '' );
113
-		$this->set_success( isset( $notices['success'] ) ? $notices['success'] : '' );
110
+		$notices = EE_Error::get_notices(FALSE);
111
+		$this->set_attention(isset($notices['attention']) ? $notices['attention'] : '');
112
+		$this->set_errors(isset($notices['errors']) ? $notices['errors'] : '');
113
+		$this->set_success(isset($notices['success']) ? $notices['success'] : '');
114 114
 		// add notices to JSON response, but only if they exist
115
-		if ( $this->attention() ) {
115
+		if ($this->attention()) {
116 116
 			$JSON_response['attention'] = $this->attention();
117 117
 		}
118
-		if ( $this->errors() ) {
118
+		if ($this->errors()) {
119 119
 			$JSON_response['errors'] = $this->errors();
120 120
 		}
121
-		if ( $this->unexpected_errors() ) {
121
+		if ($this->unexpected_errors()) {
122 122
 			$JSON_response['unexpected_errors'] = $this->unexpected_errors();
123 123
 		}
124
-		if ( $this->success() ) {
124
+		if ($this->success()) {
125 125
 			$JSON_response['success'] = $this->success();
126 126
 		}
127 127
 		// but if NO notices are set... at least set the "success" as a key so that the JS knows everything worked
128
-		if ( ! isset( $JSON_response[ 'attention' ] ) && ! isset( $JSON_response[ 'errors' ] ) && ! isset( $JSON_response[ 'success' ] ) ) {
128
+		if ( ! isset($JSON_response['attention']) && ! isset($JSON_response['errors']) && ! isset($JSON_response['success'])) {
129 129
 			$JSON_response['success'] = null;
130 130
 		}
131 131
 		// set redirect_url, IF it exists
132
-		if ( $this->redirect_url() ) {
132
+		if ($this->redirect_url()) {
133 133
 			$JSON_response['redirect_url'] = $this->redirect_url();
134 134
 		}
135 135
 		// set registration_time_limit, IF it exists
136
-		if ( $this->registration_time_limit() ) {
136
+		if ($this->registration_time_limit()) {
137 137
 			$JSON_response['registration_time_limit'] = $this->registration_time_limit();
138 138
 		}
139 139
 		// set payment_amount, IF it exists
140
-		if ( $this->payment_amount() !== null ) {
141
-			$JSON_response[ 'payment_amount' ] = $this->payment_amount();
140
+		if ($this->payment_amount() !== null) {
141
+			$JSON_response['payment_amount'] = $this->payment_amount();
142 142
 		}
143 143
 		// grab generic return data
144 144
 		$return_data = $this->return_data();
145 145
 		// add billing form validation rules
146
-		if ( $this->validation_rules() ) {
146
+		if ($this->validation_rules()) {
147 147
 			$return_data['validation_rules'] = $this->validation_rules();
148 148
 		}
149 149
 		// set reg_step_html, IF it exists
150
-		if ( $this->reg_step_html() ) {
150
+		if ($this->reg_step_html()) {
151 151
 			$return_data['reg_step_html'] = $this->reg_step_html();
152 152
 		}
153 153
 		// set method of payment, IF it exists
154
-		if ( $this->method_of_payment() ) {
154
+		if ($this->method_of_payment()) {
155 155
 			$return_data['method_of_payment'] = $this->method_of_payment();
156 156
 		}
157 157
 		// set "plz_select_method_of_payment" message, IF it exists
158
-		if ( $this->plz_select_method_of_payment() ) {
158
+		if ($this->plz_select_method_of_payment()) {
159 159
 			$return_data['plz_select_method_of_payment'] = $this->plz_select_method_of_payment();
160 160
 		}
161 161
 		// set redirect_form, IF it exists
162
-		if ( $this->redirect_form() ) {
162
+		if ($this->redirect_form()) {
163 163
 			$return_data['redirect_form'] = $this->redirect_form();
164 164
 		}
165 165
 		// and finally, add return_data array to main JSON response array, IF it contains anything
166 166
 		// why did we add some of the above properties to the return data array?
167 167
 		// because it is easier and cleaner in the Javascript to deal with this way
168
-		if ( ! empty( $return_data )) {
168
+		if ( ! empty($return_data)) {
169 169
 			$JSON_response['return_data'] = $return_data;
170 170
 		}
171 171
 		// filter final array
172
-		$JSON_response = apply_filters( 'FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response );
172
+		$JSON_response = apply_filters('FHEE__EE_SPCO_JSON_Response___toString__JSON_response', $JSON_response);
173 173
 		// return encoded array
174
-		return json_encode( $JSON_response );
174
+		return json_encode($JSON_response);
175 175
 	}
176 176
 
177 177
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	/**
180 180
 	 * @param string $attention
181 181
 	 */
182
-	public function set_attention( $attention ) {
182
+	public function set_attention($attention) {
183 183
 		$this->_attention = $attention;
184 184
 	}
185 185
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	/**
198 198
 	 * @param string $errors
199 199
 	 */
200
-	public function set_errors( $errors ) {
200
+	public function set_errors($errors) {
201 201
 		$this->_errors = $errors;
202 202
 	}
203 203
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	/**
225 225
 	 * @param string $unexpected_errors
226 226
 	 */
227
-	public function set_unexpected_errors( $unexpected_errors ) {
227
+	public function set_unexpected_errors($unexpected_errors) {
228 228
 		$this->_unexpected_errors = $unexpected_errors;
229 229
 	}
230 230
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	/**
234 234
 	 * @param string $success
235 235
 	 */
236
-	public function set_success( $success ) {
236
+	public function set_success($success) {
237 237
 		$this->_success = $success;
238 238
 	}
239 239
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	/**
252 252
 	 * @param string $method_of_payment
253 253
 	 */
254
-	public function set_method_of_payment( $method_of_payment ) {
254
+	public function set_method_of_payment($method_of_payment) {
255 255
 		$this->_method_of_payment = $method_of_payment;
256 256
 	}
257 257
 
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	/**
279 279
 	 * @param float $payment_amount
280 280
 	 */
281
-	public function set_payment_amount( $payment_amount ) {
282
-		$this->_payment_amount = EEH_Money::convert_to_float_from_localized_money( $payment_amount );
281
+	public function set_payment_amount($payment_amount) {
282
+		$this->_payment_amount = EEH_Money::convert_to_float_from_localized_money($payment_amount);
283 283
 	}
284 284
 
285 285
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	/**
288 288
 	 * @param string $next_step_html
289 289
 	 */
290
-	public function set_reg_step_html( $next_step_html ) {
290
+	public function set_reg_step_html($next_step_html) {
291 291
 		$this->_reg_step_html = $next_step_html;
292 292
 	}
293 293
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	/**
306 306
 	 * @param string $redirect_form
307 307
 	 */
308
-	public function set_redirect_form( $redirect_form ) {
308
+	public function set_redirect_form($redirect_form) {
309 309
 		$this->_redirect_form = $redirect_form;
310 310
 	}
311 311
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 * @return string
316 316
 	 */
317 317
 	public function redirect_form() {
318
-		return ! empty( $this->_redirect_form ) ? $this->_redirect_form : FALSE;
318
+		return ! empty($this->_redirect_form) ? $this->_redirect_form : FALSE;
319 319
 	}
320 320
 
321 321
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 	/**
324 324
 	 * @param string $plz_select_method_of_payment
325 325
 	 */
326
-	public function set_plz_select_method_of_payment( $plz_select_method_of_payment ) {
326
+	public function set_plz_select_method_of_payment($plz_select_method_of_payment) {
327 327
 		$this->_plz_select_method_of_payment = $plz_select_method_of_payment;
328 328
 	}
329 329
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	/**
342 342
 	 * @param string $redirect_url
343 343
 	 */
344
-	public function set_redirect_url( $redirect_url ) {
344
+	public function set_redirect_url($redirect_url) {
345 345
 		$this->_redirect_url = $redirect_url;
346 346
 	}
347 347
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 	/**
369 369
 	 * @param string $registration_time_limit
370 370
 	 */
371
-	public function set_registration_time_limit( $registration_time_limit ) {
371
+	public function set_registration_time_limit($registration_time_limit) {
372 372
 		$this->_registration_time_limit = $registration_time_limit;
373 373
 	}
374 374
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 	/**
378 378
 	 * @param array $return_data
379 379
 	 */
380
-	public function set_return_data( $return_data ) {
381
-		$this->_return_data = array_merge( $this->_return_data, $return_data );
380
+	public function set_return_data($return_data) {
381
+		$this->_return_data = array_merge($this->_return_data, $return_data);
382 382
 	}
383 383
 
384 384
 
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
 	/**
396 396
 	 * @param array $validation_rules
397 397
 	 */
398
-	public function add_validation_rules( $validation_rules = array() ) {
399
-		if ( is_array( $validation_rules ) && ! empty( $validation_rules )) {
400
-			$this->_validation_rules = array_merge( $this->_validation_rules, $validation_rules );
398
+	public function add_validation_rules($validation_rules = array()) {
399
+		if (is_array($validation_rules) && ! empty($validation_rules)) {
400
+			$this->_validation_rules = array_merge($this->_validation_rules, $validation_rules);
401 401
 		}
402 402
 	}
403 403
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 	 * @return array | bool
408 408
 	 */
409 409
 	public function validation_rules() {
410
-		return ! empty( $this->_validation_rules ) ? $this->_validation_rules : FALSE;
410
+		return ! empty($this->_validation_rules) ? $this->_validation_rules : FALSE;
411 411
 	}
412 412
 
413 413
 
Please login to merge, or discard this patch.
attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 1 patch
Spacing   +236 added lines, -237 removed lines patch added patch discarded remove patch
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
 	 * @param    EE_Checkout $checkout
43 43
 	 * @return    \EE_SPCO_Reg_Step_Attendee_Information
44 44
 	 */
45
-	public function __construct( EE_Checkout $checkout ) {
45
+	public function __construct(EE_Checkout $checkout) {
46 46
 		$this->_slug = 'attendee_information';
47 47
 		$this->_name = __('Attendee Information', 'event_espresso');
48
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_main.template.php';
48
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_main.template.php';
49 49
 		$this->checkout = $checkout;
50 50
 		$this->_reset_success_message();
51 51
 		$this->set_instructions(
52
-			__( 'Please answer the following registration questions before proceeding.', 'event_espresso' )
52
+			__('Please answer the following registration questions before proceeding.', 'event_espresso')
53 53
 		);
54 54
 	}
55 55
 
56 56
 
57 57
 
58 58
 	public function translate_js_strings() {
59
-		EE_Registry::$i18n_js_strings['required_field'] = __( ' is a required question.', 'event_espresso' );
59
+		EE_Registry::$i18n_js_strings['required_field'] = __(' is a required question.', 'event_espresso');
60 60
 		EE_Registry::$i18n_js_strings['required_multi_field'] = __(
61 61
 			' is a required question. Please enter a value for at least one of the options.',
62 62
 			'event_espresso'
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		// calculate taxes
117 117
 		$Line_Item_Display->display_line_item(
118 118
 			$this->checkout->cart->get_grand_total(),
119
-			array( 'set_tax_rate' => true )
119
+			array('set_tax_rate' => true)
120 120
 		);
121 121
 		/** @var $subsections EE_Form_Section_Proper[] */
122 122
 		$subsections = array(
@@ -128,51 +128,51 @@  discard block
 block discarded – undo
128 128
 			'ticket_count' 	=> array()
129 129
 		);
130 130
 		// grab the saved registrations from the transaction
131
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
132
-		if ( $registrations ) {
133
-			foreach ( $registrations as $registration ) {
131
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
132
+		if ($registrations) {
133
+			foreach ($registrations as $registration) {
134 134
 				// can this registration be processed during this visit ?
135 135
 				if (
136 136
 					$registration instanceof EE_Registration
137
-					&& $this->checkout->visit_allows_processing_of_this_registration( $registration )
137
+					&& $this->checkout->visit_allows_processing_of_this_registration($registration)
138 138
 				) {
139
-					$subsections[ $registration->reg_url_link() ] = $this->_registrations_reg_form( $registration );
140
-					if ( ! $this->checkout->admin_request ) {
141
-						$template_args['registrations'][ $registration->reg_url_link() ] = $registration;
142
-						$template_args['ticket_count'][ $registration->ticket()->ID() ] = isset(
143
-							$template_args['ticket_count'][ $registration->ticket()->ID() ]
139
+					$subsections[$registration->reg_url_link()] = $this->_registrations_reg_form($registration);
140
+					if ( ! $this->checkout->admin_request) {
141
+						$template_args['registrations'][$registration->reg_url_link()] = $registration;
142
+						$template_args['ticket_count'][$registration->ticket()->ID()] = isset(
143
+							$template_args['ticket_count'][$registration->ticket()->ID()]
144 144
 						)
145
-							? $template_args['ticket_count'][ $registration->ticket()->ID() ] + 1
145
+							? $template_args['ticket_count'][$registration->ticket()->ID()] + 1
146 146
 							: 1;
147 147
 						$ticket_line_item = EEH_Line_Item::get_line_items_by_object_type_and_IDs(
148 148
 							$this->checkout->cart->get_grand_total(),
149 149
 							'Ticket',
150
-							array( $registration->ticket()->ID() )
150
+							array($registration->ticket()->ID())
151 151
 						);
152
-						$ticket_line_item = is_array( $ticket_line_item )
153
-							? reset( $ticket_line_item )
152
+						$ticket_line_item = is_array($ticket_line_item)
153
+							? reset($ticket_line_item)
154 154
 							: $ticket_line_item;
155
-						$template_args['ticket_line_item'][ $registration->ticket()->ID() ] = $Line_Item_Display->display_line_item(
155
+						$template_args['ticket_line_item'][$registration->ticket()->ID()] = $Line_Item_Display->display_line_item(
156 156
 							$ticket_line_item
157 157
 						);
158 158
 					}
159
-					if ( $registration->is_primary_registrant() ) {
159
+					if ($registration->is_primary_registrant()) {
160 160
 						$primary_registrant = $registration->reg_url_link();
161 161
 					}
162 162
 				}
163 163
 			}
164 164
 			// print_copy_info ?
165
-			if ( $primary_registrant && ! $this->checkout->admin_request && count( $registrations ) > 1 ) {
165
+			if ($primary_registrant && ! $this->checkout->admin_request && count($registrations) > 1) {
166 166
 				// TODO: add admin option for toggling copy attendee info, then use that value to change $this->_print_copy_info
167 167
 				$copy_options['spco_copy_attendee_chk'] = $this->_print_copy_info
168 168
 					? $this->_copy_attendee_info_form()
169 169
 					: $this->_auto_copy_attendee_info();
170 170
 				// generate hidden input
171 171
 				if (
172
-					isset( $subsections[ $primary_registrant ] )
173
-				     && $subsections[ $primary_registrant ] instanceof EE_Form_Section_Proper
172
+					isset($subsections[$primary_registrant])
173
+				     && $subsections[$primary_registrant] instanceof EE_Form_Section_Proper
174 174
 				) {
175
-					$subsections[ $primary_registrant ]->add_subsections( $copy_options, 'primary_registrant', false );
175
+					$subsections[$primary_registrant]->add_subsections($copy_options, 'primary_registrant', false);
176 176
 				}
177 177
 			}
178 178
 
@@ -184,8 +184,7 @@  discard block
 block discarded – undo
184 184
 				'html_id' 					=> $this->reg_form_name(),
185 185
 				'subsections' 			=> $subsections,
186 186
 				'layout_strategy'		=> $this->checkout->admin_request ?
187
-					new EE_Div_Per_Section_Layout() :
188
-					new EE_Template_Layout(
187
+					new EE_Div_Per_Section_Layout() : new EE_Template_Layout(
189 188
 						array(
190 189
 							'layout_template_file' 	=> $this->_template, // layout_template
191 190
 							'template_args' 				=> $template_args
@@ -203,11 +202,11 @@  discard block
 block discarded – undo
203 202
 	 * @return EE_Form_Section_Proper
204 203
 	 * @throws \EE_Error
205 204
 	 */
206
-	private function _registrations_reg_form( EE_Registration $registration ) {
205
+	private function _registrations_reg_form(EE_Registration $registration) {
207 206
 		static $attendee_nmbr = 1;
208 207
 		// array of params to pass to parent constructor
209 208
 		$form_args = array(
210
-			'html_id'         => 'ee-registration-' . $registration->reg_url_link(),
209
+			'html_id'         => 'ee-registration-'.$registration->reg_url_link(),
211 210
 			'html_class'      => 'ee-reg-form-attendee-dv',
212 211
 			'html_style'      => $this->checkout->admin_request
213 212
 				? 'padding:0em 2em 1em; margin:3em 0 0; border:1px solid #ddd;'
@@ -216,24 +215,24 @@  discard block
 block discarded – undo
216 215
 			'layout_strategy' => new EE_Fieldset_Section_Layout(
217 216
 				array(
218 217
 					'legend_class' => 'spco-attendee-lgnd smaller-text lt-grey-text',
219
-					'legend_text'  => sprintf( __( 'Attendee %d', 'event_espresso' ), $attendee_nmbr )
218
+					'legend_text'  => sprintf(__('Attendee %d', 'event_espresso'), $attendee_nmbr)
220 219
 				)
221 220
 			)
222 221
 		);
223 222
 		// verify that registration has valid event
224
-		if ( $registration->event() instanceof EE_Event ) {
223
+		if ($registration->event() instanceof EE_Event) {
225 224
 			$query_params = array(
226 225
 				array(
227 226
 					'Event.EVT_ID' => $registration->event()->ID(),
228 227
 					'Event_Question_Group.EQG_primary' => $registration->count() === 1 ? true : false
229 228
 				),
230
-				'order_by'=>array( 'QSG_order'=>'ASC' )
229
+				'order_by'=>array('QSG_order'=>'ASC')
231 230
 			);
232
-			$question_groups = $registration->event()->question_groups( $query_params );
233
-			if ( $question_groups ) {
234
-				foreach ( $question_groups as $question_group ) {
235
-					if ( $question_group instanceof EE_Question_Group ) {
236
-						$form_args['subsections'][ $question_group->identifier() ] = $this->_question_group_reg_form(
231
+			$question_groups = $registration->event()->question_groups($query_params);
232
+			if ($question_groups) {
233
+				foreach ($question_groups as $question_group) {
234
+					if ($question_group instanceof EE_Question_Group) {
235
+						$form_args['subsections'][$question_group->identifier()] = $this->_question_group_reg_form(
237 236
 							$registration,
238 237
 							$question_group
239 238
 						);
@@ -246,10 +245,10 @@  discard block
 block discarded – undo
246 245
 				// if we have question groups for additional attendees, then display the copy options
247 246
 				$this->_print_copy_info = $attendee_nmbr > 1 ? true : $this->_print_copy_info;
248 247
 			} else {
249
-				$form_args['subsections'][ 'attendee_info_not_required_' . $registration->reg_url_link(
250
-				) ] = new EE_Form_Section_HTML(
248
+				$form_args['subsections']['attendee_info_not_required_'.$registration->reg_url_link(
249
+				)] = new EE_Form_Section_HTML(
251 250
 					EEH_Template::locate_template(
252
-						SPCO_REG_STEPS_PATH . $this->_slug . DS . 'attendee_info_not_required.template.php',
251
+						SPCO_REG_STEPS_PATH.$this->_slug.DS.'attendee_info_not_required.template.php',
253 252
 						apply_filters(
254 253
 							'FHEE__EE_SPCO_Reg_Step_Attendee_Information___registrations_reg_form__attendee_info_not_required_template_args',
255 254
 							array()
@@ -265,12 +264,12 @@  discard block
 block discarded – undo
265 264
 				);
266 265
 			}
267 266
 		}
268
-		if ( $registration->is_primary_registrant() ) {
267
+		if ($registration->is_primary_registrant()) {
269 268
 			// generate hidden input
270
-			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs( $registration );
269
+			$form_args['subsections']['primary_registrant'] = $this->_additional_primary_registrant_inputs($registration);
271 270
 		}
272 271
 		$attendee_nmbr++;
273
-		return new EE_Form_Section_Proper( $form_args );
272
+		return new EE_Form_Section_Proper($form_args);
274 273
 	}
275 274
 
276 275
 
@@ -291,7 +290,7 @@  discard block
 block discarded – undo
291 290
 		// generate hidden input
292 291
 		return new EE_Hidden_Input(
293 292
 			array(
294
-				'html_id' => 'additional-attendee-reg-info-' . $registration->reg_url_link(),
293
+				'html_id' => 'additional-attendee-reg-info-'.$registration->reg_url_link(),
295 294
 				'default' => $additional_attendee_reg_info
296 295
 			)
297 296
 		);
@@ -305,26 +304,26 @@  discard block
 block discarded – undo
305 304
 	 * @return EE_Form_Section_Proper
306 305
 	 * @throws \EE_Error
307 306
 	 */
308
-	private function _question_group_reg_form( EE_Registration $registration, EE_Question_Group $question_group ){
307
+	private function _question_group_reg_form(EE_Registration $registration, EE_Question_Group $question_group) {
309 308
 		// array of params to pass to parent constructor
310 309
 		$form_args = array(
311
-			'html_id'         => 'ee-reg-form-qstn-grp-' . $question_group->identifier(),
310
+			'html_id'         => 'ee-reg-form-qstn-grp-'.$question_group->identifier(),
312 311
 			'html_class'      => $this->checkout->admin_request
313 312
 				? 'form-table ee-reg-form-qstn-grp-dv'
314 313
 				: 'ee-reg-form-qstn-grp-dv',
315
-			'html_label_id'   => 'ee-reg-form-qstn-grp-' . $question_group->identifier() . '-lbl',
314
+			'html_label_id'   => 'ee-reg-form-qstn-grp-'.$question_group->identifier().'-lbl',
316 315
 			'subsections'     => array(
317
-				'reg_form_qstn_grp_hdr' => $this->_question_group_header( $question_group )
316
+				'reg_form_qstn_grp_hdr' => $this->_question_group_header($question_group)
318 317
 			),
319 318
 			'layout_strategy' => $this->checkout->admin_request
320 319
 				? new EE_Admin_Two_Column_Layout()
321 320
 				: new EE_Div_Per_Section_Layout()
322 321
 		);
323 322
 		// where params
324
-		$query_params = array( 'QST_deleted' => 0 );
323
+		$query_params = array('QST_deleted' => 0);
325 324
 		// don't load admin only questions on the frontend
326
-		if ( ! $this->checkout->admin_request ) {
327
-			$query_params['QST_admin_only'] = array( '!=', true );
325
+		if ( ! $this->checkout->admin_request) {
326
+			$query_params['QST_admin_only'] = array('!=', true);
328 327
 		}
329 328
 		$questions = $question_group->get_many_related(
330 329
 			'Question',
@@ -346,10 +345,10 @@  discard block
 block discarded – undo
346 345
 			)
347 346
 		);
348 347
 		// loop thru questions
349
-		foreach ( $questions as $question ) {
350
-			if( $question instanceof EE_Question ){
348
+		foreach ($questions as $question) {
349
+			if ($question instanceof EE_Question) {
351 350
 				$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
352
-				$form_args['subsections'][ $identifier ] = $this->reg_form_question( $registration, $question );
351
+				$form_args['subsections'][$identifier] = $this->reg_form_question($registration, $question);
353 352
 			}
354 353
 		}
355 354
 		$form_args['subsections'] = apply_filters(
@@ -370,7 +369,7 @@  discard block
 block discarded – undo
370 369
 			)
371 370
 		);
372 371
 //		d( $form_args );
373
-		$question_group_reg_form = new EE_Form_Section_Proper( $form_args );
372
+		$question_group_reg_form = new EE_Form_Section_Proper($form_args);
374 373
 		return apply_filters(
375 374
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information___question_group_reg_form__question_group_reg_form',
376 375
 			$question_group_reg_form,
@@ -387,11 +386,11 @@  discard block
 block discarded – undo
387 386
 	 * @param EE_Question_Group $question_group
388 387
 	 * @return 	EE_Form_Section_HTML
389 388
 	 */
390
-	private function _question_group_header( EE_Question_Group $question_group ){
389
+	private function _question_group_header(EE_Question_Group $question_group) {
391 390
 		$html = '';
392 391
 		// group_name
393
-		if ( $question_group->show_group_name() && $question_group->name() !== '' ) {
394
-			if ( $this->checkout->admin_request ) {
392
+		if ($question_group->show_group_name() && $question_group->name() !== '') {
393
+			if ($this->checkout->admin_request) {
395 394
 				$html .= EEH_HTML::br();
396 395
 				$html .= EEH_HTML::h3(
397 396
 					$question_group->name(),
@@ -405,7 +404,7 @@  discard block
 block discarded – undo
405 404
 			}
406 405
 		}
407 406
 		// group_desc
408
-		if ( $question_group->show_group_desc() && $question_group->desc() !== '' ) {
407
+		if ($question_group->show_group_desc() && $question_group->desc() !== '') {
409 408
 			$html .= EEH_HTML::p(
410 409
 				$question_group->desc(),
411 410
 				'',
@@ -415,7 +414,7 @@  discard block
 block discarded – undo
415 414
 			);
416 415
 
417 416
 		}
418
-		return new EE_Form_Section_HTML( $html );
417
+		return new EE_Form_Section_HTML($html);
419 418
 	}
420 419
 
421 420
 
@@ -425,7 +424,7 @@  discard block
 block discarded – undo
425 424
 	 * @return    EE_Form_Section_Proper
426 425
 	 * @throws \EE_Error
427 426
 	 */
428
-	private function _copy_attendee_info_form(){
427
+	private function _copy_attendee_info_form() {
429 428
 		// array of params to pass to parent constructor
430 429
 		return new EE_Form_Section_Proper(
431 430
 			array(
@@ -454,7 +453,7 @@  discard block
 block discarded – undo
454 453
 	private function _auto_copy_attendee_info() {
455 454
 		return new EE_Form_Section_HTML(
456 455
 			EEH_Template::locate_template(
457
-				SPCO_REG_STEPS_PATH . $this->_slug . DS . '_auto_copy_attendee_info.template.php',
456
+				SPCO_REG_STEPS_PATH.$this->_slug.DS.'_auto_copy_attendee_info.template.php',
458 457
 				apply_filters(
459 458
 					'FHEE__EE_SPCO_Reg_Step_Attendee_Information__auto_copy_attendee_info__template_args',
460 459
 					array()
@@ -478,32 +477,32 @@  discard block
 block discarded – undo
478 477
 		$copy_attendee_info_inputs = array();
479 478
 		$prev_ticket = NULL;
480 479
 		// grab the saved registrations from the transaction
481
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
482
-		foreach ( $registrations as $registration ) {
480
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
481
+		foreach ($registrations as $registration) {
483 482
 			// for all  attendees other than the primary attendee
484
-			if ( $registration instanceof EE_Registration && ! $registration->is_primary_registrant() ) {
483
+			if ($registration instanceof EE_Registration && ! $registration->is_primary_registrant()) {
485 484
 				// if this is a new ticket OR if this is the very first additional attendee after the primary attendee
486
-				if ( $registration->ticket()->ID() !== $prev_ticket ) {
485
+				if ($registration->ticket()->ID() !== $prev_ticket) {
487 486
 					$item_name = $registration->ticket()->name();
488 487
 					$item_name .= $registration->ticket()->description() !== ''
489
-						? ' - ' . $registration->ticket()->description()
488
+						? ' - '.$registration->ticket()->description()
490 489
 						: '';
491
-					$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[ticket-' . $registration->ticket()->ID() . ']' ] = new EE_Form_Section_HTML(
492
-						'<h6 class="spco-copy-attendee-event-hdr">' . $item_name . '</h6>'
490
+					$copy_attendee_info_inputs['spco_copy_attendee_chk[ticket-'.$registration->ticket()->ID().']'] = new EE_Form_Section_HTML(
491
+						'<h6 class="spco-copy-attendee-event-hdr">'.$item_name.'</h6>'
493 492
 					);
494 493
 					$prev_ticket = $registration->ticket()->ID();
495 494
 				}
496 495
 
497
-				$copy_attendee_info_inputs[ 'spco_copy_attendee_chk[' . $registration->ID() . ']' ] = new
496
+				$copy_attendee_info_inputs['spco_copy_attendee_chk['.$registration->ID().']'] = new
498 497
 				EE_Checkbox_Multi_Input(
499 498
 					array(
500 499
 						$registration->ID() => sprintf(
501
-							__( 'Attendee #%s', 'event_espresso' ),
500
+							__('Attendee #%s', 'event_espresso'),
502 501
 							$registration->count()
503 502
 						)
504 503
 					),
505 504
 					array(
506
-						'html_id'                 => 'spco-copy-attendee-chk-' . $registration->reg_url_link(),
505
+						'html_id'                 => 'spco-copy-attendee-chk-'.$registration->reg_url_link(),
507 506
 						'html_class'              => 'spco-copy-attendee-chk ee-do-not-validate',
508 507
 						'display_html_label_text' => false
509 508
 					)
@@ -523,7 +522,7 @@  discard block
 block discarded – undo
523 522
 	 * @return    EE_Form_Input_Base
524 523
 	 * @throws \EE_Error
525 524
 	 */
526
-	private function _additional_primary_registrant_inputs( EE_Registration $registration ){
525
+	private function _additional_primary_registrant_inputs(EE_Registration $registration) {
527 526
 		// generate hidden input
528 527
 		return new EE_Hidden_Input(
529 528
 			array(
@@ -542,7 +541,7 @@  discard block
 block discarded – undo
542 541
 	 * @return    EE_Form_Input_Base
543 542
 	 * @throws \EE_Error
544 543
 	 */
545
-	public function reg_form_question( EE_Registration $registration, EE_Question $question ){
544
+	public function reg_form_question(EE_Registration $registration, EE_Question $question) {
546 545
 
547 546
 		// if this question was for an attendee detail, then check for that answer
548 547
 		$answer_value = EEM_Answer::instance()->get_attendee_property_answer_value(
@@ -551,31 +550,31 @@  discard block
 block discarded – undo
551 550
 		);
552 551
 		$answer = $answer_value === null
553 552
 			? EEM_Answer::instance()->get_one(
554
-				array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) )
553
+				array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID()))
555 554
 			)
556 555
 			: null;
557 556
 		// if NOT returning to edit an existing registration
558 557
 		// OR if this question is for an attendee property
559 558
 		// OR we still don't have an EE_Answer object
560
-		if( $answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link() ) {
559
+		if ($answer_value || ! $answer instanceof EE_Answer || ! $registration->reg_url_link()) {
561 560
 			// create an EE_Answer object for storing everything in
562
-			$answer = EE_Answer::new_instance ( array(
561
+			$answer = EE_Answer::new_instance(array(
563 562
 				'QST_ID'=> $question->ID(),
564 563
 				'REG_ID'=> $registration->ID()
565 564
 			));
566 565
 		}
567 566
 		// verify instance
568
-		if( $answer instanceof EE_Answer ){
569
-			if ( ! empty( $answer_value )) {
570
-				$answer->set( 'ANS_value', $answer_value );
567
+		if ($answer instanceof EE_Answer) {
568
+			if ( ! empty($answer_value)) {
569
+				$answer->set('ANS_value', $answer_value);
571 570
 			}
572
-			$answer->cache( 'Question', $question );
573
-			$answer_cache_id =$question->system_ID() !== null
574
-				? $question->system_ID() . '-' . $registration->reg_url_link()
575
-				: $question->ID() . '-' . $registration->reg_url_link();
576
-			$registration->cache( 'Answer', $answer, $answer_cache_id );
571
+			$answer->cache('Question', $question);
572
+			$answer_cache_id = $question->system_ID() !== null
573
+				? $question->system_ID().'-'.$registration->reg_url_link()
574
+				: $question->ID().'-'.$registration->reg_url_link();
575
+			$registration->cache('Answer', $answer, $answer_cache_id);
577 576
 		}
578
-		return $this->_generate_question_input( $registration, $question, $answer );
577
+		return $this->_generate_question_input($registration, $question, $answer);
579 578
 
580 579
 	}
581 580
 
@@ -588,46 +587,46 @@  discard block
 block discarded – undo
588 587
 	 * @return EE_Form_Input_Base
589 588
 	 * @throws \EE_Error
590 589
 	 */
591
-	private function _generate_question_input( EE_Registration $registration, EE_Question $question, $answer ){
590
+	private function _generate_question_input(EE_Registration $registration, EE_Question $question, $answer) {
592 591
 		$identifier = $question->is_system_question() ? $question->system_ID() : $question->ID();
593
-		$this->_required_questions[ $identifier ] = $question->required() ? true : false;
592
+		$this->_required_questions[$identifier] = $question->required() ? true : false;
594 593
 		add_filter(
595 594
 			'FHEE__EE_Question__generate_form_input__country_options',
596
-			array( $this, 'use_cached_countries_for_form_input' ),
595
+			array($this, 'use_cached_countries_for_form_input'),
597 596
 			10,
598 597
 			4
599 598
 		);
600 599
 		add_filter(
601 600
 			'FHEE__EE_Question__generate_form_input__state_options',
602
-			array( $this, 'use_cached_states_for_form_input' ),
601
+			array($this, 'use_cached_states_for_form_input'),
603 602
 			10,
604 603
 			4
605 604
 		);
606 605
 		$input_constructor_args = array(
607
-			'html_name'     => 'ee_reg_qstn[' . $registration->ID() . '][' . $identifier . ']',
608
-			'html_id'       => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
609
-			'html_class'    => 'ee-reg-qstn ee-reg-qstn-' . $identifier,
610
-			'html_label_id' => 'ee_reg_qstn-' . $registration->ID() . '-' . $identifier,
606
+			'html_name'     => 'ee_reg_qstn['.$registration->ID().']['.$identifier.']',
607
+			'html_id'       => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
608
+			'html_class'    => 'ee-reg-qstn ee-reg-qstn-'.$identifier,
609
+			'html_label_id' => 'ee_reg_qstn-'.$registration->ID().'-'.$identifier,
611 610
 			'html_label_class'	=> 'ee-reg-qstn',
612 611
 		);
613
-		$input_constructor_args['html_label_id'] 	.= '-lbl';
614
-		if ( $answer instanceof EE_Answer && $answer->ID() ) {
615
-			$input_constructor_args[ 'html_name' ] .= '[' . $answer->ID() . ']';
616
-			$input_constructor_args[ 'html_id' ] .= '-' . $answer->ID();
617
-			$input_constructor_args[ 'html_label_id' ] .= '-' . $answer->ID();
612
+		$input_constructor_args['html_label_id'] .= '-lbl';
613
+		if ($answer instanceof EE_Answer && $answer->ID()) {
614
+			$input_constructor_args['html_name'] .= '['.$answer->ID().']';
615
+			$input_constructor_args['html_id'] .= '-'.$answer->ID();
616
+			$input_constructor_args['html_label_id'] .= '-'.$answer->ID();
618 617
 		}
619
-		$form_input =  $question->generate_form_input(
618
+		$form_input = $question->generate_form_input(
620 619
 			$registration,
621 620
 			$answer,
622 621
 			$input_constructor_args
623 622
 		);
624 623
 		remove_filter(
625 624
 			'FHEE__EE_Question__generate_form_input__country_options',
626
-			array( $this, 'use_cached_countries_for_form_input' )
625
+			array($this, 'use_cached_countries_for_form_input')
627 626
 		);
628 627
 		remove_filter(
629 628
 			'FHEE__EE_Question__generate_form_input__state_options',
630
-			array( $this, 'use_cached_states_for_form_input' )
629
+			array($this, 'use_cached_states_for_form_input')
631 630
 		);
632 631
 		return $form_input;
633 632
 	}
@@ -643,23 +642,23 @@  discard block
 block discarded – undo
643 642
 	 * @return array 2d keys are country IDs, values are their names
644 643
 	 * @throws \EE_Error
645 644
 	 */
646
-	public function use_cached_countries_for_form_input( $countries_list, $question, $registration, $answer ) {
647
-		$country_options = array( '' => '' );
645
+	public function use_cached_countries_for_form_input($countries_list, $question, $registration, $answer) {
646
+		$country_options = array('' => '');
648 647
 		// get possibly cached list of countries
649 648
 		$countries = $this->checkout->action === 'process_reg_step'
650 649
 			? EEM_Country::instance()->get_all_countries()
651 650
 			: EEM_Country::instance()->get_all_active_countries();
652
-		if ( ! empty( $countries )) {
653
-			foreach( $countries as $country ){
654
-				if ( $country instanceof EE_Country ) {
655
-					$country_options[ $country->ID() ] = $country->name();
651
+		if ( ! empty($countries)) {
652
+			foreach ($countries as $country) {
653
+				if ($country instanceof EE_Country) {
654
+					$country_options[$country->ID()] = $country->name();
656 655
 				}
657 656
 			}
658 657
 		}
659
-		if( $question instanceof EE_Question
660
-			&& $registration instanceof EE_Registration ) {
658
+		if ($question instanceof EE_Question
659
+			&& $registration instanceof EE_Registration) {
661 660
 			$answer = EEM_Answer::instance()->get_one(
662
-				array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) )
661
+				array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID()))
663 662
 			);
664 663
 		} else {
665 664
 			$answer = EE_Answer::new_instance();
@@ -686,22 +685,22 @@  discard block
 block discarded – undo
686 685
 	 * @return array 2d keys are state IDs, values are their names
687 686
 	 * @throws \EE_Error
688 687
 	 */
689
-	public function use_cached_states_for_form_input( $states_list, $question, $registration, $answer ) {
690
-		$state_options = array( '' => array( '' => ''));
688
+	public function use_cached_states_for_form_input($states_list, $question, $registration, $answer) {
689
+		$state_options = array('' => array('' => ''));
691 690
 		$states = $this->checkout->action === 'process_reg_step'
692 691
 			? EEM_State::instance()->get_all_states()
693 692
 			: EEM_State::instance()->get_all_active_states();
694
-		if ( ! empty( $states )) {
695
-			foreach( $states as $state ){
696
-				if ( $state instanceof EE_State ) {
697
-					$state_options[ $state->country()->name() ][ $state->ID() ] = $state->name();
693
+		if ( ! empty($states)) {
694
+			foreach ($states as $state) {
695
+				if ($state instanceof EE_State) {
696
+					$state_options[$state->country()->name()][$state->ID()] = $state->name();
698 697
 				}
699 698
 			}
700 699
 		}
701
-		if( $question instanceof EE_Question
702
-			&& $registration instanceof EE_Registration ) {
700
+		if ($question instanceof EE_Question
701
+			&& $registration instanceof EE_Registration) {
703 702
 			$answer = EEM_Answer::instance()->get_one(
704
-				array( array( 'QST_ID' => $question->ID(), 'REG_ID' => $registration->ID() ) )
703
+				array(array('QST_ID' => $question->ID(), 'REG_ID' => $registration->ID()))
705 704
 			);
706 705
 		} else {
707 706
 			$answer = EE_Answer::new_instance();
@@ -730,24 +729,24 @@  discard block
 block discarded – undo
730 729
 	 * @throws \EE_Error
731 730
 	 */
732 731
 	public function process_reg_step() {
733
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
732
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
734 733
 		// grab validated data from form
735 734
 		$valid_data = $this->checkout->current_step->valid_data();
736 735
 		// EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ );
737 736
 		// EEH_Debug_Tools::printr( $valid_data, '$valid_data', __FILE__, __LINE__ );
738 737
 		// if we don't have any $valid_data then something went TERRIBLY WRONG !!!
739
-		if ( empty( $valid_data ))  {
738
+		if (empty($valid_data)) {
740 739
 			EE_Error::add_error(
741
-				__( 'No valid question responses were received.', 'event_espresso' ),
740
+				__('No valid question responses were received.', 'event_espresso'),
742 741
 				__FILE__,
743 742
 				__FUNCTION__,
744 743
 				__LINE__
745 744
 			);
746 745
 			return false;
747 746
 		}
748
-		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg ) {
747
+		if ( ! $this->checkout->transaction instanceof EE_Transaction || ! $this->checkout->continue_reg) {
749 748
 			EE_Error::add_error(
750
-				__( 'A valid transaction could not be initiated for processing your registrations.', 'event_espresso' ),
749
+				__('A valid transaction could not be initiated for processing your registrations.', 'event_espresso'),
751 750
 				__FILE__,
752 751
 				__FUNCTION__,
753 752
 				__LINE__
@@ -755,11 +754,11 @@  discard block
 block discarded – undo
755 754
 			return false;
756 755
 		}
757 756
 		// get cached registrations
758
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
757
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
759 758
 		// verify we got the goods
760
-		if ( empty( $registrations )) {
759
+		if (empty($registrations)) {
761 760
 			EE_Error::add_error(
762
-				__( 'Your form data could not be applied to any valid registrations.', 'event_espresso' ),
761
+				__('Your form data could not be applied to any valid registrations.', 'event_espresso'),
763 762
 				__FILE__,
764 763
 				__FUNCTION__,
765 764
 				__LINE__
@@ -767,15 +766,15 @@  discard block
 block discarded – undo
767 766
 			return false;
768 767
 		}
769 768
 		// extract attendee info from form data and save to model objects
770
-		$registrations_processed = $this->_process_registrations( $registrations, $valid_data );
769
+		$registrations_processed = $this->_process_registrations($registrations, $valid_data);
771 770
 		// if first pass thru SPCO,
772 771
 		// then let's check processed registrations against the total number of tickets in the cart
773
-		if ( $registrations_processed === false ) {
772
+		if ($registrations_processed === false) {
774 773
 			// but return immediately if the previous step exited early due to errors
775 774
 			return false;
776
-		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count ) {
775
+		} else if ( ! $this->checkout->revisit && $registrations_processed !== $this->checkout->total_ticket_count) {
777 776
 			// generate a correctly translated string for all possible singular/plural combinations
778
-			if ( $this->checkout->total_ticket_count === 1 && $registrations_processed !== 1 ) {
777
+			if ($this->checkout->total_ticket_count === 1 && $registrations_processed !== 1) {
779 778
 				$error_msg = sprintf(
780 779
 					__(
781 780
 						'There was %1$d ticket in the Event Queue, but %2$ds registrations were processed',
@@ -784,7 +783,7 @@  discard block
 block discarded – undo
784 783
 					$this->checkout->total_ticket_count,
785 784
 					$registrations_processed
786 785
 				);
787
-			} else if ( $this->checkout->total_ticket_count !== 1 && $registrations_processed === 1 ) {
786
+			} else if ($this->checkout->total_ticket_count !== 1 && $registrations_processed === 1) {
788 787
 				$error_msg = sprintf(
789 788
 					__(
790 789
 						'There was a total of %1$d tickets in the Event Queue, but only %2$ds registration was processed',
@@ -803,17 +802,17 @@  discard block
 block discarded – undo
803 802
 					$registrations_processed
804 803
 				);
805 804
 			}
806
-			EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
805
+			EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
807 806
 			return false;
808 807
 		}
809 808
 		// mark this reg step as completed
810 809
 		$this->set_completed();
811 810
 		$this->_set_success_message(
812
-			__( 'The Attendee Information Step has been successfully completed.', 'event_espresso' )
811
+			__('The Attendee Information Step has been successfully completed.', 'event_espresso')
813 812
 		);
814 813
 		//do action in case a plugin wants to do something with the data submitted in step 1.
815 814
 		//passes EE_Single_Page_Checkout, and it's posted data
816
-		do_action( 'AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data );
815
+		do_action('AHEE__EE_Single_Page_Checkout__process_attendee_information__end', $this, $valid_data);
817 816
 		return true;
818 817
 	}
819 818
 
@@ -827,9 +826,9 @@  discard block
 block discarded – undo
827 826
 	 * @return boolean | int
828 827
 	 * @throws \EE_Error
829 828
 	 */
830
-	private function _process_registrations( $registrations = array(), $valid_data = array() ) {
829
+	private function _process_registrations($registrations = array(), $valid_data = array()) {
831 830
 		// load resources and set some defaults
832
-		EE_Registry::instance()->load_model( 'Attendee' );
831
+		EE_Registry::instance()->load_model('Attendee');
833 832
 		// holder for primary registrant attendee object
834 833
 		$this->checkout->primary_attendee_obj = NULL;
835 834
 		// array for tracking reg form data for the primary registrant
@@ -846,9 +845,9 @@  discard block
 block discarded – undo
846 845
 		// attendee counter
847 846
 		$att_nmbr = 0;
848 847
 		// grab the saved registrations from the transaction
849
-		foreach ( $registrations  as $registration ) {
848
+		foreach ($registrations  as $registration) {
850 849
 			// verify EE_Registration object
851
-			if ( ! $registration instanceof EE_Registration ) {
850
+			if ( ! $registration instanceof EE_Registration) {
852 851
 				EE_Error::add_error(
853 852
 					__(
854 853
 						'An invalid Registration object was discovered when attempting to process your registration information.',
@@ -863,12 +862,12 @@  discard block
 block discarded – undo
863 862
 			/** @var string $reg_url_link */
864 863
 			$reg_url_link = $registration->reg_url_link();
865 864
 			// reg_url_link exists ?
866
-			if ( ! empty( $reg_url_link ) ) {
865
+			if ( ! empty($reg_url_link)) {
867 866
 				// should this registration be processed during this visit ?
868
-				if ( $this->checkout->visit_allows_processing_of_this_registration( $registration ) ) {
867
+				if ($this->checkout->visit_allows_processing_of_this_registration($registration)) {
869 868
 					// if NOT revisiting, then let's save the registration now,
870 869
 					// so that we have a REG_ID to use when generating other objects
871
-					if ( ! $this->checkout->revisit ) {
870
+					if ( ! $this->checkout->revisit) {
872 871
 						$registration->save();
873 872
 					}
874 873
 					/**
@@ -878,7 +877,7 @@  discard block
 block discarded – undo
878 877
 					 * @var bool   if true is returned by the plugin then the
879 878
 					 *      		registration processing is halted.
880 879
 					 */
881
-					if ( apply_filters(
880
+					if (apply_filters(
882 881
 						'FHEE__EE_SPCO_Reg_Step_Attendee_Information___process_registrations__pre_registration_process',
883 882
 						false,
884 883
 						$att_nmbr,
@@ -886,38 +885,38 @@  discard block
 block discarded – undo
886 885
 						$registrations,
887 886
 						$valid_data,
888 887
 						$this
889
-					) ) {
888
+					)) {
890 889
 						return false;
891 890
 					}
892 891
 
893 892
 					// Houston, we have a registration!
894 893
 					$att_nmbr++;
895
-					$this->_attendee_data[ $reg_url_link ] = array();
894
+					$this->_attendee_data[$reg_url_link] = array();
896 895
 					// grab any existing related answer objects
897 896
 					$this->_registration_answers = $registration->answers();
898 897
 					// unset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] );
899
-					if ( isset( $valid_data[ $reg_url_link ] ) ) {
898
+					if (isset($valid_data[$reg_url_link])) {
900 899
 						// do we need to copy basic info from primary attendee ?
901
-						$copy_primary = isset( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] )
902
-						                && absint( $valid_data[ $reg_url_link ]['additional_attendee_reg_info'] ) === 0
900
+						$copy_primary = isset($valid_data[$reg_url_link]['additional_attendee_reg_info'])
901
+						                && absint($valid_data[$reg_url_link]['additional_attendee_reg_info']) === 0
903 902
 							? true
904 903
 							: false;
905 904
 						// filter form input data for this registration
906
-						$valid_data[ $reg_url_link ] = (array)apply_filters(
905
+						$valid_data[$reg_url_link] = (array) apply_filters(
907 906
 							'FHEE__EE_Single_Page_Checkout__process_attendee_information__valid_data_line_item',
908
-							$valid_data[ $reg_url_link ]
907
+							$valid_data[$reg_url_link]
909 908
 						);
910 909
 						// EEH_Debug_Tools::printr( $valid_data[ $reg_url_link ], '$valid_data[ $reg_url_link ]', __FILE__, __LINE__ );
911
-						if ( isset( $valid_data['primary_attendee'] )) {
912
-							$primary_registrant['line_item_id'] =  ! empty( $valid_data['primary_attendee'] )
910
+						if (isset($valid_data['primary_attendee'])) {
911
+							$primary_registrant['line_item_id'] = ! empty($valid_data['primary_attendee'])
913 912
 								? $valid_data['primary_attendee']
914 913
 								: false;
915
-							unset( $valid_data['primary_attendee'] );
914
+							unset($valid_data['primary_attendee']);
916 915
 						}
917 916
 						// now loop through our array of valid post data && process attendee reg forms
918
-						foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs ) {
919
-							if ( ! in_array( $form_section, $non_input_form_sections )) {
920
-								foreach ( $form_inputs as $form_input => $input_value ) {
917
+						foreach ($valid_data[$reg_url_link] as $form_section => $form_inputs) {
918
+							if ( ! in_array($form_section, $non_input_form_sections)) {
919
+								foreach ($form_inputs as $form_input => $input_value) {
921 920
 									// \EEH_Debug_Tools::printr( $input_value, $form_input, __FILE__, __LINE__ );
922 921
 									// check for critical inputs
923 922
 									if (
@@ -931,16 +930,16 @@  discard block
 block discarded – undo
931 930
 									// store a bit of data about the primary attendee
932 931
 									if (
933 932
 										$att_nmbr === 1
934
-										&& ! empty( $input_value )
933
+										&& ! empty($input_value)
935 934
 										&& $reg_url_link === $primary_registrant['line_item_id']
936 935
 									) {
937
-										$primary_registrant[ $form_input ] = $input_value;
936
+										$primary_registrant[$form_input] = $input_value;
938 937
 									} else if (
939 938
 										$copy_primary
940 939
 										&& $input_value === null
941
-										&& isset( $primary_registrant[ $form_input ] )
940
+										&& isset($primary_registrant[$form_input])
942 941
 									) {
943
-										$input_value = $primary_registrant[ $form_input ];
942
+										$input_value = $primary_registrant[$form_input];
944 943
 									}
945 944
 									// now attempt to save the input data
946 945
 									if (
@@ -982,57 +981,57 @@  discard block
 block discarded – undo
982 981
 						// have we met before?
983 982
 						$attendee = $this->_find_existing_attendee(
984 983
 							$registration,
985
-							$this->_attendee_data[ $reg_url_link ]
984
+							$this->_attendee_data[$reg_url_link]
986 985
 						);
987 986
 						// did we find an already existing record for this attendee ?
988
-						if ( $attendee instanceof EE_Attendee ) {
987
+						if ($attendee instanceof EE_Attendee) {
989 988
 							$attendee = $this->_update_existing_attendee_data(
990 989
 								$attendee,
991
-								$this->_attendee_data[ $reg_url_link ]
990
+								$this->_attendee_data[$reg_url_link]
992 991
 							);
993 992
 						} else {
994 993
 							// ensure critical details are set for additional attendees
995
-							$this->_attendee_data[ $reg_url_link ] = $att_nmbr > 1
994
+							$this->_attendee_data[$reg_url_link] = $att_nmbr > 1
996 995
 								? $this->_copy_critical_attendee_details_from_primary_registrant(
997
-									$this->_attendee_data[ $reg_url_link ]
996
+									$this->_attendee_data[$reg_url_link]
998 997
 								)
999
-								: $this->_attendee_data[ $reg_url_link ];
998
+								: $this->_attendee_data[$reg_url_link];
1000 999
 							$attendee = $this->_create_new_attendee(
1001 1000
 								$registration,
1002
-								$this->_attendee_data[ $reg_url_link ]
1001
+								$this->_attendee_data[$reg_url_link]
1003 1002
 							);
1004 1003
 						}
1005 1004
 						// who's #1 ?
1006
-						if ( $att_nmbr === 1 ) {
1005
+						if ($att_nmbr === 1) {
1007 1006
 							$this->checkout->primary_attendee_obj = $attendee;
1008 1007
 						}
1009 1008
 					}
1010 1009
 					// EEH_Debug_Tools::printr( $attendee, '$attendee', __FILE__, __LINE__ );
1011 1010
 					// add relation to registration, set attendee ID, and cache attendee
1012
-					$this->_associate_attendee_with_registration( $registration, $attendee );
1011
+					$this->_associate_attendee_with_registration($registration, $attendee);
1013 1012
 					// \EEH_Debug_Tools::printr( $registration, '$registration', __FILE__, __LINE__ );
1014
-					if ( ! $registration->attendee() instanceof EE_Attendee ) {
1015
-						EE_Error::add_error( sprintf( __( 'Registration %s has an invalid or missing Attendee object.', 'event_espresso' ), $reg_url_link ), __FILE__, __FUNCTION__, __LINE__ );
1013
+					if ( ! $registration->attendee() instanceof EE_Attendee) {
1014
+						EE_Error::add_error(sprintf(__('Registration %s has an invalid or missing Attendee object.', 'event_espresso'), $reg_url_link), __FILE__, __FUNCTION__, __LINE__);
1016 1015
 						return false;
1017 1016
 					}
1018 1017
 					/** @type EE_Registration_Processor $registration_processor */
1019
-					$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1018
+					$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1020 1019
 					// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1021
-					$registration_processor->toggle_incomplete_registration_status_to_default( $registration, false );
1020
+					$registration_processor->toggle_incomplete_registration_status_to_default($registration, false);
1022 1021
 					/** @type EE_Transaction_Processor $transaction_processor */
1023
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1022
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1024 1023
 					// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1025
-					$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1024
+					$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1026 1025
 					// if we've gotten this far, then let's save what we have
1027 1026
 					$registration->save();
1028 1027
 					// add relation between TXN and registration
1029
-					$this->_associate_registration_with_transaction( $registration );
1028
+					$this->_associate_registration_with_transaction($registration);
1030 1029
 				} // end of if ( ! $this->checkout->revisit || $this->checkout->primary_revisit || ( $this->checkout->revisit && $this->checkout->reg_url_link == $reg_url_link )) {
1031 1030
 
1032
-			}  else {
1033
-				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__ );
1031
+			} else {
1032
+				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__);
1034 1033
 				// remove malformed data
1035
-				unset( $valid_data[ $reg_url_link ] );
1034
+				unset($valid_data[$reg_url_link]);
1036 1035
 				return false;
1037 1036
 			}
1038 1037
 
@@ -1061,26 +1060,26 @@  discard block
 block discarded – undo
1061 1060
 		// \EEH_Debug_Tools::printr( $input_value, '$input_value', __FILE__, __LINE__ );
1062 1061
 		// allow for plugins to hook in and do their own processing of the form input.
1063 1062
 		// For plugins to bypass normal processing here, they just need to return a boolean value.
1064
-		if ( apply_filters(
1063
+		if (apply_filters(
1065 1064
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information___save_registration_form_input',
1066 1065
 			false,
1067 1066
 			$registration,
1068 1067
 			$form_input,
1069 1068
 			$input_value,
1070 1069
 			$this
1071
-		) ) {
1070
+		)) {
1072 1071
 			return true;
1073 1072
 		}
1074 1073
 		// $answer_cache_id is the key used to find the EE_Answer we want
1075 1074
 		$answer_cache_id = $this->checkout->reg_url_link
1076 1075
 			? $form_input
1077
-			: $form_input . '-' . $registration->reg_url_link();
1078
-		$answer_is_obj = isset( $this->_registration_answers[ $answer_cache_id ] )
1079
-		                 && $this->_registration_answers[ $answer_cache_id ] instanceof EE_Answer
1076
+			: $form_input.'-'.$registration->reg_url_link();
1077
+		$answer_is_obj = isset($this->_registration_answers[$answer_cache_id])
1078
+		                 && $this->_registration_answers[$answer_cache_id] instanceof EE_Answer
1080 1079
 			? true
1081 1080
 			: false;
1082 1081
 		//rename form_inputs if they are EE_Attendee properties
1083
-		switch( (string)$form_input ) {
1082
+		switch ((string) $form_input) {
1084 1083
 
1085 1084
 			case 'state' :
1086 1085
 			case 'STA_ID' :
@@ -1095,32 +1094,32 @@  discard block
 block discarded – undo
1095 1094
 				break;
1096 1095
 
1097 1096
 			default :
1098
-				$ATT_input = 'ATT_' . $form_input;
1097
+				$ATT_input = 'ATT_'.$form_input;
1099 1098
 				//EEH_Debug_Tools::printr( $ATT_input, '$ATT_input', __FILE__, __LINE__ );
1100
-				$attendee_property = EEM_Attendee::instance()->has_field( $ATT_input ) ? true : false;
1101
-				$form_input = $attendee_property ? 'ATT_' . $form_input : $form_input;
1099
+				$attendee_property = EEM_Attendee::instance()->has_field($ATT_input) ? true : false;
1100
+				$form_input = $attendee_property ? 'ATT_'.$form_input : $form_input;
1102 1101
 		}
1103 1102
 		// EEH_Debug_Tools::printr( $answer_cache_id, '$answer_cache_id', __FILE__, __LINE__ );
1104 1103
 		// EEH_Debug_Tools::printr( $attendee_property, '$attendee_property', __FILE__, __LINE__ );
1105 1104
 		// EEH_Debug_Tools::printr( $answer_is_obj, '$answer_is_obj', __FILE__, __LINE__ );
1106 1105
 		// if this form input has a corresponding attendee property
1107
-		if ( $attendee_property ) {
1108
-			$this->_attendee_data[ $registration->reg_url_link() ][ $form_input ] = $input_value;
1109
-			if ( $answer_is_obj ) {
1106
+		if ($attendee_property) {
1107
+			$this->_attendee_data[$registration->reg_url_link()][$form_input] = $input_value;
1108
+			if ($answer_is_obj) {
1110 1109
 				// and delete the corresponding answer since we won't be storing this data in that object
1111
-				$registration->_remove_relation_to( $this->_registration_answers[ $answer_cache_id ], 'Answer' );
1112
-				$this->_registration_answers[ $answer_cache_id ]->delete_permanently();
1110
+				$registration->_remove_relation_to($this->_registration_answers[$answer_cache_id], 'Answer');
1111
+				$this->_registration_answers[$answer_cache_id]->delete_permanently();
1113 1112
 			}
1114 1113
 			return true;
1115
-		} elseif ( $answer_is_obj ) {
1114
+		} elseif ($answer_is_obj) {
1116 1115
 			// save this data to the answer object
1117
-			$this->_registration_answers[ $answer_cache_id ]->set_value( $input_value );
1118
-			$result = $this->_registration_answers[ $answer_cache_id ]->save();
1116
+			$this->_registration_answers[$answer_cache_id]->set_value($input_value);
1117
+			$result = $this->_registration_answers[$answer_cache_id]->save();
1119 1118
 			return $result !== false ? true : false;
1120 1119
 		} else {
1121
-			foreach ( $this->_registration_answers as $answer ) {
1122
-				if ( $answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id ) {
1123
-					$answer->set_value( $input_value );
1120
+			foreach ($this->_registration_answers as $answer) {
1121
+				if ($answer instanceof EE_Answer && $answer->question_ID() === $answer_cache_id) {
1122
+					$answer->set_value($input_value);
1124 1123
 					$result = $answer->save();
1125 1124
 					return $result !== false ? true : false;
1126 1125
 				}
@@ -1142,15 +1141,15 @@  discard block
 block discarded – undo
1142 1141
 		$form_input = '',
1143 1142
 		$input_value = ''
1144 1143
 	) {
1145
-		if ( empty( $input_value ) ) {
1144
+		if (empty($input_value)) {
1146 1145
 			// if the form input isn't marked as being required, then just return
1147
-			if ( ! isset( $this->_required_questions[ $form_input ] ) || ! $this->_required_questions[ $form_input ] ) {
1146
+			if ( ! isset($this->_required_questions[$form_input]) || ! $this->_required_questions[$form_input]) {
1148 1147
 				return true;
1149 1148
 			}
1150
-			switch ( $form_input ) {
1149
+			switch ($form_input) {
1151 1150
 				case 'fname' :
1152 1151
 					EE_Error::add_error(
1153
-						__( 'First Name is a required value.', 'event_espresso' ),
1152
+						__('First Name is a required value.', 'event_espresso'),
1154 1153
 						__FILE__,
1155 1154
 						__FUNCTION__,
1156 1155
 						__LINE__
@@ -1159,7 +1158,7 @@  discard block
 block discarded – undo
1159 1158
 					break;
1160 1159
 				case 'lname' :
1161 1160
 					EE_Error::add_error(
1162
-						__( 'Last Name is a required value.', 'event_espresso' ),
1161
+						__('Last Name is a required value.', 'event_espresso'),
1163 1162
 						__FILE__,
1164 1163
 						__FUNCTION__,
1165 1164
 						__LINE__
@@ -1168,7 +1167,7 @@  discard block
 block discarded – undo
1168 1167
 					break;
1169 1168
 				case 'email' :
1170 1169
 					EE_Error::add_error(
1171
-						__( 'Please enter a valid email address.', 'event_espresso' ),
1170
+						__('Please enter a valid email address.', 'event_espresso'),
1172 1171
 						__FILE__,
1173 1172
 						__FUNCTION__,
1174 1173
 						__LINE__
@@ -1201,21 +1200,21 @@  discard block
 block discarded – undo
1201 1200
 	 * @param array           $attendee_data
1202 1201
 	 * @return boolean
1203 1202
 	 */
1204
-	private function _find_existing_attendee( EE_Registration $registration, $attendee_data = array() ) {
1203
+	private function _find_existing_attendee(EE_Registration $registration, $attendee_data = array()) {
1205 1204
 		$existing_attendee = null;
1206 1205
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1207
-		$ATT_fname = isset( $attendee_data['ATT_fname'] ) && ! empty( $attendee_data['ATT_fname'] )
1206
+		$ATT_fname = isset($attendee_data['ATT_fname']) && ! empty($attendee_data['ATT_fname'])
1208 1207
 			? $attendee_data['ATT_fname']
1209 1208
 			: '';
1210
-		$ATT_lname = isset( $attendee_data['ATT_lname'] ) && ! empty( $attendee_data['ATT_lname'] )
1209
+		$ATT_lname = isset($attendee_data['ATT_lname']) && ! empty($attendee_data['ATT_lname'])
1211 1210
 			? $attendee_data['ATT_lname']
1212 1211
 			: '';
1213
-		$ATT_email = isset( $attendee_data['ATT_email'] ) && ! empty( $attendee_data['ATT_email'] )
1212
+		$ATT_email = isset($attendee_data['ATT_email']) && ! empty($attendee_data['ATT_email'])
1214 1213
 			? $attendee_data['ATT_email']
1215 1214
 			: '';
1216 1215
 		// but only if those have values
1217
-		if ( $ATT_fname && $ATT_lname && $ATT_email ) {
1218
-			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee( array(
1216
+		if ($ATT_fname && $ATT_lname && $ATT_email) {
1217
+			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(array(
1219 1218
 				'ATT_fname' => $ATT_fname,
1220 1219
 				'ATT_lname' => $ATT_lname,
1221 1220
 				'ATT_email' => $ATT_email
@@ -1239,13 +1238,13 @@  discard block
 block discarded – undo
1239 1238
 	 * @return \EE_Attendee
1240 1239
 	 * @throws \EE_Error
1241 1240
 	 */
1242
-	private function _update_existing_attendee_data( EE_Attendee $existing_attendee, $attendee_data = array() ) {
1241
+	private function _update_existing_attendee_data(EE_Attendee $existing_attendee, $attendee_data = array()) {
1243 1242
 		// first remove fname, lname, and email from attendee data
1244
-		$dont_set = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
1243
+		$dont_set = array('ATT_fname', 'ATT_lname', 'ATT_email');
1245 1244
 		// now loop thru what's left and add to attendee CPT
1246
-		foreach ( $attendee_data as $property_name => $property_value ) {
1247
-			if ( ! in_array( $property_name, $dont_set ) && EEM_Attendee::instance()->has_field( $property_name )) {
1248
-				$existing_attendee->set( $property_name, $property_value );
1245
+		foreach ($attendee_data as $property_name => $property_value) {
1246
+			if ( ! in_array($property_name, $dont_set) && EEM_Attendee::instance()->has_field($property_name)) {
1247
+				$existing_attendee->set($property_name, $property_value);
1249 1248
 			}
1250 1249
 		}
1251 1250
 		// better save that now
@@ -1263,11 +1262,11 @@  discard block
 block discarded – undo
1263 1262
 	 * @return void
1264 1263
 	 * @throws \EE_Error
1265 1264
 	 */
1266
-	private function _associate_attendee_with_registration( EE_Registration $registration, EE_Attendee $attendee ) {
1265
+	private function _associate_attendee_with_registration(EE_Registration $registration, EE_Attendee $attendee) {
1267 1266
 		// add relation to attendee
1268
-		$registration->_add_relation_to( $attendee, 'Attendee' );
1269
-		$registration->set_attendee_id( $attendee->ID() );
1270
-		$registration->update_cache_after_object_save( 'Attendee', $attendee );
1267
+		$registration->_add_relation_to($attendee, 'Attendee');
1268
+		$registration->set_attendee_id($attendee->ID());
1269
+		$registration->update_cache_after_object_save('Attendee', $attendee);
1271 1270
 	}
1272 1271
 
1273 1272
 
@@ -1279,10 +1278,10 @@  discard block
 block discarded – undo
1279 1278
 	 * @return void
1280 1279
 	 * @throws \EE_Error
1281 1280
 	 */
1282
-	private function _associate_registration_with_transaction( EE_Registration $registration ) {
1281
+	private function _associate_registration_with_transaction(EE_Registration $registration) {
1283 1282
 		// add relation to attendee
1284
-		$this->checkout->transaction->_add_relation_to( $registration, 'Registration' );
1285
-		$this->checkout->transaction->update_cache_after_object_save( 'Registration', $registration );
1283
+		$this->checkout->transaction->_add_relation_to($registration, 'Registration');
1284
+		$this->checkout->transaction->update_cache_after_object_save('Registration', $registration);
1286 1285
 	}
1287 1286
 
1288 1287
 
@@ -1295,14 +1294,14 @@  discard block
 block discarded – undo
1295 1294
 	 * @return array
1296 1295
 	 * @throws \EE_Error
1297 1296
 	 */
1298
-	private function _copy_critical_attendee_details_from_primary_registrant( $attendee_data = array() ) {
1297
+	private function _copy_critical_attendee_details_from_primary_registrant($attendee_data = array()) {
1299 1298
 		// bare minimum critical details include first name, last name, email address
1300
-		$critical_attendee_details = array( 'ATT_fname', 'ATT_lname', 'ATT_email' );
1299
+		$critical_attendee_details = array('ATT_fname', 'ATT_lname', 'ATT_email');
1301 1300
 		// add address info to critical details?
1302
-		if ( apply_filters(
1301
+		if (apply_filters(
1303 1302
 			'FHEE__EE_SPCO_Reg_Step_Attendee_Information__merge_address_details_with_critical_attendee_details',
1304 1303
 			false
1305
-		) ) {
1304
+		)) {
1306 1305
 			$address_details = array(
1307 1306
 				'ATT_address',
1308 1307
 				'ATT_address2',
@@ -1312,13 +1311,13 @@  discard block
 block discarded – undo
1312 1311
 				'ATT_zip',
1313 1312
 				'ATT_phone'
1314 1313
 			);
1315
-			$critical_attendee_details = array_merge( $critical_attendee_details, $address_details );
1314
+			$critical_attendee_details = array_merge($critical_attendee_details, $address_details);
1316 1315
 		}
1317
-		foreach ( $critical_attendee_details as $critical_attendee_detail ) {
1318
-			if ( ! isset( $attendee_data[ $critical_attendee_detail ] )
1319
-			     || empty( $attendee_data[ $critical_attendee_detail ] )
1316
+		foreach ($critical_attendee_details as $critical_attendee_detail) {
1317
+			if ( ! isset($attendee_data[$critical_attendee_detail])
1318
+			     || empty($attendee_data[$critical_attendee_detail])
1320 1319
 			) {
1321
-				$attendee_data[ $critical_attendee_detail ] = $this->checkout->primary_attendee_obj->get(
1320
+				$attendee_data[$critical_attendee_detail] = $this->checkout->primary_attendee_obj->get(
1322 1321
 					$critical_attendee_detail
1323 1322
 				);
1324 1323
 			}
@@ -1336,11 +1335,11 @@  discard block
 block discarded – undo
1336 1335
 	 * @return \EE_Attendee
1337 1336
 	 * @throws \EE_Error
1338 1337
 	 */
1339
-	private function _create_new_attendee( EE_Registration $registration, $attendee_data = array() ) {
1338
+	private function _create_new_attendee(EE_Registration $registration, $attendee_data = array()) {
1340 1339
 		// create new attendee object
1341
-		$new_attendee = EE_Attendee::new_instance( $attendee_data );
1340
+		$new_attendee = EE_Attendee::new_instance($attendee_data);
1342 1341
 		// set author to event creator
1343
-		$new_attendee->set( 'ATT_author', $registration->event()->wp_user() );
1342
+		$new_attendee->set('ATT_author', $registration->event()->wp_user());
1344 1343
 		$new_attendee->save();
1345 1344
 		return $new_attendee;
1346 1345
 	}
@@ -1357,7 +1356,7 @@  discard block
 block discarded – undo
1357 1356
 	 */
1358 1357
 	public function update_reg_step() {
1359 1358
 		// save everything
1360
-		if ( $this->process_reg_step() ) {
1359
+		if ($this->process_reg_step()) {
1361 1360
 			$this->checkout->redirect = true;
1362 1361
 			$this->checkout->redirect_url = add_query_arg(
1363 1362
 				array(
@@ -1366,7 +1365,7 @@  discard block
 block discarded – undo
1366 1365
 				),
1367 1366
 				$this->checkout->thank_you_page_url
1368 1367
 			);
1369
-			$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1368
+			$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1370 1369
 			return true;
1371 1370
 		}
1372 1371
 		return false;
Please login to merge, or discard this patch.
reg_steps/payment_options/EE_SPCO_Reg_Step_Payment_Options.class.php 1 patch
Spacing   +323 added lines, -323 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 
@@ -32,32 +32,32 @@  discard block
 block discarded – undo
32 32
 	public static function set_hooks() {
33 33
 		add_filter(
34 34
 			'FHEE__SPCO__EE_Line_Item_Filter_Collection',
35
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters' )
35
+			array('EE_SPCO_Reg_Step_Payment_Options', 'add_spco_line_item_filters')
36 36
 		);
37 37
 		add_action(
38 38
 			'wp_ajax_switch_spco_billing_form',
39
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' )
39
+			array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form')
40 40
 		);
41 41
 		add_action(
42 42
 			'wp_ajax_nopriv_switch_spco_billing_form',
43
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form' )
43
+			array('EE_SPCO_Reg_Step_Payment_Options', 'switch_spco_billing_form')
44 44
 		);
45
-		add_action( 'wp_ajax_save_payer_details', array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' ) );
45
+		add_action('wp_ajax_save_payer_details', array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details'));
46 46
 		add_action(
47 47
 			'wp_ajax_nopriv_save_payer_details',
48
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details' )
48
+			array('EE_SPCO_Reg_Step_Payment_Options', 'save_payer_details')
49 49
 		);
50 50
 		add_action(
51 51
 			'wp_ajax_get_transaction_details_for_gateways',
52
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
52
+			array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
53 53
 		);
54 54
 		add_action(
55 55
 			'wp_ajax_nopriv_get_transaction_details_for_gateways',
56
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details' )
56
+			array('EE_SPCO_Reg_Step_Payment_Options', 'get_transaction_details')
57 57
 		);
58 58
 		add_filter(
59 59
 			'FHEE__EED_Recaptcha___bypass_recaptcha__bypass_request_params_array',
60
-			array( 'EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method' ),
60
+			array('EE_SPCO_Reg_Step_Payment_Options', 'bypass_recaptcha_for_load_payment_method'),
61 61
 			10,
62 62
 			1
63 63
 		);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @throws \EE_Error
72 72
 	 */
73 73
 	public static function switch_spco_billing_form() {
74
-		EED_Single_Page_Checkout::process_ajax_request( 'switch_payment_method' );
74
+		EED_Single_Page_Checkout::process_ajax_request('switch_payment_method');
75 75
 	}
76 76
 
77 77
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @throws \EE_Error
83 83
 	 */
84 84
 	public static function save_payer_details() {
85
-		EED_Single_Page_Checkout::process_ajax_request( 'save_payer_details_via_ajax' );
85
+		EED_Single_Page_Checkout::process_ajax_request('save_payer_details_via_ajax');
86 86
 	}
87 87
 
88 88
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @throws \EE_Error
94 94
 	 */
95 95
 	public static function get_transaction_details() {
96
-		EED_Single_Page_Checkout::process_ajax_request( 'get_transaction_details_for_gateways' );
96
+		EED_Single_Page_Checkout::process_ajax_request('get_transaction_details_for_gateways');
97 97
 	}
98 98
 
99 99
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 	 * @param    EE_Checkout $checkout
122 122
 	 * @return    \EE_SPCO_Reg_Step_Payment_Options
123 123
 	 */
124
-	public function __construct( EE_Checkout $checkout ) {
124
+	public function __construct(EE_Checkout $checkout) {
125 125
 		$this->_slug = 'payment_options';
126
-		$this->_name = __( 'Payment Options', 'event_espresso' );
127
-		$this->_template = SPCO_REG_STEPS_PATH . $this->_slug . DS . 'payment_options_main.template.php';
126
+		$this->_name = __('Payment Options', 'event_espresso');
127
+		$this->_template = SPCO_REG_STEPS_PATH.$this->_slug.DS.'payment_options_main.template.php';
128 128
 		$this->checkout = $checkout;
129 129
 		$this->_reset_success_message();
130 130
 		$this->set_instructions(
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	/**
150 150
 	 * @param null $line_item_display
151 151
 	 */
152
-	public function set_line_item_display( $line_item_display ) {
152
+	public function set_line_item_display($line_item_display) {
153 153
 		$this->line_item_display = $line_item_display;
154 154
 	}
155 155
 
@@ -203,20 +203,20 @@  discard block
 block discarded – undo
203 203
 			// 	$ 0.00 transactions (no payment required)
204 204
 			! $this->checkout->payment_required()
205 205
 			// but do NOT remove if current action being called belongs to this reg step
206
-			&& ! is_callable( array( $this, $this->checkout->action ) )
206
+			&& ! is_callable(array($this, $this->checkout->action))
207 207
 			&& ! $this->completed()
208 208
 		) {
209 209
 			// and if so, then we no longer need the Payment Options step
210
-			if ( $this->is_current_step() ) {
210
+			if ($this->is_current_step()) {
211 211
 				$this->checkout->generate_reg_form = false;
212 212
 			}
213
-			$this->checkout->remove_reg_step( $this->_slug );
213
+			$this->checkout->remove_reg_step($this->_slug);
214 214
 			// DEBUG LOG
215 215
 			//$this->checkout->log( __CLASS__, __FUNCTION__, __LINE__ );
216 216
 			return false;
217 217
 		}
218 218
 		// load EEM_Payment_Method
219
-		EE_Registry::instance()->load_model( 'Payment_Method' );
219
+		EE_Registry::instance()->load_model('Payment_Method');
220 220
 		// get all active payment methods
221 221
 		$this->checkout->available_payment_methods = EEM_Payment_Method::instance()->get_all_for_transaction(
222 222
 			$this->checkout->transaction,
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		$sold_out_events = array();
243 243
 		$reg_count = 0;
244 244
 		// loop thru registrations to gather info
245
-		$registrations = $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params );
246
-		foreach ( $registrations as $registration ) {
245
+		$registrations = $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params);
246
+		foreach ($registrations as $registration) {
247 247
 			/** @var $registration EE_Registration */
248 248
 			$reg_count++;
249 249
 			// if returning registrant is Approved then do NOT do this
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 				&& $registration->status_ID() === EEM_Registration::status_id_approved
254 254
 			)
255 255
 			) {
256
-				if ( $registration->event()->is_sold_out() || $registration->event()->is_sold_out( true ) ) {
256
+				if ($registration->event()->is_sold_out() || $registration->event()->is_sold_out(true)) {
257 257
 					// add event to list of events that are sold out
258
-					$sold_out_events[ $registration->event()->ID() ] = $registration->event();
258
+					$sold_out_events[$registration->event()->ID()] = $registration->event();
259 259
 					do_action(
260 260
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__sold_out_event',
261 261
 						$registration->event(),
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
 					);
264 264
 				}
265 265
 				// event requires admin approval
266
-				if ( $registration->status_ID() === EEM_Registration::status_id_not_approved ) {
266
+				if ($registration->status_ID() === EEM_Registration::status_id_not_approved) {
267 267
 					// add event to list of events with pre-approval reg status
268
-					$registrations_requiring_pre_approval[ $registration->ID() ] = $registration;
268
+					$registrations_requiring_pre_approval[$registration->ID()] = $registration;
269 269
 					do_action(
270 270
 						'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_pre_approval',
271 271
 						$registration->event(),
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 				}
275 275
 			}
276 276
 			// are they allowed to pay now and is there monies owing?
277
-			if ( $registration->owes_monies_and_can_pay() ) {
278
-				$registrations_requiring_payment[ $registration->ID() ] = $registration;
277
+			if ($registration->owes_monies_and_can_pay()) {
278
+				$registrations_requiring_payment[$registration->ID()] = $registration;
279 279
 				do_action(
280 280
 					'AHEE__EE_SPCO_Reg_Step_Payment_Options__generate_reg_form__event_requires_payment',
281 281
 					$registration->event(),
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
 				&& $registration->status_ID() !== EEM_Registration::status_id_not_approved
287 287
 				&& $registration->ticket()->is_free()
288 288
 			) {
289
-				$registrations_for_free_events[ $registration->event()->ID() ] = $registration;
289
+				$registrations_for_free_events[$registration->event()->ID()] = $registration;
290 290
 			}
291 291
 		}
292 292
 		$subsections = array();
293 293
 		// now decide which template to load
294
-		if ( ! empty( $sold_out_events ) ) {
295
-			$subsections['sold_out_events'] = $this->_sold_out_events( $sold_out_events );
294
+		if ( ! empty($sold_out_events)) {
295
+			$subsections['sold_out_events'] = $this->_sold_out_events($sold_out_events);
296 296
 		}
297
-		if ( ! empty( $registrations_requiring_pre_approval ) ) {
297
+		if ( ! empty($registrations_requiring_pre_approval)) {
298 298
 			$subsections['registrations_requiring_pre_approval'] = $this->_registrations_requiring_pre_approval(
299 299
 				$registrations_requiring_pre_approval
300 300
 			);
301 301
 		}
302
-		if ( ! empty( $registrations_for_free_events ) ) {
303
-			$subsections['no_payment_required'] = $this->_no_payment_required( $registrations_for_free_events );
302
+		if ( ! empty($registrations_for_free_events)) {
303
+			$subsections['no_payment_required'] = $this->_no_payment_required($registrations_for_free_events);
304 304
 		}
305
-		if ( ! empty( $registrations_requiring_payment ) ) {
305
+		if ( ! empty($registrations_requiring_payment)) {
306 306
 			// autoload Line_Item_Display classes
307 307
 			EEH_Autoloader::register_line_item_filter_autoloaders();
308 308
 			$line_item_filter_processor = new EE_Line_Item_Filter_Processor(
@@ -314,17 +314,17 @@  discard block
 block discarded – undo
314 314
 			);
315 315
 			/** @var EE_Line_Item $filtered_line_item_tree */
316 316
 			$filtered_line_item_tree = $line_item_filter_processor->process();
317
-			if ( $this->checkout->amount_owing > 0 ) {
317
+			if ($this->checkout->amount_owing > 0) {
318 318
 				EEH_Autoloader::register_line_item_display_autoloaders();
319
-				$this->set_line_item_display( new EE_Line_Item_Display( 'spco' ) );
319
+				$this->set_line_item_display(new EE_Line_Item_Display('spco'));
320 320
 				$subsections['payment_options'] = $this->_display_payment_options(
321 321
 					$this->line_item_display->display_line_item(
322 322
 						$filtered_line_item_tree,
323
-						array( 'registrations' => $registrations )
323
+						array('registrations' => $registrations)
324 324
 					)
325 325
 				);
326 326
 				$this->checkout->amount_owing = $filtered_line_item_tree->total();
327
-				$this->_apply_registration_payments_to_amount_owing( $registrations );
327
+				$this->_apply_registration_payments_to_amount_owing($registrations);
328 328
 			}
329 329
 		} else {
330 330
 			$this->_hide_reg_step_submit_button_if_revisit();
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	 * @param \EE_Line_Item_Filter_Collection $line_item_filter_collection
355 355
 	 * @return \EE_Line_Item_Filter_Collection
356 356
 	 */
357
-	public static function add_spco_line_item_filters( EE_Line_Item_Filter_Collection $line_item_filter_collection ) {
357
+	public static function add_spco_line_item_filters(EE_Line_Item_Filter_Collection $line_item_filter_collection) {
358 358
 		$line_item_filter_collection->add(
359 359
 			new EE_Billable_Line_Item_Filter(
360 360
 				EE_Registry::instance()->SSN->checkout()->transaction->registrations(
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 				)
363 363
 			)
364 364
 		);
365
-		$line_item_filter_collection->add( new EE_Non_Zero_Line_Item_Filter() );
365
+		$line_item_filter_collection->add(new EE_Non_Zero_Line_Item_Filter());
366 366
 		return $line_item_filter_collection;
367 367
 	}
368 368
 
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 	 * @return void
377 377
 	 */
378 378
 	protected function _hide_reg_step_submit_button_if_revisit() {
379
-		if ( $this->checkout->revisit ) {
380
-			add_filter( 'FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string' );
379
+		if ($this->checkout->revisit) {
380
+			add_filter('FHEE__EE_SPCO_Reg_Step__reg_step_submit_button__sbmt_btn_html', '__return_empty_string');
381 381
 		}
382 382
 	}
383 383
 
@@ -390,13 +390,13 @@  discard block
 block discarded – undo
390 390
 	 * @return \EE_Form_Section_Proper
391 391
 	 * @throws \EE_Error
392 392
 	 */
393
-	private function _sold_out_events( $sold_out_events_array = array() ) {
393
+	private function _sold_out_events($sold_out_events_array = array()) {
394 394
 		// set some defaults
395 395
 		$this->checkout->selected_method_of_payment = 'events_sold_out';
396 396
 		$sold_out_events = '';
397
-		foreach ( $sold_out_events_array as $sold_out_event ) {
397
+		foreach ($sold_out_events_array as $sold_out_event) {
398 398
 			$sold_out_events .= EEH_HTML::li(
399
-				EEH_HTML::span( $sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text' )
399
+				EEH_HTML::span($sold_out_event->name(), '', 'dashicons dashicons-marker ee-icon-size-16 pink-text')
400 400
 			);
401 401
 		}
402 402
 		return new EE_Form_Section_Proper(
@@ -441,17 +441,17 @@  discard block
 block discarded – undo
441 441
 	 * @return \EE_Form_Section_Proper
442 442
 	 * @throws \EE_Error
443 443
 	 */
444
-	private function _registrations_requiring_pre_approval( $registrations_requiring_pre_approval = array() ) {
444
+	private function _registrations_requiring_pre_approval($registrations_requiring_pre_approval = array()) {
445 445
 		$events_requiring_pre_approval = '';
446
-		foreach ( $registrations_requiring_pre_approval as $registration ) {
447
-			if ( $registration instanceof EE_Registration && $registration->event() instanceof EE_Event ) {
448
-				$events_requiring_pre_approval[ $registration->event()->ID() ] = EEH_HTML::li(
446
+		foreach ($registrations_requiring_pre_approval as $registration) {
447
+			if ($registration instanceof EE_Registration && $registration->event() instanceof EE_Event) {
448
+				$events_requiring_pre_approval[$registration->event()->ID()] = EEH_HTML::li(
449 449
 					EEH_HTML::span(
450 450
 						'',
451 451
 						'',
452 452
 						'dashicons dashicons-marker ee-icon-size-16 orange-text'
453 453
 					)
454
-					. EEH_HTML::span( $registration->event()->name(), '', 'orange-text' )
454
+					. EEH_HTML::span($registration->event()->name(), '', 'orange-text')
455 455
 				);
456 456
 			}
457 457
 		}
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 						'template_args'        => apply_filters(
471 471
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___sold_out_events__template_args',
472 472
 							array(
473
-								'events_requiring_pre_approval'     => implode( '', $events_requiring_pre_approval ),
473
+								'events_requiring_pre_approval'     => implode('', $events_requiring_pre_approval),
474 474
 								'events_requiring_pre_approval_msg' => apply_filters(
475 475
 									'FHEE__EE_SPCO_Reg_Step_Payment_Options___events_requiring_pre_approval__events_requiring_pre_approval_msg',
476 476
 									__(
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	 * @return \EE_Form_Section_Proper
496 496
 	 * @throws \EE_Error
497 497
 	 */
498
-	private function _no_payment_required( $registrations_for_free_events = array() ) {
498
+	private function _no_payment_required($registrations_for_free_events = array()) {
499 499
 		// set some defaults
500 500
 		$this->checkout->selected_method_of_payment = 'no_payment_required';
501 501
 		// generate no_payment_required form
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 								'ticket_count'                  => array(),
520 520
 								'registrations_for_free_events' => $registrations_for_free_events,
521 521
 								'no_payment_required_msg'       => EEH_HTML::p(
522
-									__( 'This is a free event, so no billing will occur.', 'event_espresso' )
522
+									__('This is a free event, so no billing will occur.', 'event_espresso')
523 523
 								)
524 524
 							)
525 525
 						),
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 	 * @return \EE_Form_Section_Proper
539 539
 	 * @throws \EE_Error
540 540
 	 */
541
-	private function _display_payment_options( $transaction_details = '' ) {
541
+	private function _display_payment_options($transaction_details = '') {
542 542
 		// has method_of_payment been set by no-js user?
543 543
 		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment();
544 544
 		// build payment options form
@@ -550,18 +550,18 @@  discard block
 block discarded – undo
550 550
 						'before_payment_options' => apply_filters(
551 551
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__before_payment_options',
552 552
 							new EE_Form_Section_Proper(
553
-								array( 'layout_strategy' => new EE_Div_Per_Section_Layout() )
553
+								array('layout_strategy' => new EE_Div_Per_Section_Layout())
554 554
 							)
555 555
 						),
556 556
 						'payment_options'        => $this->_setup_payment_options(),
557 557
 						'after_payment_options'  => apply_filters(
558 558
 							'FHEE__EE_SPCO_Reg_Step_Payment_Options___display_payment_options__after_payment_options',
559 559
 							new EE_Form_Section_Proper(
560
-								array( 'layout_strategy' => new EE_Div_Per_Section_Layout() )
560
+								array('layout_strategy' => new EE_Div_Per_Section_Layout())
561 561
 							)
562 562
 						),
563 563
 						'default_hidden_inputs'  => $this->reg_step_hidden_inputs(),
564
-						'extra_hidden_inputs'    => $this->_extra_hidden_inputs( false )
564
+						'extra_hidden_inputs'    => $this->_extra_hidden_inputs(false)
565 565
 					),
566 566
 					'layout_strategy' => new EE_Template_Layout(
567 567
 						array(
@@ -590,10 +590,10 @@  discard block
 block discarded – undo
590 590
 	 * @return \EE_Form_Section_Proper
591 591
 	 * @throws \EE_Error
592 592
 	 */
593
-	private function _extra_hidden_inputs( $no_payment_required = true ) {
593
+	private function _extra_hidden_inputs($no_payment_required = true) {
594 594
 		return new EE_Form_Section_Proper(
595 595
 			array(
596
-				'html_id'         => 'ee-' . $this->slug() . '-extra-hidden-inputs',
596
+				'html_id'         => 'ee-'.$this->slug().'-extra-hidden-inputs',
597 597
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
598 598
 				'subsections'     => array(
599 599
 					'spco_no_payment_required' => new EE_Hidden_Input(
@@ -625,16 +625,16 @@  discard block
 block discarded – undo
625 625
 	 * @access protected
626 626
 	 * @param array $registrations
627 627
 	 */
628
-	protected function _apply_registration_payments_to_amount_owing( array $registrations ) {
628
+	protected function _apply_registration_payments_to_amount_owing(array $registrations) {
629 629
 		$payments = array();
630
-		foreach ( $registrations as $registration ) {
631
-			if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) {
630
+		foreach ($registrations as $registration) {
631
+			if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
632 632
 				$payments += $registration->registration_payments();
633 633
 			}
634 634
 		}
635
-		if ( ! empty( $payments ) ) {
636
-			foreach ( $payments as $payment ) {
637
-				if ( $payment instanceof EE_Registration_Payment ) {
635
+		if ( ! empty($payments)) {
636
+			foreach ($payments as $payment) {
637
+				if ($payment instanceof EE_Registration_Payment) {
638 638
 					$this->checkout->amount_owing -= $payment->amount();
639 639
 				}
640 640
 			}
@@ -650,11 +650,11 @@  discard block
 block discarded – undo
650 650
 	 * @param    bool $force_reset
651 651
 	 * @return    void
652 652
 	 */
653
-	private function _reset_selected_method_of_payment( $force_reset = false ) {
653
+	private function _reset_selected_method_of_payment($force_reset = false) {
654 654
 		$reset_payment_method = $force_reset
655 655
 			? true
656
-			: sanitize_text_field( EE_Registry::instance()->REQ->get( 'reset_payment_method', false ) );
657
-		if ( $reset_payment_method ) {
656
+			: sanitize_text_field(EE_Registry::instance()->REQ->get('reset_payment_method', false));
657
+		if ($reset_payment_method) {
658 658
 			$this->checkout->selected_method_of_payment = null;
659 659
 			$this->checkout->payment_method = null;
660 660
 			$this->checkout->billing_form = null;
@@ -673,12 +673,12 @@  discard block
 block discarded – undo
673 673
 	 * @param string $selected_method_of_payment
674 674
 	 * @return        EE_Billing_Info_Form
675 675
 	 */
676
-	private function _save_selected_method_of_payment( $selected_method_of_payment = '' ) {
677
-		$selected_method_of_payment = ! empty( $selected_method_of_payment )
676
+	private function _save_selected_method_of_payment($selected_method_of_payment = '') {
677
+		$selected_method_of_payment = ! empty($selected_method_of_payment)
678 678
 			? $selected_method_of_payment
679 679
 			: $this->checkout->selected_method_of_payment;
680 680
 		EE_Registry::instance()->SSN->set_session_data(
681
-			array( 'selected_method_of_payment' => $selected_method_of_payment )
681
+			array('selected_method_of_payment' => $selected_method_of_payment)
682 682
 		);
683 683
 	}
684 684
 
@@ -694,19 +694,19 @@  discard block
 block discarded – undo
694 694
 		// load payment method classes
695 695
 		$this->checkout->available_payment_methods = $this->_get_available_payment_methods();
696 696
 		// switch up header depending on number of available payment methods
697
-		$payment_method_header = count( $this->checkout->available_payment_methods ) > 1
697
+		$payment_method_header = count($this->checkout->available_payment_methods) > 1
698 698
 			? apply_filters(
699 699
 				'FHEE__registration_page_payment_options__method_of_payment_hdr',
700
-				__( 'Please Select Your Method of Payment', 'event_espresso' )
700
+				__('Please Select Your Method of Payment', 'event_espresso')
701 701
 			)
702 702
 			: apply_filters(
703 703
 				'FHEE__registration_page_payment_options__method_of_payment_hdr',
704
-				__( 'Method of Payment', 'event_espresso' )
704
+				__('Method of Payment', 'event_espresso')
705 705
 			);
706 706
 		$available_payment_methods = array(
707 707
 			// display the "Payment Method" header
708 708
 			'payment_method_header' => new EE_Form_Section_HTML(
709
-				EEH_HTML::h4( $payment_method_header, 'method-of-payment-hdr' )
709
+				EEH_HTML::h4($payment_method_header, 'method-of-payment-hdr')
710 710
 			)
711 711
 		);
712 712
 		// the list of actual payment methods ( invoice, paypal, etc ) in a  ( slug => HTML )  format
@@ -715,32 +715,32 @@  discard block
 block discarded – undo
715 715
 		// additional instructions to be displayed and hidden below payment methods (adding a clearing div to start)
716 716
 		$payment_methods_billing_info = array(
717 717
 			new EE_Form_Section_HTML(
718
-				EEH_HTML::div( '<br />', '', '', 'clear:both;' )
718
+				EEH_HTML::div('<br />', '', '', 'clear:both;')
719 719
 			)
720 720
 		);
721 721
 		// loop through payment methods
722
-		foreach ( $this->checkout->available_payment_methods as $payment_method ) {
723
-			if ( $payment_method instanceof EE_Payment_Method ) {
722
+		foreach ($this->checkout->available_payment_methods as $payment_method) {
723
+			if ($payment_method instanceof EE_Payment_Method) {
724 724
 				$payment_method_button = EEH_HTML::img(
725 725
 					$payment_method->button_url(),
726 726
 					$payment_method->name(),
727
-					'spco-payment-method-' . $payment_method->slug() . '-btn-img',
727
+					'spco-payment-method-'.$payment_method->slug().'-btn-img',
728 728
 					'spco-payment-method-btn-img'
729 729
 				);
730 730
 				// check if any payment methods are set as default
731 731
 				// if payment method is already selected OR nothing is selected and this payment method should be open_by_default
732 732
 				if (
733
-					( $this->checkout->selected_method_of_payment === $payment_method->slug() )
734
-					|| ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default() )
733
+					($this->checkout->selected_method_of_payment === $payment_method->slug())
734
+					|| ( ! $this->checkout->selected_method_of_payment && $payment_method->open_by_default())
735 735
 				) {
736 736
 					$this->checkout->selected_method_of_payment = $payment_method->slug();
737 737
 					$this->_save_selected_method_of_payment();
738
-					$default_payment_method_option[ $payment_method->slug() ] = $payment_method_button;
738
+					$default_payment_method_option[$payment_method->slug()] = $payment_method_button;
739 739
 				} else {
740
-					$available_payment_method_options[ $payment_method->slug() ] = $payment_method_button;
740
+					$available_payment_method_options[$payment_method->slug()] = $payment_method_button;
741 741
 				}
742
-				$payment_methods_billing_info[ $payment_method->slug()
743
-				                               . '-info' ] = $this->_payment_method_billing_info(
742
+				$payment_methods_billing_info[$payment_method->slug()
743
+				                               . '-info'] = $this->_payment_method_billing_info(
744 744
 					$payment_method
745 745
 				);
746 746
 			}
@@ -770,12 +770,12 @@  discard block
 block discarded – undo
770 770
 	 * @return EE_Payment_Method[]
771 771
 	 */
772 772
 	protected function _get_available_payment_methods() {
773
-		if ( ! empty( $this->checkout->available_payment_methods ) ) {
773
+		if ( ! empty($this->checkout->available_payment_methods)) {
774 774
 			return $this->checkout->available_payment_methods;
775 775
 		}
776 776
 		$available_payment_methods = array();
777 777
 		// load EEM_Payment_Method
778
-		EE_Registry::instance()->load_model( 'Payment_Method' );
778
+		EE_Registry::instance()->load_model('Payment_Method');
779 779
 		/** @type EEM_Payment_Method $EEM_Payment_Method */
780 780
 		$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
781 781
 		// get all active payment methods
@@ -783,9 +783,9 @@  discard block
 block discarded – undo
783 783
 			$this->checkout->transaction,
784 784
 			EEM_Payment_Method::scope_cart
785 785
 		);
786
-		foreach ( $payment_methods as $payment_method ) {
787
-			if ( $payment_method instanceof EE_Payment_Method ) {
788
-				$available_payment_methods[ $payment_method->slug() ] = $payment_method;
786
+		foreach ($payment_methods as $payment_method) {
787
+			if ($payment_method instanceof EE_Payment_Method) {
788
+				$available_payment_methods[$payment_method->slug()] = $payment_method;
789 789
 			}
790 790
 		}
791 791
 		return $available_payment_methods;
@@ -800,14 +800,14 @@  discard block
 block discarded – undo
800 800
 	 * @param    array $available_payment_method_options
801 801
 	 * @return    \EE_Form_Section_Proper
802 802
 	 */
803
-	private function _available_payment_method_inputs( $available_payment_method_options = array() ) {
803
+	private function _available_payment_method_inputs($available_payment_method_options = array()) {
804 804
 		// generate inputs
805 805
 		return new EE_Form_Section_Proper(
806 806
 			array(
807 807
 				'html_id'         => 'ee-available-payment-method-inputs',
808 808
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
809 809
 				'subsections'     => array(
810
-					'' => new EE_Radio_Button_Input (
810
+					'' => new EE_Radio_Button_Input(
811 811
 						$available_payment_method_options,
812 812
 						array(
813 813
 							'html_name'          => 'selected_method_of_payment',
@@ -832,28 +832,28 @@  discard block
 block discarded – undo
832 832
 	 * @return    \EE_Form_Section_Proper
833 833
 	 * @throws \EE_Error
834 834
 	 */
835
-	private function _payment_method_billing_info( EE_Payment_Method $payment_method ) {
835
+	private function _payment_method_billing_info(EE_Payment_Method $payment_method) {
836 836
 		$currently_selected = $this->checkout->selected_method_of_payment === $payment_method->slug()
837 837
 			? true
838 838
 			: false;
839 839
 		// generate the billing form for payment method
840 840
 		$billing_form = $currently_selected
841
-			? $this->_get_billing_form_for_payment_method( $payment_method )
841
+			? $this->_get_billing_form_for_payment_method($payment_method)
842 842
 			: new EE_Form_Section_HTML();
843 843
 		$this->checkout->billing_form = $currently_selected
844 844
 			? $billing_form
845 845
 			: $this->checkout->billing_form;
846 846
 		// it's all in the details
847 847
 		$info_html = EEH_HTML::h3(
848
-			__( 'Important information regarding your payment', 'event_espresso' ),
848
+			__('Important information regarding your payment', 'event_espresso'),
849 849
 			'',
850 850
 			'spco-payment-method-hdr'
851 851
 		);
852 852
 		// add some info regarding the step, either from what's saved in the admin,
853 853
 		// or a default string depending on whether the PM has a billing form or not
854
-		if ( $payment_method->description() ) {
854
+		if ($payment_method->description()) {
855 855
 			$payment_method_info = $payment_method->description();
856
-		} elseif ( $billing_form instanceof EE_Billing_Info_Form ) {
856
+		} elseif ($billing_form instanceof EE_Billing_Info_Form) {
857 857
 			$payment_method_info = sprintf(
858 858
 				__(
859 859
 					'Please provide the following billing information, then click the "%1$s" button below in order to proceed.',
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 			);
864 864
 		} else {
865 865
 			$payment_method_info = sprintf(
866
-				__( 'Please click the "%1$s" button below in order to proceed.', 'event_espresso' ),
866
+				__('Please click the "%1$s" button below in order to proceed.', 'event_espresso'),
867 867
 				$this->submit_button_text()
868 868
 			);
869 869
 		}
@@ -877,13 +877,13 @@  discard block
 block discarded – undo
877 877
 		);
878 878
 		return new EE_Form_Section_Proper(
879 879
 			array(
880
-				'html_id'         => 'spco-payment-method-info-' . $payment_method->slug(),
880
+				'html_id'         => 'spco-payment-method-info-'.$payment_method->slug(),
881 881
 				'html_class'      => 'spco-payment-method-info-dv',
882 882
 				// only display the selected or default PM
883 883
 				'html_style'      => $currently_selected ? '' : 'display:none;',
884 884
 				'layout_strategy' => new EE_Div_Per_Section_Layout(),
885 885
 				'subsections'     => array(
886
-					'info'         => new EE_Form_Section_HTML( $info_html ),
886
+					'info'         => new EE_Form_Section_HTML($info_html),
887 887
 					'billing_form' => $currently_selected ? $billing_form : new EE_Form_Section_HTML()
888 888
 				)
889 889
 			)
@@ -901,15 +901,15 @@  discard block
 block discarded – undo
901 901
 	 */
902 902
 	public function get_billing_form_html_for_payment_method() {
903 903
 		// how have they chosen to pay?
904
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
904
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
905 905
 		$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
906
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
906
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
907 907
 			return false;
908 908
 		}
909
-		if ( apply_filters(
909
+		if (apply_filters(
910 910
 			'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
911 911
 			false
912
-		) ) {
912
+		)) {
913 913
 			EE_Error::add_success(
914 914
 				apply_filters(
915 915
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 			);
925 925
 		}
926 926
 		// now generate billing form for selected method of payment
927
-		$payment_method_billing_form = $this->_get_billing_form_for_payment_method( $this->checkout->payment_method );
927
+		$payment_method_billing_form = $this->_get_billing_form_for_payment_method($this->checkout->payment_method);
928 928
 		// fill form with attendee info if applicable
929 929
 		if (
930 930
 			$payment_method_billing_form instanceof EE_Billing_Attendee_Info_Form
@@ -946,10 +946,10 @@  discard block
 block discarded – undo
946 946
 		$billing_info = $payment_method_billing_form instanceof EE_Form_Section_Proper
947 947
 			? $payment_method_billing_form->get_html()
948 948
 			: '';
949
-		$this->checkout->json_response->set_return_data( array( 'payment_method_info' => $billing_info ) );
949
+		$this->checkout->json_response->set_return_data(array('payment_method_info' => $billing_info));
950 950
 		// localize validation rules for main form
951 951
 		$this->checkout->current_step->reg_form->localize_validation_rules();
952
-		$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
952
+		$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
953 953
 		return true;
954 954
 	}
955 955
 
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
 	 * @return \EE_Billing_Info_Form
964 964
 	 * @throws \EE_Error
965 965
 	 */
966
-	private function _get_billing_form_for_payment_method( EE_Payment_Method $payment_method ) {
966
+	private function _get_billing_form_for_payment_method(EE_Payment_Method $payment_method) {
967 967
 		$billing_form = $payment_method->type_obj()->billing_form(
968 968
 			$this->checkout->transaction,
969
-			array( 'amount_owing' => $this->checkout->amount_owing )
969
+			array('amount_owing' => $this->checkout->amount_owing)
970 970
 		);
971
-		if ( $billing_form instanceof EE_Billing_Info_Form ) {
971
+		if ($billing_form instanceof EE_Billing_Info_Form) {
972 972
 			if (
973 973
 				apply_filters(
974 974
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
975 975
 					false
976 976
 				)
977
-				&& EE_Registry::instance()->REQ->is_set( 'payment_method' )
977
+				&& EE_Registry::instance()->REQ->is_set('payment_method')
978 978
 			) {
979 979
 				EE_Error::add_success(
980 980
 					apply_filters(
@@ -1016,15 +1016,15 @@  discard block
 block discarded – undo
1016 1016
 		$request_param = 'selected_method_of_payment'
1017 1017
 	) {
1018 1018
 		// is selected_method_of_payment set in the request ?
1019
-		$selected_method_of_payment = EE_Registry::instance()->REQ->get( $request_param, false );
1020
-		if ( $selected_method_of_payment ) {
1019
+		$selected_method_of_payment = EE_Registry::instance()->REQ->get($request_param, false);
1020
+		if ($selected_method_of_payment) {
1021 1021
 			// sanitize it
1022
-			$selected_method_of_payment = is_array( $selected_method_of_payment )
1023
-				? array_shift( $selected_method_of_payment )
1022
+			$selected_method_of_payment = is_array($selected_method_of_payment)
1023
+				? array_shift($selected_method_of_payment)
1024 1024
 				: $selected_method_of_payment;
1025
-			$selected_method_of_payment = sanitize_text_field( $selected_method_of_payment );
1025
+			$selected_method_of_payment = sanitize_text_field($selected_method_of_payment);
1026 1026
 			// store it in the session so that it's available for all subsequent requests including AJAX
1027
-			$this->_save_selected_method_of_payment( $selected_method_of_payment );
1027
+			$this->_save_selected_method_of_payment($selected_method_of_payment);
1028 1028
 		} else {
1029 1029
 			// or is is set in the session ?
1030 1030
 			$selected_method_of_payment = EE_Registry::instance()->SSN->get_session_data(
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 			);
1033 1033
 		}
1034 1034
 		// do ya really really gotta have it?
1035
-		if ( empty( $selected_method_of_payment ) && $required ) {
1035
+		if (empty($selected_method_of_payment) && $required) {
1036 1036
 			EE_Error::add_error(
1037 1037
 				sprintf(
1038 1038
 					__(
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 					),
1042 1042
 					'<br/>',
1043 1043
 					'<br/>',
1044
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1044
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1045 1045
 				),
1046 1046
 				__FILE__,
1047 1047
 				__FUNCTION__,
@@ -1068,13 +1068,13 @@  discard block
 block discarded – undo
1068 1068
 	 * @throws \EE_Error
1069 1069
 	 */
1070 1070
 	public function switch_payment_method() {
1071
-		if ( ! $this->_verify_payment_method_is_set() ) {
1071
+		if ( ! $this->_verify_payment_method_is_set()) {
1072 1072
 			return false;
1073 1073
 		}
1074
-		if ( apply_filters(
1074
+		if (apply_filters(
1075 1075
 			'FHEE__EE_SPCO_Reg_Step_Payment_Options__registration_checkout__selected_payment_method__display_success',
1076 1076
 			false
1077
-		) ) {
1077
+		)) {
1078 1078
 			EE_Error::add_success(
1079 1079
 				apply_filters(
1080 1080
 					'FHEE__Single_Page_Checkout__registration_checkout__selected_payment_method',
@@ -1089,13 +1089,13 @@  discard block
 block discarded – undo
1089 1089
 			);
1090 1090
 		}
1091 1091
 		// generate billing form for selected method of payment if it hasn't been done already
1092
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1092
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
1093 1093
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1094 1094
 				$this->checkout->payment_method
1095 1095
 			);
1096 1096
 		}
1097 1097
 		// fill form with attendee info if applicable
1098
-		if ( $this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form
1098
+		if ($this->checkout->billing_form instanceof EE_Billing_Attendee_Info_Form
1099 1099
 		     && $this->checkout->transaction_has_primary_registrant()
1100 1100
 		) {
1101 1101
 			$this->checkout->billing_form->populate_from_attendee(
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 			);
1104 1104
 		}
1105 1105
 		// and debug content
1106
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form
1106
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form
1107 1107
 		     && $this->checkout->payment_method->type_obj() instanceof EE_PMT_Base
1108 1108
 		) {
1109 1109
 			$this->checkout->billing_form = $this->checkout->payment_method->type_obj()->apply_billing_form_debug_settings(
@@ -1111,15 +1111,15 @@  discard block
 block discarded – undo
1111 1111
 			);
1112 1112
 		}
1113 1113
 		// get html and validation rules for form
1114
-		if ( $this->checkout->billing_form instanceof EE_Form_Section_Proper ) {
1114
+		if ($this->checkout->billing_form instanceof EE_Form_Section_Proper) {
1115 1115
 			$this->checkout->json_response->set_return_data(
1116
-				array( 'payment_method_info' => $this->checkout->billing_form->get_html() )
1116
+				array('payment_method_info' => $this->checkout->billing_form->get_html())
1117 1117
 			);
1118 1118
 			// localize validation rules for main form
1119
-			$this->checkout->billing_form->localize_validation_rules( true );
1120
-			$this->checkout->json_response->add_validation_rules( EE_Form_Section_Proper::js_localization() );
1119
+			$this->checkout->billing_form->localize_validation_rules(true);
1120
+			$this->checkout->json_response->add_validation_rules(EE_Form_Section_Proper::js_localization());
1121 1121
 		} else {
1122
-			$this->checkout->json_response->set_return_data( array( 'payment_method_info' => '' ) );
1122
+			$this->checkout->json_response->set_return_data(array('payment_method_info' => ''));
1123 1123
 		}
1124 1124
 		//prevents advancement to next step
1125 1125
 		$this->checkout->continue_reg = false;
@@ -1136,12 +1136,12 @@  discard block
 block discarded – undo
1136 1136
 	 */
1137 1137
 	protected function _verify_payment_method_is_set() {
1138 1138
 		// generate billing form for selected method of payment if it hasn't been done already
1139
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1139
+		if (empty($this->checkout->selected_method_of_payment)) {
1140 1140
 			// how have they chosen to pay?
1141
-			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
1141
+			$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
1142 1142
 		}
1143 1143
 		// verify payment method
1144
-		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method ) {
1144
+		if ( ! $this->checkout->payment_method instanceof EE_Payment_Method) {
1145 1145
 			// get payment method for selected method of payment
1146 1146
 			$this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment();
1147 1147
 		}
@@ -1160,25 +1160,25 @@  discard block
 block discarded – undo
1160 1160
 	 * @throws \EE_Error
1161 1161
 	 */
1162 1162
 	public function save_payer_details_via_ajax() {
1163
-		if ( ! $this->_verify_payment_method_is_set() ) {
1163
+		if ( ! $this->_verify_payment_method_is_set()) {
1164 1164
 			return;
1165 1165
 		}
1166 1166
 		// generate billing form for selected method of payment if it hasn't been done already
1167
-		if ( $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1167
+		if ($this->checkout->payment_method->type_obj()->has_billing_form()) {
1168 1168
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1169 1169
 				$this->checkout->payment_method
1170 1170
 			);
1171 1171
 		}
1172 1172
 		// generate primary attendee from payer info if applicable
1173
-		if ( ! $this->checkout->transaction_has_primary_registrant() ) {
1173
+		if ( ! $this->checkout->transaction_has_primary_registrant()) {
1174 1174
 			$attendee = $this->_create_attendee_from_request_data();
1175
-			if ( $attendee instanceof EE_Attendee ) {
1176
-				foreach ( $this->checkout->transaction->registrations() as $registration ) {
1177
-					if ( $registration->is_primary_registrant() ) {
1175
+			if ($attendee instanceof EE_Attendee) {
1176
+				foreach ($this->checkout->transaction->registrations() as $registration) {
1177
+					if ($registration->is_primary_registrant()) {
1178 1178
 						$this->checkout->primary_attendee_obj = $attendee;
1179
-						$registration->_add_relation_to( $attendee, 'Attendee' );
1180
-						$registration->set_attendee_id( $attendee->ID() );
1181
-						$registration->update_cache_after_object_save( 'Attendee', $attendee );
1179
+						$registration->_add_relation_to($attendee, 'Attendee');
1180
+						$registration->set_attendee_id($attendee->ID());
1181
+						$registration->update_cache_after_object_save('Attendee', $attendee);
1182 1182
 					}
1183 1183
 				}
1184 1184
 			}
@@ -1195,50 +1195,50 @@  discard block
 block discarded – undo
1195 1195
 	 */
1196 1196
 	protected function _create_attendee_from_request_data() {
1197 1197
 		// get State ID
1198
-		$STA_ID = ! empty( $_REQUEST['state'] ) ? sanitize_text_field( $_REQUEST['state'] ) : '';
1199
-		if ( ! empty( $STA_ID ) ) {
1198
+		$STA_ID = ! empty($_REQUEST['state']) ? sanitize_text_field($_REQUEST['state']) : '';
1199
+		if ( ! empty($STA_ID)) {
1200 1200
 			// can we get state object from name ?
1201
-			EE_Registry::instance()->load_model( 'State' );
1202
-			$state = EEM_State::instance()->get_col( array( array( 'STA_name' => $STA_ID ), 'limit' => 1 ), 'STA_ID' );
1203
-			$STA_ID = is_array( $state ) && ! empty( $state ) ? reset( $state ) : $STA_ID;
1201
+			EE_Registry::instance()->load_model('State');
1202
+			$state = EEM_State::instance()->get_col(array(array('STA_name' => $STA_ID), 'limit' => 1), 'STA_ID');
1203
+			$STA_ID = is_array($state) && ! empty($state) ? reset($state) : $STA_ID;
1204 1204
 		}
1205 1205
 		// get Country ISO
1206
-		$CNT_ISO = ! empty( $_REQUEST['country'] ) ? sanitize_text_field( $_REQUEST['country'] ) : '';
1207
-		if ( ! empty( $CNT_ISO ) ) {
1206
+		$CNT_ISO = ! empty($_REQUEST['country']) ? sanitize_text_field($_REQUEST['country']) : '';
1207
+		if ( ! empty($CNT_ISO)) {
1208 1208
 			// can we get country object from name ?
1209
-			EE_Registry::instance()->load_model( 'Country' );
1209
+			EE_Registry::instance()->load_model('Country');
1210 1210
 			$country = EEM_Country::instance()->get_col(
1211
-				array( array( 'CNT_name' => $CNT_ISO ), 'limit' => 1 ),
1211
+				array(array('CNT_name' => $CNT_ISO), 'limit' => 1),
1212 1212
 				'CNT_ISO'
1213 1213
 			);
1214
-			$CNT_ISO = is_array( $country ) && ! empty( $country ) ? reset( $country ) : $CNT_ISO;
1214
+			$CNT_ISO = is_array($country) && ! empty($country) ? reset($country) : $CNT_ISO;
1215 1215
 		}
1216 1216
 		// grab attendee data
1217 1217
 		$attendee_data = array(
1218
-			'ATT_fname'    => ! empty( $_REQUEST['first_name'] ) ? sanitize_text_field( $_REQUEST['first_name'] ) : '',
1219
-			'ATT_lname'    => ! empty( $_REQUEST['last_name'] ) ? sanitize_text_field( $_REQUEST['last_name'] ) : '',
1220
-			'ATT_email'    => ! empty( $_REQUEST['email'] ) ? sanitize_email( $_REQUEST['email'] ) : '',
1221
-			'ATT_address'  => ! empty( $_REQUEST['address'] ) ? sanitize_text_field( $_REQUEST['address'] ) : '',
1222
-			'ATT_address2' => ! empty( $_REQUEST['address2'] ) ? sanitize_text_field( $_REQUEST['address2'] ) : '',
1223
-			'ATT_city'     => ! empty( $_REQUEST['city'] ) ? sanitize_text_field( $_REQUEST['city'] ) : '',
1218
+			'ATT_fname'    => ! empty($_REQUEST['first_name']) ? sanitize_text_field($_REQUEST['first_name']) : '',
1219
+			'ATT_lname'    => ! empty($_REQUEST['last_name']) ? sanitize_text_field($_REQUEST['last_name']) : '',
1220
+			'ATT_email'    => ! empty($_REQUEST['email']) ? sanitize_email($_REQUEST['email']) : '',
1221
+			'ATT_address'  => ! empty($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '',
1222
+			'ATT_address2' => ! empty($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '',
1223
+			'ATT_city'     => ! empty($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '',
1224 1224
 			'STA_ID'       => $STA_ID,
1225 1225
 			'CNT_ISO'      => $CNT_ISO,
1226
-			'ATT_zip'      => ! empty( $_REQUEST['zip'] ) ? sanitize_text_field( $_REQUEST['zip'] ) : '',
1227
-			'ATT_phone'    => ! empty( $_REQUEST['phone'] ) ? sanitize_text_field( $_REQUEST['phone'] ) : '',
1226
+			'ATT_zip'      => ! empty($_REQUEST['zip']) ? sanitize_text_field($_REQUEST['zip']) : '',
1227
+			'ATT_phone'    => ! empty($_REQUEST['phone']) ? sanitize_text_field($_REQUEST['phone']) : '',
1228 1228
 		);
1229 1229
 		// validate the email address since it is the most important piece of info
1230
-		if ( empty( $attendee_data['ATT_email'] ) || $attendee_data['ATT_email'] !== $_REQUEST['email'] ) {
1230
+		if (empty($attendee_data['ATT_email']) || $attendee_data['ATT_email'] !== $_REQUEST['email']) {
1231 1231
 			EE_Error::add_error(
1232
-				__( 'An invalid email address was submitted.', 'event_espresso' ),
1232
+				__('An invalid email address was submitted.', 'event_espresso'),
1233 1233
 				__FILE__,
1234 1234
 				__FUNCTION__,
1235 1235
 				__LINE__
1236 1236
 			);
1237 1237
 		}
1238 1238
 		// does this attendee already exist in the db ? we're searching using a combination of first name, last name, AND email address
1239
-		if ( ! empty( $attendee_data['ATT_fname'] )
1240
-		     && ! empty( $attendee_data['ATT_lname'] )
1241
-		     && ! empty( $attendee_data['ATT_email'] )
1239
+		if ( ! empty($attendee_data['ATT_fname'])
1240
+		     && ! empty($attendee_data['ATT_lname'])
1241
+		     && ! empty($attendee_data['ATT_email'])
1242 1242
 		) {
1243 1243
 			$existing_attendee = EE_Registry::instance()->LIB->EEM_Attendee->find_existing_attendee(
1244 1244
 				array(
@@ -1247,19 +1247,19 @@  discard block
 block discarded – undo
1247 1247
 					'ATT_email' => $attendee_data['ATT_email']
1248 1248
 				)
1249 1249
 			);
1250
-			if ( $existing_attendee instanceof EE_Attendee ) {
1250
+			if ($existing_attendee instanceof EE_Attendee) {
1251 1251
 				return $existing_attendee;
1252 1252
 			}
1253 1253
 		}
1254 1254
 		// no existing attendee? kk let's create a new one
1255 1255
 		// kinda lame, but we need a first and last name to create an attendee, so use the email address if those don't exist
1256
-		$attendee_data['ATT_fname'] = ! empty( $attendee_data['ATT_fname'] )
1256
+		$attendee_data['ATT_fname'] = ! empty($attendee_data['ATT_fname'])
1257 1257
 			? $attendee_data['ATT_fname']
1258 1258
 			: $attendee_data['ATT_email'];
1259
-		$attendee_data['ATT_lname'] = ! empty( $attendee_data['ATT_lname'] )
1259
+		$attendee_data['ATT_lname'] = ! empty($attendee_data['ATT_lname'])
1260 1260
 			? $attendee_data['ATT_lname']
1261 1261
 			: $attendee_data['ATT_email'];
1262
-		return EE_Attendee::new_instance( $attendee_data );
1262
+		return EE_Attendee::new_instance($attendee_data);
1263 1263
 	}
1264 1264
 
1265 1265
 
@@ -1277,26 +1277,26 @@  discard block
 block discarded – undo
1277 1277
 		// how have they chosen to pay?
1278 1278
 		$this->checkout->selected_method_of_payment = $this->checkout->transaction->is_free()
1279 1279
 			? 'no_payment_required'
1280
-			: $this->_get_selected_method_of_payment( true );
1280
+			: $this->_get_selected_method_of_payment(true);
1281 1281
 		// choose your own adventure based on method_of_payment
1282
-		switch ( $this->checkout->selected_method_of_payment ) {
1282
+		switch ($this->checkout->selected_method_of_payment) {
1283 1283
 
1284 1284
 			case 'events_sold_out' :
1285 1285
 				$this->checkout->redirect = true;
1286 1286
 				$this->checkout->redirect_url = $this->checkout->cancel_page_url;
1287
-				$this->checkout->json_response->set_redirect_url( $this->checkout->redirect_url );
1287
+				$this->checkout->json_response->set_redirect_url($this->checkout->redirect_url);
1288 1288
 				// mark this reg step as completed
1289 1289
 				$this->set_completed();
1290 1290
 				return false;
1291 1291
 				break;
1292 1292
 
1293 1293
 			case 'payments_closed' :
1294
-				if ( apply_filters(
1294
+				if (apply_filters(
1295 1295
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__payments_closed__display_success',
1296 1296
 					false
1297
-				) ) {
1297
+				)) {
1298 1298
 					EE_Error::add_success(
1299
-						__( 'no payment required at this time.', 'event_espresso' ),
1299
+						__('no payment required at this time.', 'event_espresso'),
1300 1300
 						__FILE__,
1301 1301
 						__FUNCTION__,
1302 1302
 						__LINE__
@@ -1308,12 +1308,12 @@  discard block
 block discarded – undo
1308 1308
 				break;
1309 1309
 
1310 1310
 			case 'no_payment_required' :
1311
-				if ( apply_filters(
1311
+				if (apply_filters(
1312 1312
 					'FHEE__EE_SPCO_Reg_Step_Payment_Options__process_reg_step__no_payment_required__display_success',
1313 1313
 					false
1314
-				) ) {
1314
+				)) {
1315 1315
 					EE_Error::add_success(
1316
-						__( 'no payment required.', 'event_espresso' ),
1316
+						__('no payment required.', 'event_espresso'),
1317 1317
 						__FILE__,
1318 1318
 						__FUNCTION__,
1319 1319
 						__LINE__
@@ -1326,9 +1326,9 @@  discard block
 block discarded – undo
1326 1326
 
1327 1327
 			default:
1328 1328
 				$payment_successful = $this->_process_payment();
1329
-				if ( $payment_successful ) {
1329
+				if ($payment_successful) {
1330 1330
 					$this->checkout->continue_reg = true;
1331
-					$this->_maybe_set_completed( $this->checkout->payment_method );
1331
+					$this->_maybe_set_completed($this->checkout->payment_method);
1332 1332
 				} else {
1333 1333
 					$this->checkout->continue_reg = false;
1334 1334
 				}
@@ -1347,8 +1347,8 @@  discard block
 block discarded – undo
1347 1347
 	 * @return void
1348 1348
 	 * @throws \EE_Error
1349 1349
 	 */
1350
-	protected function _maybe_set_completed( EE_Payment_Method $payment_method ) {
1351
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1350
+	protected function _maybe_set_completed(EE_Payment_Method $payment_method) {
1351
+		switch ($payment_method->type_obj()->payment_occurs()) {
1352 1352
 			case EE_PMT_Base::offsite :
1353 1353
 				break;
1354 1354
 			case EE_PMT_Base::onsite :
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 	public function update_reg_step() {
1372 1372
 		$success = true;
1373 1373
 		// if payment required
1374
-		if ( $this->checkout->transaction->total() > 0 ) {
1374
+		if ($this->checkout->transaction->total() > 0) {
1375 1375
 			do_action(
1376 1376
 				'AHEE__EE_Single_Page_Checkout__process_finalize_registration__before_gateway',
1377 1377
 				$this->checkout->transaction
@@ -1379,13 +1379,13 @@  discard block
 block discarded – undo
1379 1379
 			// attempt payment via payment method
1380 1380
 			$success = $this->process_reg_step();
1381 1381
 		}
1382
-		if ( $success && ! $this->checkout->redirect ) {
1382
+		if ($success && ! $this->checkout->redirect) {
1383 1383
 			$this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn(
1384 1384
 				$this->checkout->transaction->ID()
1385 1385
 			);
1386 1386
 			// set return URL
1387 1387
 			$this->checkout->redirect_url = add_query_arg(
1388
-				array( 'e_reg_url_link' => $this->checkout->reg_url_link ),
1388
+				array('e_reg_url_link' => $this->checkout->reg_url_link),
1389 1389
 				$this->checkout->thank_you_page_url
1390 1390
 			);
1391 1391
 		}
@@ -1405,28 +1405,28 @@  discard block
 block discarded – undo
1405 1405
 		// clear any previous errors related to not selecting a payment method
1406 1406
 //		EE_Error::overwrite_errors();
1407 1407
 		// ya gotta make a choice man
1408
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
1408
+		if (empty($this->checkout->selected_method_of_payment)) {
1409 1409
 			$this->checkout->json_response->set_plz_select_method_of_payment(
1410
-				__( 'Please select a method of payment before proceeding.', 'event_espresso' )
1410
+				__('Please select a method of payment before proceeding.', 'event_espresso')
1411 1411
 			);
1412 1412
 			return false;
1413 1413
 		}
1414 1414
 		// get EE_Payment_Method object
1415
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
1415
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
1416 1416
 			return false;
1417 1417
 		}
1418 1418
 		// setup billing form
1419
-		if ( $this->checkout->payment_method->is_on_site() ) {
1419
+		if ($this->checkout->payment_method->is_on_site()) {
1420 1420
 			$this->checkout->billing_form = $this->_get_billing_form_for_payment_method(
1421 1421
 				$this->checkout->payment_method
1422 1422
 			);
1423 1423
 			// bad billing form ?
1424
-			if ( ! $this->_billing_form_is_valid() ) {
1424
+			if ( ! $this->_billing_form_is_valid()) {
1425 1425
 				return false;
1426 1426
 			}
1427 1427
 		}
1428 1428
 		// ensure primary registrant has been fully processed
1429
-		if ( ! $this->_setup_primary_registrant_prior_to_payment() ) {
1429
+		if ( ! $this->_setup_primary_registrant_prior_to_payment()) {
1430 1430
 			return false;
1431 1431
 		}
1432 1432
 		/** @type EE_Transaction_Processor $transaction_processor */
@@ -1434,18 +1434,18 @@  discard block
 block discarded – undo
1434 1434
 		// 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
1435 1435
 		//$transaction_processor->toggle_registration_statuses_for_default_approved_events( $this->checkout->transaction, $this->checkout->reg_cache_where_params );
1436 1436
 		// attempt payment
1437
-		$payment = $this->_attempt_payment( $this->checkout->payment_method );
1437
+		$payment = $this->_attempt_payment($this->checkout->payment_method);
1438 1438
 		// process results
1439
-		$payment = $this->_validate_payment( $payment );
1440
-		$payment = $this->_post_payment_processing( $payment );
1439
+		$payment = $this->_validate_payment($payment);
1440
+		$payment = $this->_post_payment_processing($payment);
1441 1441
 		// verify payment
1442
-		if ( $payment instanceof EE_Payment ) {
1442
+		if ($payment instanceof EE_Payment) {
1443 1443
 			// store that for later
1444 1444
 			$this->checkout->payment = $payment;
1445 1445
 			/** @type EE_Transaction_Processor $transaction_processor */
1446
-			$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1446
+			$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1447 1447
 			// we can also consider the TXN to not have been failed, so temporarily upgrade it's status to abandoned
1448
-			$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1448
+			$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1449 1449
 			$payment_status = $payment->status();
1450 1450
 			if (
1451 1451
 				$payment_status === EEM_Payment::status_id_approved
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 			} else {
1456 1456
 				return false;
1457 1457
 			}
1458
-		} else if ( $payment === true ) {
1458
+		} else if ($payment === true) {
1459 1459
 			// please note that offline payment methods will NOT make a payment,
1460 1460
 			// but instead just mark themselves as the PMD_ID on the transaction, and return true
1461 1461
 			$this->checkout->payment = $payment;
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 		);
1481 1481
 		$html = $payment_method_billing_info->get_html_and_js();
1482 1482
 		$html .= $this->checkout->redirect_form;
1483
-		EE_Registry::instance()->REQ->add_output( $html );
1483
+		EE_Registry::instance()->REQ->add_output($html);
1484 1484
 		return true;
1485 1485
 	}
1486 1486
 
@@ -1494,28 +1494,28 @@  discard block
 block discarded – undo
1494 1494
 	 * @throws \EE_Error
1495 1495
 	 */
1496 1496
 	private function _billing_form_is_valid() {
1497
-		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form() ) {
1497
+		if ( ! $this->checkout->payment_method->type_obj()->has_billing_form()) {
1498 1498
 			return true;
1499 1499
 		}
1500
-		if ( $this->checkout->billing_form instanceof EE_Billing_Info_Form ) {
1501
-			if ( $this->checkout->billing_form->was_submitted() ) {
1500
+		if ($this->checkout->billing_form instanceof EE_Billing_Info_Form) {
1501
+			if ($this->checkout->billing_form->was_submitted()) {
1502 1502
 				$this->checkout->billing_form->receive_form_submission();
1503
-				if ( $this->checkout->billing_form->is_valid() ) {
1503
+				if ($this->checkout->billing_form->is_valid()) {
1504 1504
 					return true;
1505 1505
 				}
1506 1506
 				$validation_errors = $this->checkout->billing_form->get_validation_errors_accumulated();
1507 1507
 				$error_strings = array();
1508
-				foreach ( $validation_errors as $validation_error ) {
1509
-					if ( $validation_error instanceof EE_Validation_Error ) {
1508
+				foreach ($validation_errors as $validation_error) {
1509
+					if ($validation_error instanceof EE_Validation_Error) {
1510 1510
 						$form_section = $validation_error->get_form_section();
1511
-						if ( $form_section instanceof EE_Form_Input_Base ) {
1511
+						if ($form_section instanceof EE_Form_Input_Base) {
1512 1512
 							$label = $form_section->html_label_text();
1513
-						} elseif ( $form_section instanceof EE_Form_Section_Base ) {
1513
+						} elseif ($form_section instanceof EE_Form_Section_Base) {
1514 1514
 							$label = $form_section->name();
1515 1515
 						} else {
1516
-							$label = __( 'Validation Error', 'event_espresso' );
1516
+							$label = __('Validation Error', 'event_espresso');
1517 1517
 						}
1518
-						$error_strings[] = sprintf( '%1$s: %2$s', $label, $validation_error->getMessage() );
1518
+						$error_strings[] = sprintf('%1$s: %2$s', $label, $validation_error->getMessage());
1519 1519
 					}
1520 1520
 				}
1521 1521
 				EE_Error::add_error(
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 							'event_espresso'
1526 1526
 						),
1527 1527
 						'<br/>',
1528
-						implode( '<br/>', $error_strings )
1528
+						implode('<br/>', $error_strings)
1529 1529
 					),
1530 1530
 					__FILE__,
1531 1531
 					__FUNCTION__,
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
 			}
1545 1545
 		} else {
1546 1546
 			EE_Error::add_error(
1547
-				__( 'The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso' ),
1547
+				__('The submitted billing form is invalid possibly due to a technical reason.', 'event_espresso'),
1548 1548
 				__FILE__,
1549 1549
 				__FUNCTION__,
1550 1550
 				__LINE__
@@ -1579,13 +1579,13 @@  discard block
 block discarded – undo
1579 1579
 		// grab the primary_registration object
1580 1580
 		$primary_registration = $this->checkout->transaction->primary_registration();
1581 1581
 		/** @type EE_Transaction_Processor $transaction_processor */
1582
-		$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
1582
+		$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
1583 1583
 		// at this point we'll consider a TXN to not have been failed
1584
-		$transaction_processor->toggle_failed_transaction_status( $this->checkout->transaction );
1584
+		$transaction_processor->toggle_failed_transaction_status($this->checkout->transaction);
1585 1585
 		// save the TXN ( which clears cached copy of primary_registration)
1586 1586
 		$this->checkout->transaction->save();
1587 1587
 		// grab TXN ID and save it to the primary_registration
1588
-		$primary_registration->set_transaction_id( $this->checkout->transaction->ID() );
1588
+		$primary_registration->set_transaction_id($this->checkout->transaction->ID());
1589 1589
 		// save what we have so far
1590 1590
 		$primary_registration->save();
1591 1591
 		return true;
@@ -1603,7 +1603,7 @@  discard block
 block discarded – undo
1603 1603
 	private function _capture_primary_registration_data_from_billing_form() {
1604 1604
 		// convert billing form data into an attendee
1605 1605
 		$this->checkout->primary_attendee_obj = $this->checkout->billing_form->create_attendee_from_billing_form_data();
1606
-		if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee ) {
1606
+		if ( ! $this->checkout->primary_attendee_obj instanceof EE_Attendee) {
1607 1607
 			EE_Error::add_error(
1608 1608
 				sprintf(
1609 1609
 					__(
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 						'event_espresso'
1612 1612
 					),
1613 1613
 					'<br/>',
1614
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1614
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1615 1615
 				),
1616 1616
 				__FILE__,
1617 1617
 				__FUNCTION__,
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 			return false;
1621 1621
 		}
1622 1622
 		$primary_registration = $this->checkout->transaction->primary_registration();
1623
-		if ( ! $primary_registration instanceof EE_Registration ) {
1623
+		if ( ! $primary_registration instanceof EE_Registration) {
1624 1624
 			EE_Error::add_error(
1625 1625
 				sprintf(
1626 1626
 					__(
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 						'event_espresso'
1629 1629
 					),
1630 1630
 					'<br/>',
1631
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1631
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1632 1632
 				),
1633 1633
 				__FILE__,
1634 1634
 				__FUNCTION__,
@@ -1636,7 +1636,7 @@  discard block
 block discarded – undo
1636 1636
 			);
1637 1637
 			return false;
1638 1638
 		}
1639
-		if ( ! $primary_registration->_add_relation_to( $this->checkout->primary_attendee_obj, 'Attendee' )
1639
+		if ( ! $primary_registration->_add_relation_to($this->checkout->primary_attendee_obj, 'Attendee')
1640 1640
 		       instanceof
1641 1641
 		       EE_Attendee
1642 1642
 		) {
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 						'event_espresso'
1648 1648
 					),
1649 1649
 					'<br/>',
1650
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1650
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1651 1651
 				),
1652 1652
 				__FILE__,
1653 1653
 				__FUNCTION__,
@@ -1656,9 +1656,9 @@  discard block
 block discarded – undo
1656 1656
 			return false;
1657 1657
 		}
1658 1658
 		/** @type EE_Registration_Processor $registration_processor */
1659
-		$registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' );
1659
+		$registration_processor = EE_Registry::instance()->load_class('Registration_Processor');
1660 1660
 		// at this point, we should have enough details about the registrant to consider the registration NOT incomplete
1661
-		$registration_processor->toggle_incomplete_registration_status_to_default( $primary_registration );
1661
+		$registration_processor->toggle_incomplete_registration_status_to_default($primary_registration);
1662 1662
 		return true;
1663 1663
 	}
1664 1664
 
@@ -1674,17 +1674,17 @@  discard block
 block discarded – undo
1674 1674
 	 */
1675 1675
 	private function _get_payment_method_for_selected_method_of_payment() {
1676 1676
 		// get EE_Payment_Method object
1677
-		if ( isset( $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ] ) ) {
1678
-			$payment_method = $this->checkout->available_payment_methods[ $this->checkout->selected_method_of_payment ];
1677
+		if (isset($this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment])) {
1678
+			$payment_method = $this->checkout->available_payment_methods[$this->checkout->selected_method_of_payment];
1679 1679
 		} else {
1680 1680
 			// load EEM_Payment_Method
1681
-			EE_Registry::instance()->load_model( 'Payment_Method' );
1681
+			EE_Registry::instance()->load_model('Payment_Method');
1682 1682
 			/** @type EEM_Payment_Method $EEM_Payment_Method */
1683 1683
 			$EEM_Payment_Method = EE_Registry::instance()->LIB->EEM_Payment_Method;
1684
-			$payment_method = $EEM_Payment_Method->get_one_by_slug( $this->checkout->selected_method_of_payment );
1684
+			$payment_method = $EEM_Payment_Method->get_one_by_slug($this->checkout->selected_method_of_payment);
1685 1685
 		}
1686 1686
 		// verify $payment_method
1687
-		if ( ! $payment_method instanceof EE_Payment_Method ) {
1687
+		if ( ! $payment_method instanceof EE_Payment_Method) {
1688 1688
 			// not a payment
1689 1689
 			EE_Error::add_error(
1690 1690
 				sprintf(
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
 						'event_espresso'
1694 1694
 					),
1695 1695
 					'<br/>',
1696
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1696
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1697 1697
 				),
1698 1698
 				__FILE__,
1699 1699
 				__FUNCTION__,
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
 			return null;
1703 1703
 		}
1704 1704
 		// and verify it has a valid Payment_Method Type object
1705
-		if ( ! $payment_method->type_obj() instanceof EE_PMT_Base ) {
1705
+		if ( ! $payment_method->type_obj() instanceof EE_PMT_Base) {
1706 1706
 			// not a payment
1707 1707
 			EE_Error::add_error(
1708 1708
 				sprintf(
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 						'event_espresso'
1712 1712
 					),
1713 1713
 					'<br/>',
1714
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1714
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1715 1715
 				),
1716 1716
 				__FILE__,
1717 1717
 				__FUNCTION__,
@@ -1732,29 +1732,29 @@  discard block
 block discarded – undo
1732 1732
 	 * @return    mixed    EE_Payment | boolean
1733 1733
 	 * @throws \EE_Error
1734 1734
 	 */
1735
-	private function _attempt_payment( EE_Payment_Method $payment_method ) {
1735
+	private function _attempt_payment(EE_Payment_Method $payment_method) {
1736 1736
 		$payment = null;
1737 1737
 		$this->checkout->transaction->save();
1738
-		$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
1739
-		if ( ! $payment_processor instanceof EE_Payment_Processor ) {
1738
+		$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
1739
+		if ( ! $payment_processor instanceof EE_Payment_Processor) {
1740 1740
 			return false;
1741 1741
 		}
1742 1742
 		try {
1743
-			$payment_processor->set_revisit( $this->checkout->revisit );
1743
+			$payment_processor->set_revisit($this->checkout->revisit);
1744 1744
 			// generate payment object
1745 1745
 			$payment = $payment_processor->process_payment(
1746 1746
 				$payment_method,
1747 1747
 				$this->checkout->transaction,
1748 1748
 				$this->checkout->amount_owing,
1749 1749
 				$this->checkout->billing_form,
1750
-				$this->_get_return_url( $payment_method ),
1750
+				$this->_get_return_url($payment_method),
1751 1751
 				'CART',
1752 1752
 				$this->checkout->admin_request,
1753 1753
 				true,
1754 1754
 				$this->reg_step_url()
1755 1755
 			);
1756
-		} catch ( Exception $e ) {
1757
-			$this->_handle_payment_processor_exception( $e );
1756
+		} catch (Exception $e) {
1757
+			$this->_handle_payment_processor_exception($e);
1758 1758
 		}
1759 1759
 		return $payment;
1760 1760
 	}
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 	 * @return void
1770 1770
 	 * @throws \EE_Error
1771 1771
 	 */
1772
-	protected function _handle_payment_processor_exception( Exception $e ) {
1772
+	protected function _handle_payment_processor_exception(Exception $e) {
1773 1773
 		EE_Error::add_error(
1774 1774
 			sprintf(
1775 1775
 				__(
@@ -1777,7 +1777,7 @@  discard block
 block discarded – undo
1777 1777
 					'event_espresso'
1778 1778
 				),
1779 1779
 				'<br/>',
1780
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' ),
1780
+				EE_Registry::instance()->CFG->organization->get_pretty('email'),
1781 1781
 				$e->getMessage(),
1782 1782
 				$e->getFile(),
1783 1783
 				$e->getLine()
@@ -1798,9 +1798,9 @@  discard block
 block discarded – undo
1798 1798
 	 * @return string
1799 1799
 	 * @throws \EE_Error
1800 1800
 	 */
1801
-	protected function _get_return_url( EE_Payment_Method $payment_method ) {
1801
+	protected function _get_return_url(EE_Payment_Method $payment_method) {
1802 1802
 		$return_url = '';
1803
-		switch ( $payment_method->type_obj()->payment_occurs() ) {
1803
+		switch ($payment_method->type_obj()->payment_occurs()) {
1804 1804
 			case EE_PMT_Base::offsite :
1805 1805
 				$return_url = add_query_arg(
1806 1806
 					array(
@@ -1829,12 +1829,12 @@  discard block
 block discarded – undo
1829 1829
 	 * @return EE_Payment | FALSE
1830 1830
 	 * @throws \EE_Error
1831 1831
 	 */
1832
-	private function _validate_payment( $payment = null ) {
1833
-		if ( $this->checkout->payment_method->is_off_line() ) {
1832
+	private function _validate_payment($payment = null) {
1833
+		if ($this->checkout->payment_method->is_off_line()) {
1834 1834
 			return true;
1835 1835
 		}
1836 1836
 		// verify payment object
1837
-		if ( ! $payment instanceof EE_Payment ) {
1837
+		if ( ! $payment instanceof EE_Payment) {
1838 1838
 			// not a payment
1839 1839
 			EE_Error::add_error(
1840 1840
 				sprintf(
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 						'event_espresso'
1844 1844
 					),
1845 1845
 					'<br/>',
1846
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1846
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
1847 1847
 				),
1848 1848
 				__FILE__,
1849 1849
 				__FUNCTION__,
@@ -1864,27 +1864,27 @@  discard block
 block discarded – undo
1864 1864
 	 * @return bool
1865 1865
 	 * @throws \EE_Error
1866 1866
 	 */
1867
-	private function _post_payment_processing( $payment = null ) {
1867
+	private function _post_payment_processing($payment = null) {
1868 1868
 		// Off-Line payment?
1869
-		if ( $payment === true ) {
1869
+		if ($payment === true) {
1870 1870
 			//$this->_setup_redirect_for_next_step();
1871 1871
 			return true;
1872 1872
 		// On-Site payment?
1873
-		} else if ( $this->checkout->payment_method->is_on_site() ) {
1874
-			if ( ! $this->_process_payment_status( $payment, EE_PMT_Base::onsite ) ) {
1873
+		} else if ($this->checkout->payment_method->is_on_site()) {
1874
+			if ( ! $this->_process_payment_status($payment, EE_PMT_Base::onsite)) {
1875 1875
 				//$this->_setup_redirect_for_next_step();
1876 1876
 				$this->checkout->continue_reg = false;
1877 1877
 			}
1878 1878
 		// Off-Site payment?
1879
-		} else if ( $this->checkout->payment_method->is_off_site() ) {
1879
+		} else if ($this->checkout->payment_method->is_off_site()) {
1880 1880
 			// if a payment object was made and it specifies a redirect url, then we'll setup that redirect info
1881
-			if ( $payment instanceof EE_Payment && $payment->redirect_url() ) {
1882
-				do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()' );
1881
+			if ($payment instanceof EE_Payment && $payment->redirect_url()) {
1882
+				do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->redirect_url(), '$payment->redirect_url()');
1883 1883
 				$this->checkout->redirect = true;
1884 1884
 				$this->checkout->redirect_form = $payment->redirect_form();
1885
-				$this->checkout->redirect_url = $this->reg_step_url( 'redirect_form' );
1885
+				$this->checkout->redirect_url = $this->reg_step_url('redirect_form');
1886 1886
 				// set JSON response
1887
-				$this->checkout->json_response->set_redirect_form( $this->checkout->redirect_form );
1887
+				$this->checkout->json_response->set_redirect_form($this->checkout->redirect_form);
1888 1888
 				// set cron job for finalizing the TXN
1889 1889
 				// in case the user does not return from the off-site gateway
1890 1890
 				EE_Cron_Tasks::schedule_finalize_abandoned_transactions_check(
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 					$this->checkout->transaction->ID()
1893 1893
 				);
1894 1894
 				// and lastly, let's bump the payment status to pending
1895
-				$payment->set_status( EEM_Payment::status_id_pending );
1895
+				$payment->set_status(EEM_Payment::status_id_pending);
1896 1896
 				$payment->save();
1897 1897
 			} else {
1898 1898
 				// not a payment
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
 							'event_espresso'
1905 1905
 						),
1906 1906
 						'<br/>',
1907
-						EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
1907
+						EE_Registry::instance()->CFG->organization->get_pretty('email')
1908 1908
 					),
1909 1909
 					__FILE__,
1910 1910
 					__FUNCTION__,
@@ -1942,21 +1942,21 @@  discard block
 block discarded – undo
1942 1942
 	 * @return bool
1943 1943
 	 * @throws \EE_Error
1944 1944
 	 */
1945
-	private function _process_payment_status( $payment, $payment_occurs = EE_PMT_Base::offline ) {
1945
+	private function _process_payment_status($payment, $payment_occurs = EE_PMT_Base::offline) {
1946 1946
 		// off-line payment? carry on
1947
-		if ( $payment_occurs === EE_PMT_Base::offline ) {
1947
+		if ($payment_occurs === EE_PMT_Base::offline) {
1948 1948
 			return true;
1949 1949
 		}
1950 1950
 		// verify payment validity
1951
-		if ( $payment instanceof EE_Payment ) {
1952
-			do_action( 'AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()' );
1951
+		if ($payment instanceof EE_Payment) {
1952
+			do_action('AHEE_log', __CLASS__, __FUNCTION__, $payment->status(), '$payment->status()');
1953 1953
 			$msg = $payment->gateway_response();
1954 1954
 			// check results
1955
-			switch ( $payment->status() ) {
1955
+			switch ($payment->status()) {
1956 1956
 				// good payment
1957 1957
 				case EEM_Payment::status_id_approved :
1958 1958
 					EE_Error::add_success(
1959
-						__( 'Your payment was processed successfully.', 'event_espresso' ),
1959
+						__('Your payment was processed successfully.', 'event_espresso'),
1960 1960
 						__FILE__,
1961 1961
 						__FUNCTION__,
1962 1962
 						__LINE__
@@ -1965,45 +1965,45 @@  discard block
 block discarded – undo
1965 1965
 					break;
1966 1966
 				// slow payment
1967 1967
 				case EEM_Payment::status_id_pending :
1968
-					if ( empty( $msg ) ) {
1968
+					if (empty($msg)) {
1969 1969
 						$msg = __(
1970 1970
 							'Your payment appears to have been processed successfully, but the Instant Payment Notification has not yet been received. It should arrive shortly.',
1971 1971
 							'event_espresso'
1972 1972
 						);
1973 1973
 					}
1974
-					EE_Error::add_success( $msg, __FILE__, __FUNCTION__, __LINE__ );
1974
+					EE_Error::add_success($msg, __FILE__, __FUNCTION__, __LINE__);
1975 1975
 					return true;
1976 1976
 					break;
1977 1977
 				// don't wanna payment
1978 1978
 				case EEM_Payment::status_id_cancelled :
1979
-					if ( empty( $msg ) ) {
1979
+					if (empty($msg)) {
1980 1980
 						$msg = _n(
1981 1981
 							'Payment cancelled. Please try again.',
1982 1982
 							'Payment cancelled. Please try again or select another method of payment.',
1983
-							count( $this->checkout->available_payment_methods ),
1983
+							count($this->checkout->available_payment_methods),
1984 1984
 							'event_espresso'
1985 1985
 						);
1986 1986
 					}
1987
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
1987
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
1988 1988
 					return false;
1989 1989
 					break;
1990 1990
 				// not enough payment
1991 1991
 				case EEM_Payment::status_id_declined :
1992
-					if ( empty( $msg ) ) {
1992
+					if (empty($msg)) {
1993 1993
 						$msg = _n(
1994 1994
 							'We\'re sorry but your payment was declined. Please try again.',
1995 1995
 							'We\'re sorry but your payment was declined. Please try again or select another method of payment.',
1996
-							count( $this->checkout->available_payment_methods ),
1996
+							count($this->checkout->available_payment_methods),
1997 1997
 							'event_espresso'
1998 1998
 						);
1999 1999
 					}
2000
-					EE_Error::add_attention( $msg, __FILE__, __FUNCTION__, __LINE__ );
2000
+					EE_Error::add_attention($msg, __FILE__, __FUNCTION__, __LINE__);
2001 2001
 					return false;
2002 2002
 					break;
2003 2003
 				// bad payment
2004 2004
 				case EEM_Payment::status_id_failed :
2005
-					if ( ! empty( $msg ) ) {
2006
-						EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
2005
+					if ( ! empty($msg)) {
2006
+						EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2007 2007
 						return false;
2008 2008
 					}
2009 2009
 					// default to error below
@@ -2012,7 +2012,7 @@  discard block
 block discarded – undo
2012 2012
 		}
2013 2013
 		// off-site payment gateway responses are too unreliable, so let's just assume that
2014 2014
 		// the payment processing is just running slower than the registrant's request
2015
-		if ( $payment_occurs === EE_PMT_Base::offsite ) {
2015
+		if ($payment_occurs === EE_PMT_Base::offsite) {
2016 2016
 			return true;
2017 2017
 		}
2018 2018
 		EE_Error::add_error(
@@ -2022,7 +2022,7 @@  discard block
 block discarded – undo
2022 2022
 					'event_espresso'
2023 2023
 				),
2024 2024
 				'<br/>',
2025
-				EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
2025
+				EE_Registry::instance()->CFG->organization->get_pretty('email')
2026 2026
 			),
2027 2027
 			__FILE__,
2028 2028
 			__FUNCTION__,
@@ -2055,13 +2055,13 @@  discard block
 block discarded – undo
2055 2055
 	public function process_gateway_response() {
2056 2056
 		$payment = null;
2057 2057
 		// how have they chosen to pay?
2058
-		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment( true );
2058
+		$this->checkout->selected_method_of_payment = $this->_get_selected_method_of_payment(true);
2059 2059
 		// get EE_Payment_Method object
2060
-		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment() ) {
2060
+		if ( ! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()) {
2061 2061
 			$this->checkout->continue_reg = false;
2062 2062
 			return false;
2063 2063
 		}
2064
-		if ( ! $this->checkout->payment_method->is_off_site() ) {
2064
+		if ( ! $this->checkout->payment_method->is_off_site()) {
2065 2065
 			return false;
2066 2066
 		}
2067 2067
 		$this->_validate_offsite_return();
@@ -2075,23 +2075,23 @@  discard block
 block discarded – undo
2075 2075
 		//	true
2076 2076
 		//);
2077 2077
 		// verify TXN
2078
-		if ( $this->checkout->transaction instanceof EE_Transaction ) {
2078
+		if ($this->checkout->transaction instanceof EE_Transaction) {
2079 2079
 			$gateway = $this->checkout->payment_method->type_obj()->get_gateway();
2080
-			if ( ! $gateway instanceof EE_Offsite_Gateway ) {
2080
+			if ( ! $gateway instanceof EE_Offsite_Gateway) {
2081 2081
 				$this->checkout->continue_reg = false;
2082 2082
 				return false;
2083 2083
 			}
2084
-			$payment = $this->_process_off_site_payment( $gateway );
2085
-			$payment = $this->_process_cancelled_payments( $payment );
2086
-			$payment = $this->_validate_payment( $payment );
2084
+			$payment = $this->_process_off_site_payment($gateway);
2085
+			$payment = $this->_process_cancelled_payments($payment);
2086
+			$payment = $this->_validate_payment($payment);
2087 2087
 			// if payment was not declined by the payment gateway or cancelled by the registrant
2088
-			if ( $this->_process_payment_status( $payment, EE_PMT_Base::offsite ) ) {
2088
+			if ($this->_process_payment_status($payment, EE_PMT_Base::offsite)) {
2089 2089
 				//$this->_setup_redirect_for_next_step();
2090 2090
 				// store that for later
2091 2091
 				$this->checkout->payment = $payment;
2092 2092
 				// mark this reg step as completed, as long as gateway doesn't use a separate IPN request,
2093 2093
 				// because we will complete this step during the IPN processing then
2094
-				if ( $gateway instanceof EE_Offsite_Gateway && ! $gateway->uses_separate_IPN_request() ) {
2094
+				if ($gateway instanceof EE_Offsite_Gateway && ! $gateway->uses_separate_IPN_request()) {
2095 2095
 					$this->set_completed();
2096 2096
 				}
2097 2097
 				return true;
@@ -2115,21 +2115,21 @@  discard block
 block discarded – undo
2115 2115
 	 * @throws \EE_Error
2116 2116
 	 */
2117 2117
 	private function _validate_offsite_return() {
2118
-		$TXN_ID = (int)EE_Registry::instance()->REQ->get( 'spco_txn', 0 );
2119
-		if ( $TXN_ID !== $this->checkout->transaction->ID() ) {
2118
+		$TXN_ID = (int) EE_Registry::instance()->REQ->get('spco_txn', 0);
2119
+		if ($TXN_ID !== $this->checkout->transaction->ID()) {
2120 2120
 			// Houston... we might have a problem
2121 2121
 			$invalid_TXN = false;
2122 2122
 			// first gather some info
2123
-			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID( $TXN_ID );
2123
+			$valid_TXN = EEM_Transaction::instance()->get_one_by_ID($TXN_ID);
2124 2124
 			$primary_registrant = $valid_TXN instanceof EE_Transaction
2125 2125
 				? $valid_TXN->primary_registration()
2126 2126
 				: null;
2127 2127
 			// let's start by retrieving the cart for this TXN
2128
-			$cart = EE_Cart::get_cart_from_txn( $this->checkout->transaction );
2129
-			if ( $cart instanceof EE_Cart ) {
2128
+			$cart = EE_Cart::get_cart_from_txn($this->checkout->transaction);
2129
+			if ($cart instanceof EE_Cart) {
2130 2130
 				// verify that the current cart has tickets
2131 2131
 				$tickets = $cart->get_tickets();
2132
-				if ( empty( $tickets ) ) {
2132
+				if (empty($tickets)) {
2133 2133
 					$invalid_TXN = true;
2134 2134
 				}
2135 2135
 			} else {
@@ -2139,39 +2139,39 @@  discard block
 block discarded – undo
2139 2139
 				? $primary_registrant->session_ID()
2140 2140
 				: null;
2141 2141
 			// validate current Session ID and compare against valid TXN session ID
2142
-			if ( EE_Session::instance()->id() === null ) {
2142
+			if (EE_Session::instance()->id() === null) {
2143 2143
 				$invalid_TXN = true;
2144
-			} else if ( EE_Session::instance()->id() === $valid_TXN_SID ) {
2144
+			} else if (EE_Session::instance()->id() === $valid_TXN_SID) {
2145 2145
 				// WARNING !!!
2146 2146
 				// this could be PayPal sending back duplicate requests (ya they do that)
2147 2147
 				// or it **could** mean someone is simply registering AGAIN after having just done so
2148 2148
 				// so now we need to determine if this current TXN looks valid or not
2149 2149
 				/** @type EE_Transaction_Processor $transaction_processor */
2150
-				$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
2150
+				$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
2151 2151
 				// has this step even been started ?
2152
-				if ( $transaction_processor->reg_step_completed( $this->checkout->transaction, $this->slug() === false )
2152
+				if ($transaction_processor->reg_step_completed($this->checkout->transaction, $this->slug() === false)
2153 2153
 				) {
2154 2154
 					// really? you're half way through this reg step, but you never started it ?
2155 2155
 					$invalid_TXN = true;
2156 2156
 				}
2157 2157
 			}
2158
-			if ( $invalid_TXN ) {
2158
+			if ($invalid_TXN) {
2159 2159
 				// is the valid TXN completed ?
2160
-				if ( $valid_TXN instanceof EE_Transaction ) {
2160
+				if ($valid_TXN instanceof EE_Transaction) {
2161 2161
 					/** @type EE_Transaction_Processor $transaction_processor */
2162
-					$transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' );
2162
+					$transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor');
2163 2163
 					// has this step even been started ?
2164
-					$reg_step_completed = $transaction_processor->reg_step_completed( $valid_TXN, $this->slug() );
2165
-					if ( $reg_step_completed !== false && $reg_step_completed !== true ) {
2164
+					$reg_step_completed = $transaction_processor->reg_step_completed($valid_TXN, $this->slug());
2165
+					if ($reg_step_completed !== false && $reg_step_completed !== true) {
2166 2166
 						// so it **looks** like this is a double request from PayPal
2167 2167
 						// so let's try to pick up where we left off
2168 2168
 						$this->checkout->transaction = $valid_TXN;
2169
-						$this->checkout->refresh_all_entities( true );
2169
+						$this->checkout->refresh_all_entities(true);
2170 2170
 						return;
2171 2171
 					}
2172 2172
 				}
2173 2173
 				// you appear to be lost?
2174
-				$this->_redirect_wayward_request( $primary_registrant );
2174
+				$this->_redirect_wayward_request($primary_registrant);
2175 2175
 			}
2176 2176
 		}
2177 2177
 	}
@@ -2186,14 +2186,14 @@  discard block
 block discarded – undo
2186 2186
 	 * @return bool
2187 2187
 	 * @throws \EE_Error
2188 2188
 	 */
2189
-	private function _redirect_wayward_request( EE_Registration $primary_registrant ) {
2190
-		if ( ! $primary_registrant instanceof EE_Registration ) {
2189
+	private function _redirect_wayward_request(EE_Registration $primary_registrant) {
2190
+		if ( ! $primary_registrant instanceof EE_Registration) {
2191 2191
 			// try redirecting based on the current TXN
2192 2192
 			$primary_registrant = $this->checkout->transaction instanceof EE_Transaction
2193 2193
 				? $this->checkout->transaction->primary_registration()
2194 2194
 				: null;
2195 2195
 		}
2196
-		if ( ! $primary_registrant instanceof EE_Registration ) {
2196
+		if ( ! $primary_registrant instanceof EE_Registration) {
2197 2197
 			EE_Error::add_error(
2198 2198
 				sprintf(
2199 2199
 					__(
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 						'event_espresso'
2202 2202
 					),
2203 2203
 					'<br/>',
2204
-					EE_Registry::instance()->CFG->organization->get_pretty( 'email' )
2204
+					EE_Registry::instance()->CFG->organization->get_pretty('email')
2205 2205
 				),
2206 2206
 				__FILE__,
2207 2207
 				__FUNCTION__,
@@ -2232,16 +2232,16 @@  discard block
 block discarded – undo
2232 2232
 	 * @return \EE_Payment
2233 2233
 	 * @throws \EE_Error
2234 2234
 	 */
2235
-	private function _process_off_site_payment( EE_Offsite_Gateway $gateway ) {
2235
+	private function _process_off_site_payment(EE_Offsite_Gateway $gateway) {
2236 2236
 		try {
2237 2237
 			// if gateway uses_separate_IPN_request, then we don't have to process the IPN manually
2238
-			if ( $gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request() ) {
2238
+			if ($gateway instanceof EE_Offsite_Gateway && $gateway->uses_separate_IPN_request()) {
2239 2239
 				$payment = $this->checkout->transaction->last_payment();
2240 2240
 				//$payment_source = 'last_payment';
2241 2241
 			} else {
2242 2242
 				// get payment details and process results
2243 2243
 				/** @type EE_Payment_Processor $payment_processor */
2244
-				$payment_processor = EE_Registry::instance()->load_core( 'Payment_Processor' );
2244
+				$payment_processor = EE_Registry::instance()->load_core('Payment_Processor');
2245 2245
 				$payment = $payment_processor->process_ipn(
2246 2246
 					$_REQUEST,
2247 2247
 					$this->checkout->transaction,
@@ -2251,14 +2251,14 @@  discard block
 block discarded – undo
2251 2251
 				);
2252 2252
 				//$payment_source = 'process_ipn';
2253 2253
 			}
2254
-		} catch ( Exception $e ) {
2254
+		} catch (Exception $e) {
2255 2255
 			// let's just eat the exception and try to move on using any previously set payment info
2256 2256
 			$payment = $this->checkout->transaction->last_payment();
2257 2257
 			//$payment_source = 'last_payment after Exception';
2258 2258
 			// but if we STILL don't have a payment object
2259
-			if ( ! $payment instanceof EE_Payment ) {
2259
+			if ( ! $payment instanceof EE_Payment) {
2260 2260
 				// then we'll object ! ( not object like a thing... but object like what a lawyer says ! )
2261
-				$this->_handle_payment_processor_exception( $e );
2261
+				$this->_handle_payment_processor_exception($e);
2262 2262
 			}
2263 2263
 		}
2264 2264
 		// DEBUG LOG
@@ -2283,13 +2283,13 @@  discard block
 block discarded – undo
2283 2283
 	 * @return EE_Payment | FALSE
2284 2284
 	 * @throws \EE_Error
2285 2285
 	 */
2286
-	private function _process_cancelled_payments( $payment = null ) {
2286
+	private function _process_cancelled_payments($payment = null) {
2287 2287
 		if (
2288 2288
 			$payment instanceof EE_Payment
2289
-			&& isset( $_REQUEST['ee_cancel_payment'] )
2289
+			&& isset($_REQUEST['ee_cancel_payment'])
2290 2290
 			&& $payment->status() === EEM_Payment::status_id_failed
2291 2291
 		) {
2292
-			$payment->set_status( EEM_Payment::status_id_cancelled );
2292
+			$payment->set_status(EEM_Payment::status_id_cancelled);
2293 2293
 		}
2294 2294
 		return $payment;
2295 2295
 	}
@@ -2306,14 +2306,14 @@  discard block
 block discarded – undo
2306 2306
 	public function get_transaction_details_for_gateways() {
2307 2307
 		$txn_details = array();
2308 2308
 		// ya gotta make a choice man
2309
-		if ( empty( $this->checkout->selected_method_of_payment ) ) {
2309
+		if (empty($this->checkout->selected_method_of_payment)) {
2310 2310
 			$txn_details = array(
2311
-				'error' => __( 'Please select a method of payment before proceeding.', 'event_espresso' )
2311
+				'error' => __('Please select a method of payment before proceeding.', 'event_espresso')
2312 2312
 			);
2313 2313
 		}
2314 2314
 		// get EE_Payment_Method object
2315 2315
 		if (
2316
-			empty( $txn_details )
2316
+			empty($txn_details)
2317 2317
 			&&
2318 2318
 			! $this->checkout->payment_method = $this->_get_payment_method_for_selected_method_of_payment()
2319 2319
 		) {
@@ -2325,8 +2325,8 @@  discard block
 block discarded – undo
2325 2325
 				)
2326 2326
 			);
2327 2327
 		}
2328
-		if ( empty( $txn_details ) && $this->checkout->transaction instanceof EE_Transaction ) {
2329
-			$return_url = $this->_get_return_url( $this->checkout->payment_method );
2328
+		if (empty($txn_details) && $this->checkout->transaction instanceof EE_Transaction) {
2329
+			$return_url = $this->_get_return_url($this->checkout->payment_method);
2330 2330
 			$txn_details = array(
2331 2331
 				'TXN_ID'         => $this->checkout->transaction->ID(),
2332 2332
 				'TXN_timestamp'  => $this->checkout->transaction->datetime(),
@@ -2337,7 +2337,7 @@  discard block
 block discarded – undo
2337 2337
 				'PMD_ID'         => $this->checkout->transaction->payment_method_ID(),
2338 2338
 				'payment_amount' => $this->checkout->amount_owing,
2339 2339
 				'return_url'     => $return_url,
2340
-				'cancel_url'     => add_query_arg( array( 'ee_cancel_payment' => true ), $return_url ),
2340
+				'cancel_url'     => add_query_arg(array('ee_cancel_payment' => true), $return_url),
2341 2341
 				'notify_url'     => EE_Config::instance()->core->txn_page_url(
2342 2342
 					array(
2343 2343
 						'e_reg_url_link'    => $this->checkout->transaction->primary_registration()->reg_url_link(),
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
 				)
2347 2347
 			);
2348 2348
 		}
2349
-		echo json_encode( $txn_details );
2349
+		echo json_encode($txn_details);
2350 2350
 		exit();
2351 2351
 	}
2352 2352
 
Please login to merge, or discard this patch.