Completed
Branch BUG-8698-ticket-sellouts (a43227)
by
unknown
939:57 queued 919:17
created
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/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.
modules/feeds/EED_Feeds.module.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return EED_Feeds
30 30
 	 */
31 31
 	public static function instance() {
32
-		return parent::get_instance( __CLASS__ );
32
+		return parent::get_instance(__CLASS__);
33 33
 	}
34 34
 
35 35
 
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 	 *  @return 	void
42 42
 	 */
43 43
 	public static function set_hooks() {
44
-		add_action( 'parse_request', array( 'EED_Feeds', 'parse_request' ), 10 );
45
-		add_filter( 'default_feed', array( 'EED_Feeds', 'default_feed' ), 10, 1  );
46
-		add_filter( 'comment_feed_join', array( 'EED_Feeds', 'comment_feed_join' ), 10, 2 );
47
-		add_filter( 'comment_feed_where', array( 'EED_Feeds', 'comment_feed_where' ), 10, 2 );
44
+		add_action('parse_request', array('EED_Feeds', 'parse_request'), 10);
45
+		add_filter('default_feed', array('EED_Feeds', 'default_feed'), 10, 1);
46
+		add_filter('comment_feed_join', array('EED_Feeds', 'comment_feed_join'), 10, 2);
47
+		add_filter('comment_feed_where', array('EED_Feeds', 'comment_feed_where'), 10, 2);
48 48
 	}
49 49
 
50 50
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *  @access 	public
65 65
 	 *  @return 	void
66 66
 	 */
67
-	public function run( $WP ) {
67
+	public function run($WP) {
68 68
 	}
69 69
 
70 70
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 *  @param 	type	rss2, atom, rss, rdf, rssjs
77 77
 	 *  @return 	string
78 78
 	 */
79
-	public static function default_feed( $type = 'rss2' ) {
79
+	public static function default_feed($type = 'rss2') {
80 80
 		 //rss2, atom, rss, rdf, rssjs
81 81
 		$type = 'rss2';
82 82
 		return $type;
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
 	 *  @return 	void
93 93
 	 */
94 94
 	public static function parse_request() {
95
-		if ( EE_Registry::instance()->REQ->is_set( 'post_type' )) {
95
+		if (EE_Registry::instance()->REQ->is_set('post_type')) {
96 96
 			// define path to templates
97
-			define( 'RSS_FEEDS_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS );
97
+			define('RSS_FEEDS_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS);
98 98
 			// what kinda post_type are we dealing with ?
99
-			switch( EE_Registry::instance()->REQ->get( 'post_type' )) {
99
+			switch (EE_Registry::instance()->REQ->get('post_type')) {
100 100
 				case 'espresso_events' :
101 101
 					// for rss2, atom, rss, rdf
102
-					add_filter( 'the_excerpt_rss', array( 'EED_Feeds', 'the_event_feed' ), 10, 1 );
103
-					add_filter( 'the_content_feed', array( 'EED_Feeds', 'the_event_feed' ), 10, 1 );
102
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_event_feed'), 10, 1);
103
+					add_filter('the_content_feed', array('EED_Feeds', 'the_event_feed'), 10, 1);
104 104
 					// for json ( also uses the above filter )
105
-					add_filter( 'rssjs_feed_item', array( 'EED_Feeds', 'the_event_rssjs_feed' ), 10, 1 );
105
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_event_rssjs_feed'), 10, 1);
106 106
 					break;
107 107
 				case 'espresso_venues' :
108 108
 					// for rss2, atom, rss, rdf
109
-					add_filter( 'the_excerpt_rss', array( 'EED_Feeds', 'the_venue_feed' ), 10, 1 );
110
-					add_filter( 'the_content_feed', array( 'EED_Feeds', 'the_venue_feed' ), 10, 1 );
109
+					add_filter('the_excerpt_rss', array('EED_Feeds', 'the_venue_feed'), 10, 1);
110
+					add_filter('the_content_feed', array('EED_Feeds', 'the_venue_feed'), 10, 1);
111 111
 					// for json ( also uses the above filter )
112
-					add_filter( 'rssjs_feed_item', array( 'EED_Feeds', 'the_venue_rssjs_feed' ), 10, 1 );
112
+					add_filter('rssjs_feed_item', array('EED_Feeds', 'the_venue_rssjs_feed'), 10, 1);
113 113
 					break;
114 114
 			}
115 115
 		}
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 *  @param 	string 	$SQL	the JOIN clause for the comment feed query
128 128
 	 *  @return 	void
129 129
 	 */
130
-	public static function comment_feed_join( $SQL ) {
130
+	public static function comment_feed_join($SQL) {
131 131
 		global $wpdb;
132 132
 		// check for wp_posts table in JOIN clause
133
-		if ( strpos( $SQL, $wpdb->posts ) !== FALSE ) {
134
-			add_filter( 'EED_Feeds__comment_feed_where__espresso_attendees', '__return_true' );
133
+		if (strpos($SQL, $wpdb->posts) !== FALSE) {
134
+			add_filter('EED_Feeds__comment_feed_where__espresso_attendees', '__return_true');
135 135
 		}
136 136
 		return $SQL;
137 137
 	}
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 	 *  @param 	string 	$SQL	the WHERE clause for the comment feed query
149 149
 	 *  @return 	void
150 150
 	 */
151
-	public static function comment_feed_where( $SQL ) {
151
+	public static function comment_feed_where($SQL) {
152 152
 		global $wp_query, $wpdb;
153
-		if ( $wp_query->is_comment_feed && apply_filters( 'EED_Feeds__comment_feed_where__espresso_attendees', FALSE )) {
153
+		if ($wp_query->is_comment_feed && apply_filters('EED_Feeds__comment_feed_where__espresso_attendees', FALSE)) {
154 154
 			$SQL .= " AND $wpdb->posts.post_type != 'espresso_attendees'";
155 155
 		}
156 156
 		return $SQL;
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 	 *  @param 	string 	$content
167 167
 	 *  @return 	void
168 168
 	 */
169
-	public static function the_event_feed( $content ) {
170
-		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php' )) {
169
+	public static function the_event_feed($content) {
170
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php')) {
171 171
  			global $post;
172 172
 			$template_args = array(
173 173
 				'EVT_ID' => $post->ID,
174 174
 				'event_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content
175 175
 			);
176
-			$content = EEH_Template::display_template( RSS_FEEDS_TEMPLATES_PATH . 'espresso_events_feed.template.php', $template_args, TRUE );
176
+			$content = EEH_Template::display_template(RSS_FEEDS_TEMPLATES_PATH.'espresso_events_feed.template.php', $template_args, TRUE);
177 177
 		}
178 178
 		return  $content;
179 179
 	}
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 	 *  @param 	object 	$item
189 189
 	 *  @return 	void
190 190
 	 */
191
-	public static function the_event_rssjs_feed( $item ) {
192
-		if ( is_feed() && isset( $item->description )) {
193
-			$item->description = EED_Feeds::the_event_feed( $item->description );
191
+	public static function the_event_rssjs_feed($item) {
192
+		if (is_feed() && isset($item->description)) {
193
+			$item->description = EED_Feeds::the_event_feed($item->description);
194 194
 		}
195 195
 		return $item;
196 196
 	}
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 	 *  @param 	string 	$content
206 206
 	 *  @return 	void
207 207
 	 */
208
-	public static function the_venue_feed( $content ) {
209
-		if ( is_feed() && is_readable( RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php' )) {
208
+	public static function the_venue_feed($content) {
209
+		if (is_feed() && is_readable(RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php')) {
210 210
  			global $post;
211 211
 			$template_args = array(
212 212
 				'VNU_ID' => $post->ID,
213 213
 				'venue_description' => get_option('rss_use_excerpt') ? $post->post_excerpt : $post->post_content
214 214
 			);
215
-			$content = EEH_Template::display_template( RSS_FEEDS_TEMPLATES_PATH . 'espresso_venues_feed.template.php', $template_args, TRUE );
215
+			$content = EEH_Template::display_template(RSS_FEEDS_TEMPLATES_PATH.'espresso_venues_feed.template.php', $template_args, TRUE);
216 216
 		}
217 217
 		return $content;
218 218
 	}
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 	 *  @param 	object 	$item
228 228
 	 *  @return 	void
229 229
 	 */
230
-	public static function the_venue_rssjs_feed( $item ) {
231
-		if ( is_feed() && isset( $item->description )) {
232
-			$item->description = EED_Feeds::the_venue_feed( $item->description );
230
+	public static function the_venue_rssjs_feed($item) {
231
+		if (is_feed() && isset($item->description)) {
232
+			$item->description = EED_Feeds::the_venue_feed($item->description);
233 233
 		}
234 234
 		return $item;
235 235
 	}
Please login to merge, or discard this patch.
modules/bot_trap/EED_Bot_Trap.module.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @return EED_Bot_Trap
19 19
 	 */
20 20
 	public static function instance() {
21
-		return parent::get_instance( __CLASS__ );
21
+		return parent::get_instance(__CLASS__);
22 22
 	}
23 23
 
24 24
 
@@ -31,22 +31,22 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public static function set_hooks() {
33 33
 		if (
34
-			apply_filters( 'FHEE__EED_Bot_Trap__set_hooks__use_bot_trap', true ) &&
34
+			apply_filters('FHEE__EED_Bot_Trap__set_hooks__use_bot_trap', true) &&
35 35
 			EE_Registry::instance()->CFG->registration->use_bot_trap
36 36
 		) {
37
-			define( 'EE_BOT_TRAP_BASE_URL', plugin_dir_url( __FILE__ ) . DS );
37
+			define('EE_BOT_TRAP_BASE_URL', plugin_dir_url(__FILE__).DS);
38 38
 			add_action(
39 39
 				'AHEE__ticket_selector_chart__template__after_ticket_selector',
40
-				array( 'EED_Bot_Trap', 'generate_bot_trap' ),
40
+				array('EED_Bot_Trap', 'generate_bot_trap'),
41 41
 				10, 2
42 42
 			);
43 43
 			add_action(
44 44
 				'EED_Ticket_Selector__process_ticket_selections__before',
45
-				array( 'EED_Bot_Trap', 'process_bot_trap' ),
45
+				array('EED_Bot_Trap', 'process_bot_trap'),
46 46
 				1, 2
47 47
 			);
48 48
 			// redirect bots to bogus success page
49
-			EE_Config::register_route( 'ticket_selection_received', 'EED_Bot_Trap', 'display_bot_trap_success' );
49
+			EE_Config::register_route('ticket_selection_received', 'EED_Bot_Trap', 'display_bot_trap_success');
50 50
 		}
51 51
 	}
52 52
 
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 	public static function set_hooks_admin() {
62 62
 		add_action(
63 63
 			'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template',
64
-			array( 'EED_Bot_Trap', 'bot_trap_settings_form' ),
64
+			array('EED_Bot_Trap', 'bot_trap_settings_form'),
65 65
 			10
66 66
 		);
67 67
 		add_filter(
68 68
 			'FHEE__Extend_Registration_Form_Admin_Page___update_reg_form_settings__CFG_registration',
69
-			array( 'EED_Bot_Trap', 'update_bot_trap_settings_form' ),
69
+			array('EED_Bot_Trap', 'update_bot_trap_settings_form'),
70 70
 			10, 1
71 71
 		);
72 72
 	}
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 * @param    WP $WP
81 81
 	 * @return    void
82 82
 	 */
83
-	public function run( $WP ) {}
83
+	public function run($WP) {}
84 84
 
85 85
 
86 86
 
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 	 * @return    void
92 92
 	 */
93 93
 	public static function generate_bot_trap() {
94
-		$do_not_enter = __( 'please do not enter anything in this input', 'event_espresso' );
94
+		$do_not_enter = __('please do not enter anything in this input', 'event_espresso');
95 95
 		$html = '<div id="tkt-slctr-request-processor-dv" style="float:left; margin-left:-999em;">';
96
-		$html .= '<label for="tkt-slctr-request-processor-email">' . $do_not_enter  . '</label>';
96
+		$html .= '<label for="tkt-slctr-request-processor-email">'.$do_not_enter.'</label>';
97 97
 		$html .= '<input type="email" name="tkt-slctr-request-processor-email" value=""/>';
98 98
 		$html .= '<input type="hidden" name="tkt-slctr-request-processor-token" value="';
99
-		if ( EE_Registry::instance()->CFG->registration->use_encryption ) {
100
-			EE_Registry::instance()->load_core( 'EE_Encryption' );
101
-			$html .= EE_Encryption::instance()->encrypt( time() );
99
+		if (EE_Registry::instance()->CFG->registration->use_encryption) {
100
+			EE_Registry::instance()->load_core('EE_Encryption');
101
+			$html .= EE_Encryption::instance()->encrypt(time());
102 102
 		} else {
103 103
 			$html .= time();
104 104
 		}
@@ -117,35 +117,35 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public static function process_bot_trap() {
119 119
 		// what's your email address Mr. Bot ?
120
-		$empty_trap = isset( $_REQUEST[ 'tkt-slctr-request-processor-email' ] ) && $_REQUEST[ 'tkt-slctr-request-processor-email' ] == '' ? true : false;
120
+		$empty_trap = isset($_REQUEST['tkt-slctr-request-processor-email']) && $_REQUEST['tkt-slctr-request-processor-email'] == '' ? true : false;
121 121
 		// get encrypted timestamp for when the form was originally displayed
122
-		$bot_trap_timestamp = isset( $_REQUEST[ 'tkt-slctr-request-processor-token' ] ) ? sanitize_text_field( $_REQUEST[ 'tkt-slctr-request-processor-token' ] ) : '';
122
+		$bot_trap_timestamp = isset($_REQUEST['tkt-slctr-request-processor-token']) ? sanitize_text_field($_REQUEST['tkt-slctr-request-processor-token']) : '';
123 123
 		// decrypt and convert to absolute  integer
124
-		if ( EE_Registry::instance()->CFG->registration->use_encryption ) {
125
-			EE_Registry::instance()->load_core( 'EE_Encryption' );
126
-			$bot_trap_timestamp = absint( EE_Encryption::instance()->decrypt( $bot_trap_timestamp ) );
124
+		if (EE_Registry::instance()->CFG->registration->use_encryption) {
125
+			EE_Registry::instance()->load_core('EE_Encryption');
126
+			$bot_trap_timestamp = absint(EE_Encryption::instance()->decrypt($bot_trap_timestamp));
127 127
 		} else {
128
-			$bot_trap_timestamp = absint( $bot_trap_timestamp );
128
+			$bot_trap_timestamp = absint($bot_trap_timestamp);
129 129
 		}
130 130
 		// ticket form submitted too impossibly fast ( after now ) or more than an hour later ???
131
-		$suspicious_timing = $bot_trap_timestamp > time() || $bot_trap_timestamp < ( time() - HOUR_IN_SECONDS ) ? true : false;
131
+		$suspicious_timing = $bot_trap_timestamp > time() || $bot_trap_timestamp < (time() - HOUR_IN_SECONDS) ? true : false;
132 132
 		// are we human ?
133
-		if ( $empty_trap && ! $suspicious_timing ) {
133
+		if ($empty_trap && ! $suspicious_timing) {
134 134
 			return;
135 135
 		}
136 136
 		// UH OH...
137 137
 		$redirect_url = add_query_arg(
138
-			array( 'ee' => 'ticket_selection_received' ),
138
+			array('ee' => 'ticket_selection_received'),
139 139
 			EE_Registry::instance()->CFG->core->reg_page_url()
140 140
 		);
141
-		if ( $suspicious_timing ) {
141
+		if ($suspicious_timing) {
142 142
 			$redirect_url = add_query_arg(
143
-				array( 'ee-notice' => urlencode( __( 'We\'re sorry, but your ticket selections could not be processed due to a server timing error. Please hit the back button on your browser and try again.', 'event_espresso' ) ) ),
143
+				array('ee-notice' => urlencode(__('We\'re sorry, but your ticket selections could not be processed due to a server timing error. Please hit the back button on your browser and try again.', 'event_espresso'))),
144 144
 				$redirect_url
145 145
 			);
146 146
 		}
147 147
 		wp_safe_redirect(
148
-			apply_filters( 'FHEE__EED_Bot_Trap__process_bot_trap__redirect_url', $redirect_url )
148
+			apply_filters('FHEE__EED_Bot_Trap__process_bot_trap__redirect_url', $redirect_url)
149 149
 		);
150 150
 		exit();
151 151
 	}
@@ -160,10 +160,10 @@  discard block
 block discarded – undo
160 160
 	 * @return    void
161 161
 	 */
162 162
 	public static function display_bot_trap_success() {
163
-		add_filter( 'FHEE__EED_Single_Page_Checkout__run', '__return_false' );
164
-		$bot_notice = __( 'Thank you so much. Your ticket selections have been received for consideration.', 'event_espresso' );
165
-		$bot_notice = isset( $_REQUEST[ 'ee-notice' ] ) && $_REQUEST[ 'ee-notice' ] !== '' ? sanitize_text_field( stripslashes( $_REQUEST[ 'ee-notice' ] ) ) : $bot_notice;
166
-		EE_Registry::instance()->REQ->add_output( EEH_HTML::div( $bot_notice, '', 'ee-attention' ) );
163
+		add_filter('FHEE__EED_Single_Page_Checkout__run', '__return_false');
164
+		$bot_notice = __('Thank you so much. Your ticket selections have been received for consideration.', 'event_espresso');
165
+		$bot_notice = isset($_REQUEST['ee-notice']) && $_REQUEST['ee-notice'] !== '' ? sanitize_text_field(stripslashes($_REQUEST['ee-notice'])) : $bot_notice;
166
+		EE_Registry::instance()->REQ->add_output(EEH_HTML::div($bot_notice, '', 'ee-attention'));
167 167
 	}
168 168
 
169 169
 
@@ -197,20 +197,20 @@  discard block
 block discarded – undo
197 197
 				'html_id'         			=> 'bot_trap_settings',
198 198
 				'layout_strategy' 	=> new EE_Admin_Two_Column_Layout(),
199 199
 				'subsections'     		=> array(
200
-					'bot_trap_hdr' 		=> new EE_Form_Section_HTML( EEH_HTML::h2( __( 'Bot Trap Settings', 'event_espresso' ) ) ),
200
+					'bot_trap_hdr' 		=> new EE_Form_Section_HTML(EEH_HTML::h2(__('Bot Trap Settings', 'event_espresso'))),
201 201
 					'use_bot_trap' 		=> new EE_Yes_No_Input(
202 202
 						array(
203
-							'html_label_text' 	=> __( 'Enable Bot Trap', 'event_espresso' ),
204
-							'html_help_text' 		=>  __( 'The Event Espresso Bot Trap will insert a fake input into your Ticket Selector forms that is hidden from regular site visitors, but visible to spam bots. Because the input asks for an email address, it is irresistible to spam bots who will of course enter text into it. Since regular site visitors can not see this input, any value detected during form submission means a bot has been detected, which will then be blocked from submitting the form.', 'event_espresso' ),
205
-							'default'        			=> isset( EE_Registry::instance()->CFG->registration->use_bot_trap ) ? EE_Registry::instance()->CFG->registration->use_bot_trap : true,
203
+							'html_label_text' 	=> __('Enable Bot Trap', 'event_espresso'),
204
+							'html_help_text' 		=>  __('The Event Espresso Bot Trap will insert a fake input into your Ticket Selector forms that is hidden from regular site visitors, but visible to spam bots. Because the input asks for an email address, it is irresistible to spam bots who will of course enter text into it. Since regular site visitors can not see this input, any value detected during form submission means a bot has been detected, which will then be blocked from submitting the form.', 'event_espresso'),
205
+							'default'        			=> isset(EE_Registry::instance()->CFG->registration->use_bot_trap) ? EE_Registry::instance()->CFG->registration->use_bot_trap : true,
206 206
 							'required'        		=> false
207 207
 						)
208 208
 					),
209 209
 					'use_encryption' 		=> new EE_Yes_No_Input(
210 210
 						array(
211
-							'html_label_text' 	=> __( 'Encrypt Bot Trap Data', 'event_espresso' ),
212
-							'html_help_text' 		=>  __( 'One way to detect spam bots is by looking at how long it takes them to submit a form. They are often inhumanly fast, or will submit forms hours, days, or even weeks after the form was first scraped off the web. The Event Espresso Bot Trap will send a timestamp with the Ticket Selector form when it is submitted. By default, this timestamp is encrypted so that the spam bots can not change it, but encryption may cause issues on some servers due to configuration "conflicts". If you continuously get caught in the bot trap, then try setting this option to "No". This may increase the number of spam submissions you receive, but increases server compatibility.', 'event_espresso' ),
213
-							'default'        			=> isset( EE_Registry::instance()->CFG->registration->use_encryption ) ? EE_Registry::instance()->CFG->registration->use_encryption : true,
211
+							'html_label_text' 	=> __('Encrypt Bot Trap Data', 'event_espresso'),
212
+							'html_help_text' 		=>  __('One way to detect spam bots is by looking at how long it takes them to submit a form. They are often inhumanly fast, or will submit forms hours, days, or even weeks after the form was first scraped off the web. The Event Espresso Bot Trap will send a timestamp with the Ticket Selector form when it is submitted. By default, this timestamp is encrypted so that the spam bots can not change it, but encryption may cause issues on some servers due to configuration "conflicts". If you continuously get caught in the bot trap, then try setting this option to "No". This may increase the number of spam submissions you receive, but increases server compatibility.', 'event_espresso'),
213
+							'default'        			=> isset(EE_Registry::instance()->CFG->registration->use_encryption) ? EE_Registry::instance()->CFG->registration->use_encryption : true,
214 214
 							'required'        		=> false
215 215
 						)
216 216
 					),
@@ -228,30 +228,30 @@  discard block
 block discarded – undo
228 228
 	 * @param \EE_Registration_Config $EE_Registration_Config
229 229
 	 * @return \EE_Registration_Config
230 230
 	 */
231
-	public static function update_bot_trap_settings_form( EE_Registration_Config $EE_Registration_Config ) {
231
+	public static function update_bot_trap_settings_form(EE_Registration_Config $EE_Registration_Config) {
232 232
 		try {
233 233
 			$bot_trap_settings_form = EED_Bot_Trap::_bot_trap_settings_form();
234 234
 			// if not displaying a form, then check for form submission
235
-			if ( $bot_trap_settings_form->was_submitted() ) {
235
+			if ($bot_trap_settings_form->was_submitted()) {
236 236
 				// capture form data
237 237
 				$bot_trap_settings_form->receive_form_submission();
238 238
 				// validate form data
239
-				if ( $bot_trap_settings_form->is_valid() ) {
239
+				if ($bot_trap_settings_form->is_valid()) {
240 240
 					// grab validated data from form
241 241
 					$valid_data = $bot_trap_settings_form->valid_data();
242
-					if ( isset( $valid_data[ 'use_bot_trap' ], $valid_data[ 'use_encryption' ] ) ) {
243
-						$EE_Registration_Config->use_bot_trap = $valid_data[ 'use_bot_trap' ];
244
-						$EE_Registration_Config->use_encryption = $valid_data[ 'use_encryption' ];
242
+					if (isset($valid_data['use_bot_trap'], $valid_data['use_encryption'])) {
243
+						$EE_Registration_Config->use_bot_trap = $valid_data['use_bot_trap'];
244
+						$EE_Registration_Config->use_encryption = $valid_data['use_encryption'];
245 245
 					} else {
246
-						EE_Error::add_error( __( 'Invalid or missing Bot Trap settings. Please refresh the form and try again.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
246
+						EE_Error::add_error(__('Invalid or missing Bot Trap settings. Please refresh the form and try again.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
247 247
 					}
248 248
 				} else {
249
-					if ( $bot_trap_settings_form->submission_error_message() != '' ) {
250
-						EE_Error::add_error( $bot_trap_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__ );
249
+					if ($bot_trap_settings_form->submission_error_message() != '') {
250
+						EE_Error::add_error($bot_trap_settings_form->submission_error_message(), __FILE__, __FUNCTION__, __LINE__);
251 251
 					}
252 252
 				}
253 253
 			}
254
-		} catch ( EE_Error $e ) {
254
+		} catch (EE_Error $e) {
255 255
 			$e->get_error();
256 256
 		}
257 257
 		return $EE_Registration_Config;
Please login to merge, or discard this patch.
admin_pages/maintenance/Maintenance_Admin_Page.core.php 1 patch
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 class Maintenance_Admin_Page extends EE_Admin_Page {
31 31
 
32 32
 
33
-	public function __construct( $routing = TRUE ) {
34
-		parent::__construct( $routing );
33
+	public function __construct($routing = TRUE) {
34
+		parent::__construct($routing);
35 35
 	}
36 36
 
37 37
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 
48 48
 	protected function _ajax_hooks() {
49
-		add_action('wp_ajax_migration_step',array($this,'migration_step'));
50
-		add_action('wp_ajax_add_error_to_migrations_ran',array($this,'add_error_to_migrations_ran'));
49
+		add_action('wp_ajax_migration_step', array($this, 'migration_step'));
50
+		add_action('wp_ajax_add_error_to_migrations_ran', array($this, 'add_error_to_migrations_ran'));
51 51
 	}
52 52
 
53 53
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$this->_admin_page_title = EE_MAINTENANCE_LABEL;
57 57
 		$this->_labels = array(
58 58
 			'buttons' => array(
59
-				'reset_capabilities' => __( 'Reset Event Espresso Capabilities', 'event_espresso' )
59
+				'reset_capabilities' => __('Reset Event Espresso Capabilities', 'event_espresso')
60 60
 				)
61 61
 			);
62 62
 	}
@@ -155,23 +155,23 @@  discard block
 block discarded – undo
155 155
 	 * default maintenance page. If we're in maintenance mode level 2, then we need to show
156 156
 	 * the migration scripts and all that UI.
157 157
 	 */
158
-	public function _maintenance(){
158
+	public function _maintenance() {
159 159
 		//it all depends if we're in maintenance model level 1 (frontend-only) or
160 160
 		//level 2 (everything except maintenance page)
161
-		try{
161
+		try {
162 162
 			//get the current maintenance level and check if
163 163
 			//we are removed
164 164
 			$mm = EE_Maintenance_Mode::instance()->level();
165 165
 			$placed_in_mm = EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
166
-			if( $mm == EE_Maintenance_Mode::level_2_complete_maintenance && ! $placed_in_mm){
166
+			if ($mm == EE_Maintenance_Mode::level_2_complete_maintenance && ! $placed_in_mm) {
167 167
 				//we just took the site out of maintenance mode, so notify the user.
168 168
 				//unfortunately this message appears to be echoed on the NEXT page load...
169 169
 				//oh well, we should really be checking for this on addon deactivation anyways
170
-				EE_Error::add_attention( __( 'Site taken out of maintenance mode because no data migration scripts are required', 'event_espresso' ) );
171
-				$this->_process_notices( array( 'page' => 'espresso_maintenance_settings'), false );
170
+				EE_Error::add_attention(__('Site taken out of maintenance mode because no data migration scripts are required', 'event_espresso'));
171
+				$this->_process_notices(array('page' => 'espresso_maintenance_settings'), false);
172 172
 			}
173 173
 			//in case an exception is thrown while trying to handle migrations
174
-			switch(EE_Maintenance_Mode::instance()->level()){
174
+			switch (EE_Maintenance_Mode::instance()->level()) {
175 175
 				case EE_Maintenance_Mode::level_0_not_in_maintenance:
176 176
 				case EE_Maintenance_Mode::level_1_frontend_only_maintenance:
177 177
 					$show_maintenance_switch = true;
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
 				case EE_Maintenance_Mode::level_2_complete_maintenance:
184 184
 					$show_maintenance_switch = false;
185 185
 					$show_migration_progress = true;
186
-					if(isset($this->_req_data['continue_migration'])){
186
+					if (isset($this->_req_data['continue_migration'])) {
187 187
 						$show_backup_db_text = false;
188
-					}else{
188
+					} else {
189 189
 						$show_backup_db_text = true;
190 190
 					}
191 191
 					$scripts_needing_to_run = EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts();
192 192
 					$addons_should_be_upgraded_first = EE_Data_Migration_Manager::instance()->addons_need_updating();
193 193
 					$script_names = array();
194 194
 					$current_script = NULL;
195
-					foreach($scripts_needing_to_run as $script){
196
-						if($script instanceof EE_Data_Migration_Script_Base){
197
-							if( ! $current_script){
195
+					foreach ($scripts_needing_to_run as $script) {
196
+						if ($script instanceof EE_Data_Migration_Script_Base) {
197
+							if ( ! $current_script) {
198 198
 								$current_script = $script;
199 199
 								$current_script->migration_page_hooks();
200 200
 							}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			}
206 206
 			$most_recent_migration = EE_Data_Migration_Manager::instance()->get_last_ran_script(true);
207 207
 			$exception_thrown = false;
208
-		}catch(EE_Error $e){
208
+		} catch (EE_Error $e) {
209 209
 
210 210
 			EE_Data_Migration_Manager::instance()->add_error_to_migrations_ran($e->getMessage());
211 211
 			//now, just so we can display the page correctly, make a error migration script stage object
@@ -215,53 +215,53 @@  discard block
 block discarded – undo
215 215
 			$exception_thrown = true;
216 216
 		}
217 217
 		$current_db_state = EE_Data_Migration_Manager::instance()->ensure_current_database_state_is_set();
218
-		if($exception_thrown ||
219
-				(	$most_recent_migration &&
218
+		if ($exception_thrown ||
219
+				($most_recent_migration &&
220 220
 					$most_recent_migration instanceof EE_Data_Migration_Script_Base &&
221 221
 					$most_recent_migration->is_broken()
222
-				)){
223
-			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_migration_was_borked_page.template.php';
224
-			$this->_template_args[ 'support_url' ] = 'http://eventespresso.com/support/forums/';
225
-			$this->_template_args[ 'next_url' ] = EEH_URL::add_query_args_and_nonce(array( 'action' => 'confirm_migration_crash_report_sent', 'success' => '0' ), EE_MAINTENANCE_ADMIN_URL );
226
-		}elseif($addons_should_be_upgraded_first){
227
-			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_upgrade_addons_before_migrating.template.php';
228
-		}else{
229
-			if($most_recent_migration &&
230
-					$most_recent_migration instanceof EE_Data_Migration_Script_Base  &&
231
-					$most_recent_migration->can_continue()){
222
+				)) {
223
+			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_migration_was_borked_page.template.php';
224
+			$this->_template_args['support_url'] = 'http://eventespresso.com/support/forums/';
225
+			$this->_template_args['next_url'] = EEH_URL::add_query_args_and_nonce(array('action' => 'confirm_migration_crash_report_sent', 'success' => '0'), EE_MAINTENANCE_ADMIN_URL);
226
+		}elseif ($addons_should_be_upgraded_first) {
227
+			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_upgrade_addons_before_migrating.template.php';
228
+		} else {
229
+			if ($most_recent_migration &&
230
+					$most_recent_migration instanceof EE_Data_Migration_Script_Base &&
231
+					$most_recent_migration->can_continue()) {
232 232
 				$show_backup_db_text = false;
233 233
 				$show_continue_current_migration_script = true;
234 234
 				$show_most_recent_migration = true;
235
-			}elseif(isset($this->_req_data['continue_migration'])){
235
+			}elseif (isset($this->_req_data['continue_migration'])) {
236 236
 				$show_most_recent_migration = true;
237 237
 				$show_continue_current_migration_script = false;
238
-			}else{
238
+			} else {
239 239
 				$show_most_recent_migration = false;
240 240
 				$show_continue_current_migration_script = false;
241 241
 			}
242 242
 
243
-			if(isset($current_script)){
243
+			if (isset($current_script)) {
244 244
 				$migrates_to = $current_script->migrates_to_version();
245
-				$plugin_slug = $migrates_to[ 'slug' ];
246
-				$new_version = $migrates_to[ 'version' ];
247
-				$this->_template_args = array_merge($this->_template_args,array(
248
-					'current_db_state'=>  sprintf(__("EE%s (%s)", "event_espresso"), isset($current_db_state[$plugin_slug]) ? $current_db_state[$plugin_slug] : 3,$plugin_slug),
249
-					'next_db_state'=>isset($current_script) ? sprintf(__("EE%s (%s)", 'event_espresso'),$new_version,$plugin_slug) : NULL));
245
+				$plugin_slug = $migrates_to['slug'];
246
+				$new_version = $migrates_to['version'];
247
+				$this->_template_args = array_merge($this->_template_args, array(
248
+					'current_db_state'=>  sprintf(__("EE%s (%s)", "event_espresso"), isset($current_db_state[$plugin_slug]) ? $current_db_state[$plugin_slug] : 3, $plugin_slug),
249
+					'next_db_state'=>isset($current_script) ? sprintf(__("EE%s (%s)", 'event_espresso'), $new_version, $plugin_slug) : NULL));
250 250
 			}
251 251
 
252
-			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_migration_page.template.php';
252
+			$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_migration_page.template.php';
253 253
 			$this->_template_args = array_merge(
254 254
 				$this->_template_args,
255 255
 				array(
256
-					'show_most_recent_migration' => $show_most_recent_migration,//flag for showing the most recent migration's status and/or errors
257
-					'show_migration_progress' => $show_migration_progress,//flag for showing the option to run migrations and see their progress
258
-					'show_backup_db_text' => $show_backup_db_text,//flag for showing text telling the user to backup their DB
259
-					'show_maintenance_switch'=> $show_maintenance_switch,//flag for showing the option to change maintenance mode between levels 0 and 1
260
-					'script_names'=>$script_names,//array of names of scripts that have run
261
-					'show_continue_current_migration_script'=>$show_continue_current_migration_script,//flag to change wording to indicating that we're only CONTINUING a migration script (somehow it got interrupted0
256
+					'show_most_recent_migration' => $show_most_recent_migration, //flag for showing the most recent migration's status and/or errors
257
+					'show_migration_progress' => $show_migration_progress, //flag for showing the option to run migrations and see their progress
258
+					'show_backup_db_text' => $show_backup_db_text, //flag for showing text telling the user to backup their DB
259
+					'show_maintenance_switch'=> $show_maintenance_switch, //flag for showing the option to change maintenance mode between levels 0 and 1
260
+					'script_names'=>$script_names, //array of names of scripts that have run
261
+					'show_continue_current_migration_script'=>$show_continue_current_migration_script, //flag to change wording to indicating that we're only CONTINUING a migration script (somehow it got interrupted0
262 262
 					'reset_db_page_link' => EE_Admin_Page::add_query_args_and_nonce(array('action'=>'reset_db'), EE_MAINTENANCE_ADMIN_URL),
263
-					'update_migration_script_page_link' => EE_Admin_Page::add_query_args_and_nonce(array('action'=>'change_maintenance_level'),EE_MAINTENANCE_ADMIN_URL),
264
-					'ultimate_db_state'=>  sprintf(__("EE%s", 'event_espresso'),espresso_version()),
263
+					'update_migration_script_page_link' => EE_Admin_Page::add_query_args_and_nonce(array('action'=>'change_maintenance_level'), EE_MAINTENANCE_ADMIN_URL),
264
+					'ultimate_db_state'=>  sprintf(__("EE%s", 'event_espresso'), espresso_version()),
265 265
 				)
266 266
 			);
267 267
 		//make sure we have the form fields helper available. It usually is, but sometimes it isn't
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 			'status_fatal_error'=>  EE_Data_Migration_Manager::status_fatal_error,
276 276
 			'status_completed'=>  EE_Data_Migration_Manager::status_completed));
277 277
 		}
278
-		$this->_template_args['most_recent_migration'] = $most_recent_migration;//the actual most recently ran migration
278
+		$this->_template_args['most_recent_migration'] = $most_recent_migration; //the actual most recently ran migration
279 279
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
280 280
 		$this->display_admin_page_with_sidebar();
281 281
 	}
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	/**
286 286
 	 * returns JSON and executes another step of the currently-executing data migration (called via ajax)
287 287
 	 */
288
-	public function migration_step(){
288
+	public function migration_step() {
289 289
 		$this->_template_args['data'] = EE_Data_Migration_Manager::instance()->response_to_migration_ajax_request();
290 290
 		$this->_return_json();
291 291
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 * Can be used by js when it notices a response with HTML in it in order
297 297
 	 * to log the malformed response
298 298
 	 */
299
-	public function add_error_to_migrations_ran(){
299
+	public function add_error_to_migrations_ran() {
300 300
 		EE_Data_Migration_Manager::instance()->add_error_to_migrations_ran($this->_req_data['message']);
301 301
 		$this->_template_args['data'] = array('ok'=>true);
302 302
 		$this->_return_json();
@@ -307,14 +307,14 @@  discard block
 block discarded – undo
307 307
 	/**
308 308
 	 * changes the maintenance level, provided there are still no migration scripts that shoudl run
309 309
 	 */
310
-	public function _change_maintenance_level(){
310
+	public function _change_maintenance_level() {
311 311
 		$new_level = intval($this->_req_data['maintenance_mode_level']);
312
-		if( ! EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()){
312
+		if ( ! EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts()) {
313 313
 			EE_Maintenance_Mode::instance()->set_maintenance_level($new_level);
314 314
 			$success = true;
315
-		}else{
315
+		} else {
316 316
 			EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
317
-			$success= false;
317
+			$success = false;
318 318
 		}
319 319
 		$this->_redirect_after_action($success, 'Maintenance Mode', __("Updated", "event_espresso"));
320 320
 	}
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
 	/**
325 325
 	 * a tab with options for reseting and/or deleting EE data
326 326
 	 */
327
-	public function _data_reset_and_delete(){
328
-		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_data_reset_and_delete.template.php';
329
-		$this->_template_args['reset_capabilities_button'] = $this->get_action_link_or_button( 'reset_capabilities', 'reset_capabilities', array(),  'button button-primary' );
327
+	public function _data_reset_and_delete() {
328
+		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_data_reset_and_delete.template.php';
329
+		$this->_template_args['reset_capabilities_button'] = $this->get_action_link_or_button('reset_capabilities', 'reset_capabilities', array(), 'button button-primary');
330 330
 		$this->_template_args['delete_db_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_db'), EE_MAINTENANCE_ADMIN_URL);
331 331
 		$this->_template_args['reset_db_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'reset_db'), EE_MAINTENANCE_ADMIN_URL);
332 332
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
 
337 337
 
338 338
 	protected function _reset_capabilities() {
339
-		EE_Registry::instance()->CAP->init_caps( true );
340
-		EE_Error::add_success( __('Default Event Espresso capabilities have been restored for all current roles.', 'event_espresso' ) );
341
-		$this->_redirect_after_action( FALSE, '', '', array( 'action' => 'data_reset' ), TRUE );
339
+		EE_Registry::instance()->CAP->init_caps(true);
340
+		EE_Error::add_success(__('Default Event Espresso capabilities have been restored for all current roles.', 'event_espresso'));
341
+		$this->_redirect_after_action(FALSE, '', '', array('action' => 'data_reset'), TRUE);
342 342
 	}
343 343
 
344 344
 	/**
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	 */
349 349
 	protected function _reattempt_migration() {
350 350
 		EE_Data_Migration_Manager::instance()->reattempt();
351
-		$this->_redirect_after_action( FALSE, '', '', array( 'action' => 'default' ), TRUE );
351
+		$this->_redirect_after_action(FALSE, '', '', array('action' => 'default'), TRUE);
352 352
 	}
353 353
 
354 354
 
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 	/**
358 358
 	 * shows the big ol' System Information page
359 359
 	 */
360
-	public function _system_status(){
361
-		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_system_stati_page.template.php';
360
+	public function _system_status() {
361
+		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_system_stati_page.template.php';
362 362
 		$this->_template_args['system_stati'] = EEM_System_Status::instance()->get_system_stati();
363 363
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
364 364
 		$this->display_admin_page_with_sidebar();
@@ -366,30 +366,30 @@  discard block
 block discarded – undo
366 366
 
367 367
 
368 368
 
369
-	public function _send_migration_crash_report(){
369
+	public function _send_migration_crash_report() {
370 370
 		$from = $this->_req_data['from'];
371 371
 		$from_name = $this->_req_data['from_name'];
372 372
 		$body = $this->_req_data['body'];
373
-		try{
373
+		try {
374 374
 		$success = wp_mail(EE_SUPPORT_EMAIL,
375 375
 				'Migration Crash Report',
376
-				$body."/r/n<br>".  print_r(EEM_System_Status::instance()->get_system_stati(),true),
376
+				$body."/r/n<br>".print_r(EEM_System_Status::instance()->get_system_stati(), true),
377 377
 				array(
378 378
 					"from:$from_name<$from>",
379 379
 //					'content-type:text/html charset=UTF-8'
380 380
 					));
381
-		}catch( Exception $e ){
381
+		} catch (Exception $e) {
382 382
 			$success = FALSE;
383 383
 		}
384
-		$this->_redirect_after_action($success, __("Migration Crash Report", "event_espresso"), __("sent", "event_espresso"),array('success'=>$success,'action'=>'confirm_migration_crash_report_sent'));
384
+		$this->_redirect_after_action($success, __("Migration Crash Report", "event_espresso"), __("sent", "event_espresso"), array('success'=>$success, 'action'=>'confirm_migration_crash_report_sent'));
385 385
 	}
386 386
 
387 387
 
388 388
 
389
-	public function _confirm_migration_crash_report_sent(){
390
-		try{
389
+	public function _confirm_migration_crash_report_sent() {
390
+		try {
391 391
 			$most_recent_migration = EE_Data_Migration_Manager::instance()->get_last_ran_script(true);
392
-		}catch(EE_Error $e){
392
+		} catch (EE_Error $e) {
393 393
 
394 394
 			EE_Data_Migration_Manager::instance()->add_error_to_migrations_ran($e->getMessage());
395 395
 			//now, just so we can display the page correctly, make a error migration script stage object
@@ -397,14 +397,14 @@  discard block
 block discarded – undo
397 397
 			$most_recent_migration = new EE_DMS_Unknown_1_0_0();
398 398
 			$most_recent_migration->add_error($e->getMessage());
399 399
 		}
400
-		$success = $this->_req_data['success']=='1' ? true : false;
400
+		$success = $this->_req_data['success'] == '1' ? true : false;
401 401
 		$this->_template_args['success'] = $success;
402
-		$this->_template_args[ 'most_recent_migration' ] = $most_recent_migration;
402
+		$this->_template_args['most_recent_migration'] = $most_recent_migration;
403 403
 		$this->_template_args['reset_db_action_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'reset_db'), EE_MAINTENANCE_ADMIN_URL);
404
-		$this->_template_args[ 'reset_db_page_url' ] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'data_reset'), EE_MAINTENANCE_ADMIN_URL);
405
-		$this->_template_args[ 'reattempt_action_url' ] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'reattempt_migration'), EE_MAINTENANCE_ADMIN_URL );
406
-		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_confirm_migration_crash_report_sent.template.php';
407
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path,$this->_template_args,TRUE);
404
+		$this->_template_args['reset_db_page_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'data_reset'), EE_MAINTENANCE_ADMIN_URL);
405
+		$this->_template_args['reattempt_action_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'reattempt_migration'), EE_MAINTENANCE_ADMIN_URL);
406
+		$this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH.'ee_confirm_migration_crash_report_sent.template.php';
407
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
408 408
 		$this->display_admin_page_with_sidebar();
409 409
 	}
410 410
 
@@ -417,18 +417,18 @@  discard block
 block discarded – undo
417 417
 	 * @param boolean $nuke_old_ee4_data controls whether or not we
418 418
 	 * destroy the old ee4 data, or just try initializing ee4 default data
419 419
 	 */
420
-	public function _reset_db( $nuke_old_ee4_data = TRUE ){
420
+	public function _reset_db($nuke_old_ee4_data = TRUE) {
421 421
 		EE_Maintenance_Mode::instance()->set_maintenance_level(EE_Maintenance_Mode::level_0_not_in_maintenance);
422 422
 
423
-		if( $nuke_old_ee4_data ){
423
+		if ($nuke_old_ee4_data) {
424 424
 			EEH_Activation::delete_all_espresso_cpt_data();
425
-			EEH_Activation::delete_all_espresso_tables_and_data( FALSE );
425
+			EEH_Activation::delete_all_espresso_tables_and_data(FALSE);
426 426
 			EEH_Activation::remove_cron_tasks();
427 427
 		}
428 428
 		//make sure when we reset the registry's config that it
429 429
 		//switches to using the new singleton
430
-		EE_Registry::instance()->CFG = EE_Registry::instance()->CFG->reset( TRUE );
431
-		EE_System::instance()->initialize_db_if_no_migrations_required( TRUE );
430
+		EE_Registry::instance()->CFG = EE_Registry::instance()->CFG->reset(TRUE);
431
+		EE_System::instance()->initialize_db_if_no_migrations_required(TRUE);
432 432
 		EE_System::instance()->redirect_to_about_ee();
433 433
 	}
434 434
 
@@ -437,20 +437,20 @@  discard block
 block discarded – undo
437 437
 	/**
438 438
 	 * Deletes ALL EE tables, Records, and Options from the database.
439 439
 	 */
440
-	public function _delete_db(){
440
+	public function _delete_db() {
441 441
 		EE_Maintenance_Mode::instance()->set_maintenance_level(EE_Maintenance_Mode::level_0_not_in_maintenance);
442 442
 		EEH_Activation::delete_all_espresso_cpt_data();
443 443
 		EEH_Activation::delete_all_espresso_tables_and_data();
444 444
 		EEH_Activation::remove_cron_tasks();
445 445
 		EEH_Activation::deactivate_event_espresso();
446
-		wp_safe_redirect( admin_url( 'plugins.php' ));
446
+		wp_safe_redirect(admin_url('plugins.php'));
447 447
 		exit;
448 448
 	}
449 449
 
450 450
 	/**
451 451
 	 * sets up EE4 to rerun the migrations from ee3 to ee4
452 452
 	 */
453
-	public function _rerun_migration_from_ee3(){
453
+	public function _rerun_migration_from_ee3() {
454 454
 		EE_Maintenance_Mode::instance()->set_maintenance_level(EE_Maintenance_Mode::level_0_not_in_maintenance);
455 455
 		EEH_Activation::delete_all_espresso_cpt_data();
456 456
 		EEH_Activation::delete_all_espresso_tables_and_data(false);
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 		wp_enqueue_script('ee_admin_js');
478 478
 //		wp_enqueue_media();
479 479
 //		wp_enqueue_script('media-upload');
480
-		wp_enqueue_script('ee-maintenance',EE_MAINTENANCE_ASSETS_URL.'/ee-maintenance.js',array('jquery'),EVENT_ESPRESSO_VERSION,true);
480
+		wp_enqueue_script('ee-maintenance', EE_MAINTENANCE_ASSETS_URL.'/ee-maintenance.js', array('jquery'), EVENT_ESPRESSO_VERSION, true);
481 481
 
482
-		wp_register_style( 'espresso_maintenance', EE_MAINTENANCE_ASSETS_URL . 'ee-maintenance.css', array(), EVENT_ESPRESSO_VERSION );
482
+		wp_register_style('espresso_maintenance', EE_MAINTENANCE_ASSETS_URL.'ee-maintenance.css', array(), EVENT_ESPRESSO_VERSION);
483 483
 		wp_enqueue_style('espresso_maintenance');
484 484
 	}
485 485
 
Please login to merge, or discard this patch.
admin_pages/payments/Payments_Admin_Page.core.php 1 patch
Spacing   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
45 45
 	 * @return \Payments_Admin_Page
46 46
 	 */
47
-	public function __construct( $routing = TRUE ) {
48
-		parent::__construct( $routing );
47
+	public function __construct($routing = TRUE) {
48
+		parent::__construct($routing);
49 49
 	}
50 50
 
51 51
 
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
 	protected function _set_page_config() {
131 131
 		$payment_method_list_config = array(
132 132
 			'nav'           => array(
133
-				'label' => __( 'Payment Methods', 'event_espresso' ),
133
+				'label' => __('Payment Methods', 'event_espresso'),
134 134
 				'order' => 10
135 135
 			),
136 136
 			'metaboxes'     => $this->_default_espresso_metaboxes,
137 137
 			'help_tabs'     => array_merge(
138 138
 				array(
139 139
 					'payment_methods_overview_help_tab' => array(
140
-						'title'    => __( 'Payment Methods Overview', 'event_espresso' ),
140
+						'title'    => __('Payment Methods Overview', 'event_espresso'),
141 141
 						'filename' => 'payment_methods_overview'
142 142
 					)
143 143
 				),
144 144
 				$this->_add_payment_method_help_tabs() ),
145
-			'help_tour'     => array( 'Payment_Methods_Selection_Help_Tour' ),
145
+			'help_tour'     => array('Payment_Methods_Selection_Help_Tour'),
146 146
 			'require_nonce' => false
147 147
 		);
148 148
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 					)
161 161
 				),
162 162
 				//'help_tour' => array( 'Payment_Methods_Settings_Help_Tour' ),
163
-				'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ),
163
+				'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
164 164
 				'require_nonce' => FALSE
165 165
 			),
166 166
 			'payment_log'=>array(
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
 	/**
180 180
 	 * @return array
181 181
 	 */
182
-	protected function _add_payment_method_help_tabs(){
182
+	protected function _add_payment_method_help_tabs() {
183 183
 		EE_Registry::instance()->load_lib('Payment_Method_Manager');
184 184
 		$payment_method_types = EE_Payment_Method_Manager::instance()->payment_method_types();
185 185
 		$all_pmt_help_tabs_config = array();
186
-		foreach( $payment_method_types as $payment_method_type ){
187
-			if ( ! EE_Registry::instance()->CAP->current_user_can( $payment_method_type->cap_name(), 'specific_payment_method_type_access' ) ) {
186
+		foreach ($payment_method_types as $payment_method_type) {
187
+			if ( ! EE_Registry::instance()->CAP->current_user_can($payment_method_type->cap_name(), 'specific_payment_method_type_access')) {
188 188
 				continue;
189 189
 			}
190
-			foreach( $payment_method_type->help_tabs_config() as $help_tab_name => $config ){
191
-				$template_args = isset( $config[ 'template_args' ] ) ? $config[ 'template_args' ] : array();
192
-				$template_args[ 'admin_page_obj' ] = $this;
190
+			foreach ($payment_method_type->help_tabs_config() as $help_tab_name => $config) {
191
+				$template_args = isset($config['template_args']) ? $config['template_args'] : array();
192
+				$template_args['admin_page_obj'] = $this;
193 193
 				$all_pmt_help_tabs_config[$help_tab_name] = array(
194 194
 					'title'=>$config['title'],
195 195
 					'content'=>EEH_Template::display_template( 
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
 
218 218
 	public function load_scripts_styles() {
219
-		wp_enqueue_script( 'ee_admin_js' );
220
-		wp_enqueue_script( 'ee-text-links' );
221
-		wp_enqueue_script( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'espresso_payments_admin.js', array( 'espresso-ui-theme', 'ee-datepicker' ), EVENT_ESPRESSO_VERSION, TRUE );
219
+		wp_enqueue_script('ee_admin_js');
220
+		wp_enqueue_script('ee-text-links');
221
+		wp_enqueue_script('espresso_payments', EE_PAYMENTS_ASSETS_URL.'espresso_payments_admin.js', array('espresso-ui-theme', 'ee-datepicker'), EVENT_ESPRESSO_VERSION, TRUE);
222 222
 	}
223 223
 
224 224
 
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 
228 228
 	public function load_scripts_styles_default() {
229 229
 		//styles
230
-		wp_register_style( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'ee-payments.css', array(), EVENT_ESPRESSO_VERSION );
231
-		wp_enqueue_style( 'espresso_payments' );
232
-		wp_enqueue_style( 'ee-text-links' );
230
+		wp_register_style('espresso_payments', EE_PAYMENTS_ASSETS_URL.'ee-payments.css', array(), EVENT_ESPRESSO_VERSION);
231
+		wp_enqueue_style('espresso_payments');
232
+		wp_enqueue_style('ee-text-links');
233 233
 		//scripts
234 234
 	}
235 235
 
@@ -243,44 +243,44 @@  discard block
 block discarded – undo
243 243
 		 * to the loading process.  However, people MUST setup the details for the payment method so its safe to do a
244 244
 		 * recheck here.
245 245
 		 */
246
-		EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
246
+		EE_Registry::instance()->load_lib('Payment_Method_Manager');
247 247
 		EEM_Payment_Method::instance()->verify_button_urls();
248 248
 		//setup tabs, one for each payment method type
249 249
 		$tabs = array();
250 250
 		$payment_methods = array();
251
-		foreach( EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj ) {
251
+		foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) {
252 252
 			// we don't want to show admin-only PMTs for now
253
-			if ( $pmt_obj instanceof EE_PMT_Admin_Only ) {
253
+			if ($pmt_obj instanceof EE_PMT_Admin_Only) {
254 254
 				continue;
255 255
 			}
256 256
 			//check access
257
-			if ( ! EE_Registry::instance()->CAP->current_user_can( $pmt_obj->cap_name(), 'specific_payment_method_type_access' ) ) {
257
+			if ( ! EE_Registry::instance()->CAP->current_user_can($pmt_obj->cap_name(), 'specific_payment_method_type_access')) {
258 258
 				continue;
259 259
 			}
260 260
 			//check for any active pms of that type
261
-			$payment_method = EEM_Payment_Method::instance()->get_one_of_type( $pmt_obj->system_name() );
262
-			if ( ! $payment_method instanceof EE_Payment_Method ) {
261
+			$payment_method = EEM_Payment_Method::instance()->get_one_of_type($pmt_obj->system_name());
262
+			if ( ! $payment_method instanceof EE_Payment_Method) {
263 263
 				$payment_method = EE_Payment_Method::new_instance(
264 264
 					array(
265
-						'PMD_slug'					=>sanitize_key( $pmt_obj->system_name() ),
265
+						'PMD_slug'					=>sanitize_key($pmt_obj->system_name()),
266 266
 						'PMD_type'					=>$pmt_obj->system_name(),
267 267
 						'PMD_name'				=>$pmt_obj->pretty_name(),
268 268
 						'PMD_admin_name'	=>$pmt_obj->pretty_name()
269 269
 					)
270 270
 				);
271 271
 			}
272
-			$payment_methods[ $payment_method->slug() ] = $payment_method;
272
+			$payment_methods[$payment_method->slug()] = $payment_method;
273 273
 		}
274
-		$payment_methods = apply_filters( 'FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods );
275
-		foreach( $payment_methods as $payment_method ) {
276
-			if ( $payment_method instanceof EE_Payment_Method ) {
274
+		$payment_methods = apply_filters('FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods);
275
+		foreach ($payment_methods as $payment_method) {
276
+			if ($payment_method instanceof EE_Payment_Method) {
277 277
 				add_meta_box(
278 278
 					//html id
279
-					'espresso_' . $payment_method->slug() . '_payment_settings',
279
+					'espresso_'.$payment_method->slug().'_payment_settings',
280 280
 					//title
281
-					sprintf( __( '%s Settings', 'event_espresso' ), $payment_method->admin_name() ),
281
+					sprintf(__('%s Settings', 'event_espresso'), $payment_method->admin_name()),
282 282
 					//callback
283
-					array( $this, 'payment_method_settings_meta_box' ),
283
+					array($this, 'payment_method_settings_meta_box'),
284 284
 					//post type
285 285
 					null,
286 286
 					//context
@@ -288,19 +288,19 @@  discard block
 block discarded – undo
288 288
 					//priority
289 289
 					'default',
290 290
 					//callback args
291
-					array( 'payment_method' => $payment_method )
291
+					array('payment_method' => $payment_method)
292 292
 				);
293 293
 				//setup for tabbed content
294
-				$tabs[ $payment_method->slug() ] = array(
294
+				$tabs[$payment_method->slug()] = array(
295 295
 					'label' => $payment_method->admin_name(),
296 296
 					'class' => $payment_method->active() ? 'gateway-active' : '',
297
-					'href'  => 'espresso_' . $payment_method->slug() . '_payment_settings',
298
-					'title' => __( 'Modify this Payment Method', 'event_espresso' ),
297
+					'href'  => 'espresso_'.$payment_method->slug().'_payment_settings',
298
+					'title' => __('Modify this Payment Method', 'event_espresso'),
299 299
 					'slug'  => $payment_method->slug()
300 300
 				);
301 301
 			}
302 302
 		}
303
-		$this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links( $tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug() );
303
+		$this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links($tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug());
304 304
 		$this->display_admin_page_with_sidebar();
305 305
 
306 306
 	}
@@ -311,20 +311,20 @@  discard block
 block discarded – undo
311 311
 	 *   _get_active_payment_method_slug
312 312
 	 * 	@return string
313 313
 	 */
314
-	protected function _get_active_payment_method_slug(){
314
+	protected function _get_active_payment_method_slug() {
315 315
 		$payment_method_slug = FALSE;
316 316
 		//decide which payment method tab to open first, as dictated by the request's 'payment_method'
317
-		if ( isset( $this->_req_data['payment_method'] )) {
317
+		if (isset($this->_req_data['payment_method'])) {
318 318
 			// if they provided the current payment method, use it
319
-			$payment_method_slug = sanitize_key( $this->_req_data['payment_method'] );
319
+			$payment_method_slug = sanitize_key($this->_req_data['payment_method']);
320 320
 		}
321
-		$payment_method = EEM_Payment_Method::instance()->get_one( array( array( 'PMD_slug' => $payment_method_slug )));
321
+		$payment_method = EEM_Payment_Method::instance()->get_one(array(array('PMD_slug' => $payment_method_slug)));
322 322
 		// if that didn't work or wasn't provided, find another way to select the current pm
323
-		if ( ! $this->_verify_payment_method( $payment_method )) {
323
+		if ( ! $this->_verify_payment_method($payment_method)) {
324 324
 			// like, looking for an active one
325
-			$payment_method = EEM_Payment_Method::instance()->get_one_active( 'CART' );
325
+			$payment_method = EEM_Payment_Method::instance()->get_one_active('CART');
326 326
 			// test that one as well
327
-			if ( $this->_verify_payment_method( $payment_method )) {
327
+			if ($this->_verify_payment_method($payment_method)) {
328 328
 				$payment_method_slug = $payment_method->slug();
329 329
 			} else {
330 330
 				$payment_method_slug = 'paypal_standard';
@@ -342,11 +342,11 @@  discard block
 block discarded – undo
342 342
 	 * @param \EE_Payment_Method $payment_method
343 343
 	 * @return boolean
344 344
 	 */
345
-	protected function _verify_payment_method( $payment_method ){
345
+	protected function _verify_payment_method($payment_method) {
346 346
 		if (
347 347
 			$payment_method instanceof EE_Payment_Method &&
348 348
 			$payment_method->type_obj() instanceof EE_PMT_Base &&
349
-			EE_Registry::instance()->CAP->current_user_can( $payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access' )
349
+			EE_Registry::instance()->CAP->current_user_can($payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access')
350 350
 		) {
351 351
 			return TRUE;
352 352
 		}
@@ -363,21 +363,21 @@  discard block
 block discarded – undo
363 363
 	 * @return string
364 364
 	 * @throws EE_Error
365 365
 	 */
366
-	public function payment_method_settings_meta_box( $post_obj_which_is_null, $metabox ){
367
-		$payment_method = isset( $metabox['args'], $metabox['args']['payment_method'] ) ? $metabox['args']['payment_method'] : NULL;
368
-		if ( ! $payment_method instanceof EE_Payment_Method ){
369
-			throw new EE_Error( sprintf( __( 'Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso' )));
366
+	public function payment_method_settings_meta_box($post_obj_which_is_null, $metabox) {
367
+		$payment_method = isset($metabox['args'], $metabox['args']['payment_method']) ? $metabox['args']['payment_method'] : NULL;
368
+		if ( ! $payment_method instanceof EE_Payment_Method) {
369
+			throw new EE_Error(sprintf(__('Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso')));
370 370
 		}
371 371
 		$payment_method_scopes = $payment_method->active();
372 372
 		// if the payment method really exists show its form, otherwise the activation template
373
-		if ( $payment_method->ID() && ! empty( $payment_method_scopes )) {
374
-				$form = $this->_generate_payment_method_settings_form( $payment_method );
375
-				if ( $form->form_data_present_in( $this->_req_data )) {
376
-					$form->receive_form_submission( $this->_req_data );
373
+		if ($payment_method->ID() && ! empty($payment_method_scopes)) {
374
+				$form = $this->_generate_payment_method_settings_form($payment_method);
375
+				if ($form->form_data_present_in($this->_req_data)) {
376
+					$form->receive_form_submission($this->_req_data);
377 377
 				}
378
-				echo $form->form_open() . $form->get_html_and_js() . $form->form_close();
378
+				echo $form->form_open().$form->get_html_and_js().$form->form_close();
379 379
 		} else {
380
-			echo $this->_activate_payment_method_button( $payment_method )->get_html_and_js();
380
+			echo $this->_activate_payment_method_button($payment_method)->get_html_and_js();
381 381
 		}
382 382
 	}
383 383
 
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
 	 * @param \EE_Payment_Method $payment_method
391 391
 	 * @return \EE_Form_Section_Proper
392 392
 	 */
393
-	protected function _generate_payment_method_settings_form( EE_Payment_Method $payment_method ) {
394
-		if ( ! $payment_method instanceof EE_Payment_Method ){
393
+	protected function _generate_payment_method_settings_form(EE_Payment_Method $payment_method) {
394
+		if ( ! $payment_method instanceof EE_Payment_Method) {
395 395
 			return new EE_Form_Section_Proper();
396 396
 		}
397 397
 		return new EE_Form_Section_Proper(
398 398
 			array(
399
-				'name' 	=> $payment_method->slug() . '_settings_form',
400
-				'html_id' 	=> $payment_method->slug() . '_settings_form',
399
+				'name' 	=> $payment_method->slug().'_settings_form',
400
+				'html_id' 	=> $payment_method->slug().'_settings_form',
401 401
 				'action' 	=> EE_Admin_Page::add_query_args_and_nonce(
402 402
 					array(
403 403
 						'action' 						=> 'update_payment_method',
@@ -409,12 +409,12 @@  discard block
 block discarded – undo
409 409
 				'subsections' 			=> apply_filters(
410 410
 					'FHEE__Payments_Admin_Page___generate_payment_method_settings_form__form_subsections',
411 411
 					array(
412
-						'pci_dss_compliance_' . $payment_method->slug() 				=> $this->_pci_dss_compliance( $payment_method ),
413
-						'currency_support_' . $payment_method->slug()					=> $this->_currency_support( $payment_method ),
414
-						'payment_method_settings_' . $payment_method->slug() 	=> $this->_payment_method_settings( $payment_method ),
415
-						'update_' . $payment_method->slug()										=> $this->_update_payment_method_button( $payment_method ),
416
-						'deactivate_' . $payment_method->slug()								=> $this->_deactivate_payment_method_button( $payment_method ),
417
-						'fine_print_' . $payment_method->slug()									=> $this->_fine_print()
412
+						'pci_dss_compliance_'.$payment_method->slug() 				=> $this->_pci_dss_compliance($payment_method),
413
+						'currency_support_'.$payment_method->slug()					=> $this->_currency_support($payment_method),
414
+						'payment_method_settings_'.$payment_method->slug() 	=> $this->_payment_method_settings($payment_method),
415
+						'update_'.$payment_method->slug()										=> $this->_update_payment_method_button($payment_method),
416
+						'deactivate_'.$payment_method->slug()								=> $this->_deactivate_payment_method_button($payment_method),
417
+						'fine_print_'.$payment_method->slug()									=> $this->_fine_print()
418 418
 					),
419 419
 					$payment_method
420 420
 				)
@@ -431,19 +431,19 @@  discard block
 block discarded – undo
431 431
 	 * @param \EE_Payment_Method $payment_method
432 432
 	 * @return \EE_Form_Section_Proper
433 433
 	 */
434
-	protected function _pci_dss_compliance( EE_Payment_Method $payment_method ) {
435
-		if ( $payment_method->type_obj()->requires_https() ) {
434
+	protected function _pci_dss_compliance(EE_Payment_Method $payment_method) {
435
+		if ($payment_method->type_obj()->requires_https()) {
436 436
 			return new EE_Form_Section_HTML(
437 437
 				EEH_HTML::tr(
438 438
 					EEH_HTML::th(
439 439
 						EEH_HTML::label(
440
-							EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' )
440
+							EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice')
441 441
 						)
442
-					) .
442
+					).
443 443
 					EEH_HTML::td(
444
-						EEH_HTML::strong( __( 'You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso' )) .
445
-						EEH_HTML::br() .
446
-						__( 'Learn more about ', 'event_espresso' ) . EEH_HTML::link( 'https://www.pcisecuritystandards.org/merchants/index.php', __( 'PCI DSS compliance', 'event_espresso' ))
444
+						EEH_HTML::strong(__('You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso')).
445
+						EEH_HTML::br().
446
+						__('Learn more about ', 'event_espresso').EEH_HTML::link('https://www.pcisecuritystandards.org/merchants/index.php', __('PCI DSS compliance', 'event_espresso'))
447 447
 					)
448 448
 				)
449 449
 			);
@@ -461,19 +461,19 @@  discard block
 block discarded – undo
461 461
 	 * @param \EE_Payment_Method $payment_method
462 462
 	 * @return \EE_Form_Section_Proper
463 463
 	 */
464
-	protected function _currency_support( EE_Payment_Method $payment_method ) {
465
-		if ( ! $payment_method->usable_for_currency( EE_Config::instance()->currency->code )) {
464
+	protected function _currency_support(EE_Payment_Method $payment_method) {
465
+		if ( ! $payment_method->usable_for_currency(EE_Config::instance()->currency->code)) {
466 466
 			return new EE_Form_Section_HTML(
467 467
 				EEH_HTML::tr(
468 468
 					EEH_HTML::th(
469 469
 						EEH_HTML::label(
470
-							EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' )
470
+							EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice')
471 471
 						)
472
-					) .
472
+					).
473 473
 					EEH_HTML::td(
474 474
 						EEH_HTML::strong(
475 475
 							sprintf(
476
-								__( 'This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'),
476
+								__('This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'),
477 477
 								EE_Config::instance()->currency->code
478 478
 							)
479 479
 						)
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
 	 * @param \EE_Payment_Method $payment_method
494 494
 	 * @return \EE_Form_Section_HTML
495 495
 	 */
496
-	protected function _payment_method_settings( EE_Payment_Method $payment_method ) {
496
+	protected function _payment_method_settings(EE_Payment_Method $payment_method) {
497 497
 		//modify the form so we only have/show fields that will be implemented for this version
498
-		return $this->_simplify_form( $payment_method->type_obj()->settings_form(), $payment_method->name() );
498
+		return $this->_simplify_form($payment_method->type_obj()->settings_form(), $payment_method->name());
499 499
 	}
500 500
 
501 501
 
@@ -508,8 +508,8 @@  discard block
 block discarded – undo
508 508
 	 * @return \EE_Payment_Method_Form
509 509
 	 * @throws \EE_Error
510 510
 	 */
511
-	protected function _simplify_form( $form_section, $payment_method_name = '' ){
512
-		if ( $form_section instanceof EE_Payment_Method_Form ) {
511
+	protected function _simplify_form($form_section, $payment_method_name = '') {
512
+		if ($form_section instanceof EE_Payment_Method_Form) {
513 513
 			$form_section->exclude(
514 514
 				array(
515 515
 					'PMD_type', //dont want them changing the type
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 			);
521 521
 			return $form_section;
522 522
 		} else {
523
-			throw new EE_Error( sprintf( __( 'The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso' ), $payment_method_name ));
523
+			throw new EE_Error(sprintf(__('The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso'), $payment_method_name));
524 524
 		}
525 525
 	}
526 526
 
@@ -533,18 +533,18 @@  discard block
 block discarded – undo
533 533
 	 * @param \EE_Payment_Method $payment_method
534 534
 	 * @return \EE_Form_Section_HTML
535 535
 	 */
536
-	protected function _update_payment_method_button( EE_Payment_Method $payment_method ) {
536
+	protected function _update_payment_method_button(EE_Payment_Method $payment_method) {
537 537
 		$update_button = new EE_Submit_Input(
538 538
 			array(
539
-				'html_id' 		=> 'save_' . $payment_method->slug() . '_settings',
540
-				'default' 		=> sprintf( __( 'Update %s Payment Settings', 'event_espresso' ), $payment_method->admin_name() ),
539
+				'html_id' 		=> 'save_'.$payment_method->slug().'_settings',
540
+				'default' 		=> sprintf(__('Update %s Payment Settings', 'event_espresso'), $payment_method->admin_name()),
541 541
 				'html_label' => EEH_HTML::nbsp()
542 542
 			)
543 543
 		);
544 544
 		return new EE_Form_Section_HTML(
545
-			EEH_HTML::no_row( EEH_HTML::br(2) ) .
545
+			EEH_HTML::no_row(EEH_HTML::br(2)).
546 546
 			EEH_HTML::tr(
547
-				EEH_HTML::th( __( 'Update Settings', 'event_espresso') ) .
547
+				EEH_HTML::th(__('Update Settings', 'event_espresso')).
548 548
 				EEH_HTML::td(
549 549
 					$update_button->get_html_for_input()
550 550
 				)
@@ -561,11 +561,11 @@  discard block
 block discarded – undo
561 561
 	 * @param \EE_Payment_Method $payment_method
562 562
 	 * @return \EE_Form_Section_Proper
563 563
 	 */
564
-	protected function _deactivate_payment_method_button( EE_Payment_Method $payment_method ) {
565
-		$link_text_and_title = sprintf( __( 'Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name() );
564
+	protected function _deactivate_payment_method_button(EE_Payment_Method $payment_method) {
565
+		$link_text_and_title = sprintf(__('Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name());
566 566
 		return new EE_Form_Section_HTML(
567 567
 			EEH_HTML::tr(
568
-				EEH_HTML::th( __( 'Deactivate Payment Method', 'event_espresso') ) .
568
+				EEH_HTML::th(__('Deactivate Payment Method', 'event_espresso')).
569 569
 				EEH_HTML::td(
570 570
 					EEH_HTML::link(
571 571
 						EE_Admin_Page::add_query_args_and_nonce(
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 						),
578 578
 						$link_text_and_title,
579 579
 						$link_text_and_title,
580
-						'deactivate_' . $payment_method->slug(),
580
+						'deactivate_'.$payment_method->slug(),
581 581
 						'espresso-button button-secondary'
582 582
 					)
583 583
 				)
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
 	 * @param \EE_Payment_Method $payment_method
594 594
 	 * @return \EE_Form_Section_Proper
595 595
 	 */
596
-	protected function _activate_payment_method_button( EE_Payment_Method $payment_method ) {
597
-		$link_text_and_title = sprintf( __( 'Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name() );
596
+	protected function _activate_payment_method_button(EE_Payment_Method $payment_method) {
597
+		$link_text_and_title = sprintf(__('Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name());
598 598
 		return new EE_Form_Section_Proper(
599 599
 			array(
600
-				'name' 	=> 'activate_' . $payment_method->slug() . '_settings_form',
601
-				'html_id' 	=> 'activate_' . $payment_method->slug() . '_settings_form',
600
+				'name' 	=> 'activate_'.$payment_method->slug().'_settings_form',
601
+				'html_id' 	=> 'activate_'.$payment_method->slug().'_settings_form',
602 602
 				'action' 	=> '#',
603 603
 				'layout_strategy'		=> new EE_Admin_Two_Column_Layout(),
604 604
 				'subsections' 			=> apply_filters(
@@ -607,8 +607,8 @@  discard block
 block discarded – undo
607 607
 						new EE_Form_Section_HTML(
608 608
 							EEH_HTML::tr(
609 609
 								EEH_HTML::th(
610
-									EEH_HTML::label( __( 'Click to Activate ', 'event_espresso' ))
611
-								) .
610
+									EEH_HTML::label(__('Click to Activate ', 'event_espresso'))
611
+								).
612 612
 								EEH_HTML::td(
613 613
 									EEH_HTML::link(
614 614
 										EE_Admin_Page::add_query_args_and_nonce(
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 										),
621 621
 										$link_text_and_title,
622 622
 										$link_text_and_title,
623
-										'activate_' . $payment_method->slug(),
623
+										'activate_'.$payment_method->slug(),
624 624
 										'espresso-button-green button-primary'
625 625
 									)
626 626
 								)
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 	protected function _fine_print() {
643 643
 		return new EE_Form_Section_HTML(
644 644
 			EEH_HTML::tr(
645
-				EEH_HTML::th() .
645
+				EEH_HTML::th().
646 646
 				EEH_HTML::td(
647
-					EEH_HTML::p( __( 'All fields marked with a * are required fields', 'event_espresso' ), '', 'grey-text' )
647
+					EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text')
648 648
 				)
649 649
 			)
650 650
 		);
@@ -656,15 +656,15 @@  discard block
 block discarded – undo
656 656
 	 * Activates a payment method of that type. Mostly assuming there is only 1 of that type (or none so far)
657 657
 	 * @global WP_User $current_user
658 658
 	 */
659
-	protected function _activate_payment_method(){
660
-		if(isset($this->_req_data['payment_method_type'])){
659
+	protected function _activate_payment_method() {
660
+		if (isset($this->_req_data['payment_method_type'])) {
661 661
 			$payment_method_type = sanitize_text_field($this->_req_data['payment_method_type']);
662 662
 			//see if one exists
663
-			EE_Registry::instance()->load_lib( 'Payment_Method_Manager' );
664
-			$payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( $payment_method_type );
663
+			EE_Registry::instance()->load_lib('Payment_Method_Manager');
664
+			$payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type($payment_method_type);
665 665
 
666
-			$this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default','payment_method'=>$payment_method->slug()));
667
-		}else{
666
+			$this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default', 'payment_method'=>$payment_method->slug()));
667
+		} else {
668 668
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default'));
669 669
 		}
670 670
 	}
@@ -672,14 +672,14 @@  discard block
 block discarded – undo
672 672
 	/**
673 673
 	 * Deactivates the payment method with the specified slug, and redirects.
674 674
 	 */
675
-	protected function _deactivate_payment_method(){
676
-		if(isset($this->_req_data['payment_method'])){
675
+	protected function _deactivate_payment_method() {
676
+		if (isset($this->_req_data['payment_method'])) {
677 677
 			$payment_method_slug = sanitize_key($this->_req_data['payment_method']);
678 678
 			//deactivate it
679 679
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
680
-			$count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method( $payment_method_slug );
681
-			$this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default','payment_method'=>$payment_method_slug));
682
-		}else{
680
+			$count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method($payment_method_slug);
681
+			$this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default', 'payment_method'=>$payment_method_slug));
682
+		} else {
683 683
 			$this->_redirect_after_action(FALSE, 'Payment Method', 'deactivated', array('action' => 'default'));
684 684
 		}
685 685
 	}
@@ -693,39 +693,39 @@  discard block
 block discarded – undo
693 693
 	 * subsequently called 'headers_sent_func' which is _payment_methods_list)
694 694
 	 * @return void
695 695
 	 */
696
-	protected function _update_payment_method(){
697
-		if( $_SERVER['REQUEST_METHOD'] == 'POST'){
696
+	protected function _update_payment_method() {
697
+		if ($_SERVER['REQUEST_METHOD'] == 'POST') {
698 698
 			//ok let's find which gateway form to use based on the form input
699 699
 			EE_Registry::instance()->load_lib('Payment_Method_Manager');
700 700
 			/** @var $correct_pmt_form_to_use EE_Payment_Method_Form */
701 701
 			$correct_pmt_form_to_use = NULL;
702 702
 			$pmt_obj = NULL;
703
-			foreach(EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj){
703
+			foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) {
704 704
 				/** @var $pmt_obj EE_PMT_Base */
705 705
 				//get the form and simplify it, like what we do when we display it
706 706
 				$pmt_form = $pmt_obj->settings_form();
707 707
 				$this->_simplify_form($pmt_form);
708
-				if($pmt_form->form_data_present_in($this->_req_data)){
708
+				if ($pmt_form->form_data_present_in($this->_req_data)) {
709 709
 					$correct_pmt_form_to_use = $pmt_form;
710 710
 					break;
711 711
 				}
712 712
 			}
713 713
 			//if we couldn't find the correct payment method type...
714
-			if( ! $correct_pmt_form_to_use ){
714
+			if ( ! $correct_pmt_form_to_use) {
715 715
 				EE_Error::add_error(__("We could not find which payment method type your form submission related to. Please contact support", 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
716 716
 				$this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default'));
717 717
 			}
718 718
 			$correct_pmt_form_to_use->receive_form_submission($this->_req_data);
719
-			if($correct_pmt_form_to_use->is_valid()){
719
+			if ($correct_pmt_form_to_use->is_valid()) {
720 720
 				$correct_pmt_form_to_use->save();
721 721
 				$pm = $correct_pmt_form_to_use->get_model_object();
722 722
 				/** @var $pm EE_Payment_Method */
723
-				$this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default','payment_method'=>$pm->slug()));
724
-			}else{
723
+				$this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default', 'payment_method'=>$pm->slug()));
724
+			} else {
725 725
 				EE_Error::add_error(
726 726
 					sprintf(
727 727
 						__('Payment method of type %s was not saved because there were validation errors. They have been marked in the form', 'event_espresso'),
728
-						$pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __( '"(unknown)"', 'event_espresso' )
728
+						$pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __('"(unknown)"', 'event_espresso')
729 729
 					),
730 730
 					__FILE__,
731 731
 					__FUNCTION__,
@@ -742,11 +742,11 @@  discard block
 block discarded – undo
742 742
 	protected function _payment_settings() {
743 743
 
744 744
 		$this->_template_args['values'] = $this->_yes_no_values;
745
-		$this->_template_args['show_pending_payment_options'] = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) ? absint( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) : FALSE;
745
+		$this->_template_args['show_pending_payment_options'] = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) ? absint(EE_Registry::instance()->CFG->registration->show_pending_payment_options) : FALSE;
746 746
 
747
-		$this->_set_add_edit_form_tags( 'update_payment_settings' );
748
-		$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE );
749
-		$this->_template_args['admin_page_content'] = EEH_Template::display_template( EE_PAYMENTS_TEMPLATE_PATH . 'payment_settings.template.php', $this->_template_args, TRUE );
747
+		$this->_set_add_edit_form_tags('update_payment_settings');
748
+		$this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
749
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(EE_PAYMENTS_TEMPLATE_PATH.'payment_settings.template.php', $this->_template_args, TRUE);
750 750
 		$this->display_admin_page_with_sidebar();
751 751
 
752 752
 	}
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
 	*		@return array
761 761
 	*/
762 762
 	protected function _update_payment_settings() {
763
-		EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset( $this->_req_data['show_pending_payment_options'] ) ? $this->_req_data['show_pending_payment_options'] : FALSE;
764
-		EE_Registry::instance()->CFG = apply_filters( 'FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG );
763
+		EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset($this->_req_data['show_pending_payment_options']) ? $this->_req_data['show_pending_payment_options'] : FALSE;
764
+		EE_Registry::instance()->CFG = apply_filters('FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG);
765 765
 
766 766
 
767
-		$what = __('Payment Settings','event_espresso');
768
-		$success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ );
769
-		$this->_redirect_after_action( $success, $what, __('updated','event_espresso'), array( 'action' => 'payment_settings' ) );
767
+		$what = __('Payment Settings', 'event_espresso');
768
+		$success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__);
769
+		$this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), array('action' => 'payment_settings'));
770 770
 
771 771
 	}
772 772
 	protected function _payment_log_overview_list_table() {
@@ -792,18 +792,18 @@  discard block
 block discarded – undo
792 792
 	 * @param bool $count
793 793
 	 * @return array
794 794
 	 */
795
-	public function get_payment_logs($per_page = 50, $current_page = 0, $count = false){
796
-		EE_Registry::instance()->load_model( 'Change_Log' );
795
+	public function get_payment_logs($per_page = 50, $current_page = 0, $count = false) {
796
+		EE_Registry::instance()->load_model('Change_Log');
797 797
 		//we may need to do multiple queries (joining differently), so we actually wan tan array of query params
798
-		$query_params =  array(array('LOG_type'=>  EEM_Change_Log::type_gateway));
798
+		$query_params = array(array('LOG_type'=>  EEM_Change_Log::type_gateway));
799 799
 		//check if they've selected a specific payment method
800
-		if( isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all'){
800
+		if (isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all') {
801 801
 			$query_params[0]['OR*pm_or_pay_pm'] = array('Payment.Payment_Method.PMD_ID'=>$this->_req_data['_payment_method'],
802 802
 				'Payment_Method.PMD_ID'=>$this->_req_data['_payment_method']);
803 803
 		}
804 804
 		//take into account search
805
-		if(isset($this->_req_data['s']) && $this->_req_data['s']){
806
-			$similarity_string = array('LIKE','%'.str_replace("","%",$this->_req_data['s']) .'%');
805
+		if (isset($this->_req_data['s']) && $this->_req_data['s']) {
806
+			$similarity_string = array('LIKE', '%'.str_replace("", "%", $this->_req_data['s']).'%');
807 807
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_fname'] = $similarity_string;
808 808
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_lname'] = $similarity_string;
809 809
 			$query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_email'] = $similarity_string;
@@ -818,48 +818,48 @@  discard block
 block discarded – undo
818 818
 			$query_params[0]['OR*s']['LOG_message'] = $similarity_string;
819 819
 
820 820
 		}
821
-		if(isset( $this->_req_data['payment-filter-start-date'] ) && isset( $this->_req_data['payment-filter-end-date'] )){
821
+		if (isset($this->_req_data['payment-filter-start-date']) && isset($this->_req_data['payment-filter-end-date'])) {
822 822
 			//add date
823
-			$start_date =wp_strip_all_tags( $this->_req_data['payment-filter-start-date'] );
824
-			$end_date = wp_strip_all_tags( $this->_req_data['payment-filter-end-date'] );
823
+			$start_date = wp_strip_all_tags($this->_req_data['payment-filter-start-date']);
824
+			$end_date = wp_strip_all_tags($this->_req_data['payment-filter-end-date']);
825 825
 			//make sure our timestamps start and end right at the boundaries for each day
826
-			$start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00';
827
-			$end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59';
826
+			$start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00';
827
+			$end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59';
828 828
 
829 829
 			//convert to timestamps
830
-			$start_date = strtotime( $start_date );
831
-			$end_date = strtotime( $end_date );
830
+			$start_date = strtotime($start_date);
831
+			$end_date = strtotime($end_date);
832 832
 
833 833
 			//makes sure start date is the lowest value and vice versa
834
-			$start_date = min( $start_date, $end_date );
835
-			$end_date = max( $start_date, $end_date );
834
+			$start_date = min($start_date, $end_date);
835
+			$end_date = max($start_date, $end_date);
836 836
 
837 837
 			//convert for query
838
-			$start_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' );
839
-			$end_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' );
838
+			$start_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s');
839
+			$end_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s');
840 840
 
841
-			$query_params[0]['LOG_time'] = array('BETWEEN',array($start_date,$end_date));
841
+			$query_params[0]['LOG_time'] = array('BETWEEN', array($start_date, $end_date));
842 842
 
843 843
 		}
844
-		if($count){
844
+		if ($count) {
845 845
 			return EEM_Change_Log::instance()->count($query_params);
846 846
 		}
847
-		if(isset($this->_req_data['order'])){
848
-			$sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC';
847
+		if (isset($this->_req_data['order'])) {
848
+			$sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC';
849 849
 			$query_params['order_by'] = array('LOG_time' => $sort);
850
-		}else{
850
+		} else {
851 851
 				$query_params['order_by'] = array('LOG_time' => 'DESC');
852 852
 		}
853
-		$offset = ($current_page-1)*$per_page;
853
+		$offset = ($current_page - 1) * $per_page;
854 854
 
855
-		if( ! isset($this->_req_data['download_results'])){
856
-			$query_params['limit'] = array( $offset, $per_page );
855
+		if ( ! isset($this->_req_data['download_results'])) {
856
+			$query_params['limit'] = array($offset, $per_page);
857 857
 		}
858 858
 
859 859
 
860 860
 
861 861
 		//now they've requested to instead just download the file instead of viewing it.
862
-		if(isset($this->_req_data['download_results'])){
862
+		if (isset($this->_req_data['download_results'])) {
863 863
 			$wpdb_results = EEM_Change_Log::instance()->get_all_efficiently($query_params);
864 864
 			header('Content-Disposition: attachment');
865 865
 			header("Content-Disposition: attachment; filename=ee_payment_logs_for_".sanitize_key(site_url()));
@@ -881,36 +881,36 @@  discard block
 block discarded – undo
881 881
 	 * @param EE_Change_Log $logB
882 882
 	 * @return int
883 883
 	 */
884
-	protected function _sort_logs_again($logA,$logB){
884
+	protected function _sort_logs_again($logA, $logB) {
885 885
 		$timeA = $logA->get_raw('LOG_time');
886 886
 		$timeB = $logB->get_raw('LOG_time');
887
-		if($timeA == $timeB){
887
+		if ($timeA == $timeB) {
888 888
 			return 0;
889 889
 		}
890 890
 		$comparison = $timeA < $timeB ? -1 : 1;
891
-		if(strtoupper($this->_sort_logs_again_direction) == 'DESC'){
891
+		if (strtoupper($this->_sort_logs_again_direction) == 'DESC') {
892 892
 			return $comparison * -1;
893
-		}else{
893
+		} else {
894 894
 			return $comparison;
895 895
 		}
896 896
 	}
897 897
 
898 898
 	protected function _payment_log_details() {
899
-		EE_Registry::instance()->load_model( 'Change_Log' );
899
+		EE_Registry::instance()->load_model('Change_Log');
900 900
 		/** @var $payment_log EE_Change_Log */
901 901
 		$payment_log = EEM_Change_Log::instance()->get_one_by_ID($this->_req_data['ID']);
902 902
 		$payment_method = NULL;
903 903
 		$transaction = NULL;
904
-		if( $payment_log instanceof EE_Change_Log ){
905
-			if( $payment_log->object() instanceof EE_Payment ){
904
+		if ($payment_log instanceof EE_Change_Log) {
905
+			if ($payment_log->object() instanceof EE_Payment) {
906 906
 				$payment_method = $payment_log->object()->payment_method();
907 907
 				$transaction = $payment_log->object()->transaction();
908
-			}elseif($payment_log->object() instanceof EE_Payment_Method){
908
+			}elseif ($payment_log->object() instanceof EE_Payment_Method) {
909 909
 				$payment_method = $payment_log->object();
910 910
 			}
911 911
 		}
912 912
 		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
913
-			EE_PAYMENTS_TEMPLATE_PATH . 'payment_log_details.template.php',
913
+			EE_PAYMENTS_TEMPLATE_PATH.'payment_log_details.template.php',
914 914
 			array(
915 915
 				'payment_log'=>$payment_log,
916 916
 				'payment_method'=>$payment_method,
Please login to merge, or discard this patch.
admin_pages/payments/Payment_Log_Admin_List_Table.class.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @param \EE_Admin_Page $admin_page
36 36
 	 * @return Payment_Log_Admin_List_Table
37 37
 	 */
38
-	public function __construct( $admin_page ) {
38
+	public function __construct($admin_page) {
39 39
 		parent::__construct($admin_page);
40 40
 	}
41 41
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 //		}else{
53 53
 //			$this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE );
54 54
 //		}
55
-		$this->_all_data_count = $this->_admin_page->get_payment_logs( $this->_per_page,$this->_current_page, TRUE );
56
-		add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',array($this,'add_download_logs_checkbox'));
55
+		$this->_all_data_count = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, TRUE);
56
+		add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_download_logs_checkbox'));
57 57
 	}
58 58
 
59 59
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 * adds a checkbox to the bottom of the list table, instead of at the top with the rest of the filters
64 64
 	 * @return void
65 65
 	 */
66
-	public function add_download_logs_checkbox(){
67
-		echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='".  __( 'Download Results', 'event_espresso' )."'>";
66
+	public function add_download_logs_checkbox() {
67
+		echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='".__('Download Results', 'event_espresso')."'>";
68 68
 	}
69 69
 
70 70
 
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	protected function _set_properties() {
77 77
 		$this->_wp_list_args = array(
78
-			'singular' => __('payment log', 'event_espresso' ),
79
-			'plural' => __('payment logs', 'event_espresso' ),
78
+			'singular' => __('payment log', 'event_espresso'),
79
+			'plural' => __('payment logs', 'event_espresso'),
80 80
 			'ajax' => TRUE, //for now,
81 81
 			'screen' => $this->_admin_page->get_current_screen()->id
82 82
 			);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			);
91 91
 
92 92
 		$this->_sortable_columns = array(
93
-			'LOG_time' => array( 'LOG_time' => TRUE ),
93
+			'LOG_time' => array('LOG_time' => TRUE),
94 94
 			);
95 95
 
96 96
 		$this->_hidden_columns = array(
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
 		$filters = array();
109 109
 		//todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods.
110 110
 		$payment_methods = EEM_Payment_Method::instance()->get_all();
111
-		$payment_method_names = array(array('id'=>'all','text'=>  __("All", 'event_espresso')),array('id'=>'0','text'=>  __("Unknown Payment Method", 'event_espresso')));
112
-		foreach($payment_methods as $payment_method){
113
-			$payment_method_names[] = array('id'=>$payment_method->ID(),'text'=>$payment_method->admin_name());
111
+		$payment_method_names = array(array('id'=>'all', 'text'=>  __("All", 'event_espresso')), array('id'=>'0', 'text'=>  __("Unknown Payment Method", 'event_espresso')));
112
+		foreach ($payment_methods as $payment_method) {
113
+			$payment_method_names[] = array('id'=>$payment_method->ID(), 'text'=>$payment_method->admin_name());
114 114
 		}
115 115
 		$filters[] = EEH_Form_Fields::select_input('_payment_method', $payment_method_names, isset($this->_req_data['_payment_method']) ? $this->_req_data['_payment_method'] : 'all');
116
-		$start_date = isset( $this->_req_data['payment-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['payment-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-6 months' ));
117
-		$end_date = isset( $this->_req_data['payment-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['payment-filter-end-date'] ) : date( 'm/d/Y' );
116
+		$start_date = isset($this->_req_data['payment-filter-start-date']) ? wp_strip_all_tags($this->_req_data['payment-filter-start-date']) : date('m/d/Y', strtotime('-6 months'));
117
+		$end_date = isset($this->_req_data['payment-filter-end-date']) ? wp_strip_all_tags($this->_req_data['payment-filter-end-date']) : date('m/d/Y');
118 118
 		ob_start();
119 119
 		?>
120
-		<label for="txn-filter-start-date"><?php _e( 'Display Transactions from ', 'event_espresso' ); ?></label>
120
+		<label for="txn-filter-start-date"><?php _e('Display Transactions from ', 'event_espresso'); ?></label>
121 121
 		<input id="payment-filter-start-date" class="datepicker" type="text" value="<?php echo $start_date; ?>" name="payment-filter-start-date" size="15"/>
122
-		<label for="txn-filter-end-date"><?php _e( ' until ', 'event_espresso' ); ?></label>
122
+		<label for="txn-filter-end-date"><?php _e(' until ', 'event_espresso'); ?></label>
123 123
 		<input id="payment-filter-end-date" class="datepicker" type="text" value="<?php echo $end_date; ?>" name="payment-filter-end-date" size="15"/>
124 124
 		<?php
125 125
 		$filters[] = ob_get_clean();
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @return void
134 134
 	 */
135 135
 	protected function _add_view_counts() {
136
-		$this->_views['all']['count'] = $this->_admin_page->get_payment_logs( $this->_per_page,$this->_current_page, TRUE );
136
+		$this->_views['all']['count'] = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, TRUE);
137 137
 	}
138 138
 
139 139
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @return string
145 145
 	 */
146 146
 	public function column_cb($item) {
147
-		return sprintf( '<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID() );
147
+		return sprintf('<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID());
148 148
 	}
149 149
 
150 150
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 * @param \EE_Change_Log $item
171 171
 	 * @return string
172 172
 	 */
173
-	public function column_LOG_time(EE_Change_Log $item){
173
+	public function column_LOG_time(EE_Change_Log $item) {
174 174
 		return $item->get_datetime('LOG_time');
175 175
 	}
176 176
 
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 	 * @param \EE_Change_Log $item
182 182
 	 * @return string
183 183
 	 */
184
-	public function column_PMD_ID(EE_Change_Log $item){
185
-		if($item->object() instanceof EE_Payment_Method){
184
+	public function column_PMD_ID(EE_Change_Log $item) {
185
+		if ($item->object() instanceof EE_Payment_Method) {
186 186
 			return $item->object()->admin_name();
187
-		}elseif($item->object() instanceof EE_Payment && $item->object()->payment_method()){
187
+		}elseif ($item->object() instanceof EE_Payment && $item->object()->payment_method()) {
188 188
 			return $item->object()->payment_method()->admin_name();
189
-		}else{
189
+		} else {
190 190
 			return __("No longer exists", 'event_espresso');
191 191
 		}
192 192
 	}
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	 * @param \EE_Change_Log $item
199 199
 	 * @return string
200 200
 	 */
201
-	public function column_TXN_ID(EE_Change_Log $item){
202
-		if($item->object() instanceof EE_Payment){
203
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->object()->TXN_ID() )) {
204
-				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->object()->TXN_ID() ), TXN_ADMIN_URL );
205
-				return '<a href="'.$view_txn_lnk_url.'"  title="' . sprintf( esc_attr__( 'click to view transaction #%s', 'event_espresso' ),  $item->object()->TXN_ID() ) . '">' . sprintf( __( 'view txn %s', 'event_espresso' ),  $item->object()->TXN_ID() ) . '</a>';
201
+	public function column_TXN_ID(EE_Change_Log $item) {
202
+		if ($item->object() instanceof EE_Payment) {
203
+			if (EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->object()->TXN_ID())) {
204
+				$view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->object()->TXN_ID()), TXN_ADMIN_URL);
205
+				return '<a href="'.$view_txn_lnk_url.'"  title="'.sprintf(esc_attr__('click to view transaction #%s', 'event_espresso'), $item->object()->TXN_ID()).'">'.sprintf(__('view txn %s', 'event_espresso'), $item->object()->TXN_ID()).'</a>';
206 206
 			}
207 207
 		} else {
208 208
 			return __("Unable to find transaction", 'event_espresso');
Please login to merge, or discard this patch.
core/services/address/formatters/MultiLineAddressFormatter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\address\formatters;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 * @param string $CNT_ISO
29 29
 	 * @return string
30 30
 	 */
31
-	public function format( $address, $address2, $city, $state, $zip, $country, $CNT_ISO ) {
31
+	public function format($address, $address2, $city, $state, $zip, $country, $CNT_ISO) {
32 32
 		$address_formats = apply_filters(
33 33
 			'FHEE__EE_Inline_Address_Formatter__address_formats',
34 34
 			array(
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			)
40 40
 		);
41 41
 		// if the incoming country has a set format, use that, else use the default
42
-		$formatted_address = isset( $address_formats[ $CNT_ISO ] ) ? $address_formats[ $CNT_ISO ]
42
+		$formatted_address = isset($address_formats[$CNT_ISO]) ? $address_formats[$CNT_ISO]
43 43
 			: $address_formats['ZZZ'];
44 44
 		return $this->parse_formatted_address(
45 45
 			$address,
Please login to merge, or discard this patch.
core/EE_Deprecated.core.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	}
338 338
 
339 339
 	/**
340
-	 * @param $method_name
340
+	 * @param string $method_name
341 341
 	 */
342 342
 	public static function doing_it_wrong_call( $method_name ) {
343 343
 		EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0', E_USER_DEPRECATED );
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
 	/**
1152 1152
 	 * @deprecated 4.9.0
1153
-	 * @return array
1153
+	 * @return EE_messenger[]
1154 1154
 	 */
1155 1155
 	public function get_installed_messengers() {
1156 1156
 		// EE_messages has been deprecated
Please login to merge, or discard this patch.
Spacing   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  * ************************************************************************
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  * @param \EE_Checkout $checkout
32 32
  * @return string
33 33
  */
34
-function ee_deprecated__registration_checkout__button_text( $submit_button_text, EE_Checkout $checkout ) {
34
+function ee_deprecated__registration_checkout__button_text($submit_button_text, EE_Checkout $checkout) {
35 35
 	// list of old filters
36 36
 	$deprecated_filters = array(
37 37
 		'update_registration_details' => true,
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 		'proceed_to' => true,
42 42
 	);
43 43
 	// loop thru and call doing_it_wrong() or remove any that aren't being used
44
-	foreach ( $deprecated_filters as $deprecated_filter => $on ) {
44
+	foreach ($deprecated_filters as $deprecated_filter => $on) {
45 45
 		// was this filter called ?
46
-		if ( has_action( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter )) {
46
+		if (has_action('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter)) {
47 47
 			// only display doing_it_wrong() notice to Event Admins during non-AJAX requests
48
-			if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter' ) && ! defined( 'DOING_AJAX' ) ) {
48
+			if (EE_Registry::instance()->CAP->current_user_can('ee_read_ee', 'hide_doing_it_wrong_for_deprecated_SPCO_filter') && ! defined('DOING_AJAX')) {
49 49
 				EE_Error::doing_it_wrong(
50
-					'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter,
50
+					'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter,
51 51
 					sprintf(
52
-						__( 'The %1$s filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso' ),
53
-						'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__' . $deprecated_filter,
52
+						__('The %1$s filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new filter: %2$s"%3$s" found in "%4$s"', 'event_espresso'),
53
+						'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__'.$deprecated_filter,
54 54
 						'<br />',
55 55
 						'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text',
56 56
 						'/modules/single_page_checkout/inc/EE_SPCO_Reg_Step.class.php'
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
 				);
60 60
 			}
61 61
 		} else {
62
-			unset( $deprecated_filters[ $deprecated_filter ] );
62
+			unset($deprecated_filters[$deprecated_filter]);
63 63
 		}
64 64
 	}
65
-	if ( ! empty( $deprecated_filters )) {
66
-
67
-		if ( $checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset( $deprecated_filters[ 'update_registration_details' ] )) {
68
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text );
69
-		} else if ( $checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset( $deprecated_filters[ 'process_payment' ] ) ) {
70
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text );
71
-		} else if ( $checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset( $deprecated_filters[ 'finalize_registration' ] ) ) {
72
-			$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text );
65
+	if ( ! empty($deprecated_filters)) {
66
+
67
+		if ($checkout->current_step->slug() == 'attendee_information' && $checkout->revisit && isset($deprecated_filters['update_registration_details'])) {
68
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__update_registration_details', $submit_button_text);
69
+		} else if ($checkout->current_step->slug() == 'payment_options' && $checkout->revisit && isset($deprecated_filters['process_payment'])) {
70
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__process_payment', $submit_button_text);
71
+		} else if ($checkout->next_step instanceof EE_SPCO_Reg_Step && $checkout->next_step->slug() == 'finalize_registration' && isset($deprecated_filters['finalize_registration'])) {
72
+			$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', $submit_button_text);
73 73
 		}
74
-		if ( $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
75
-			if ( $checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset( $deprecated_filters[ 'and_proceed_to_payment' ] ) ) {
76
-				$submit_button_text .= apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text );
74
+		if ($checkout->next_step instanceof EE_SPCO_Reg_Step) {
75
+			if ($checkout->payment_required() && $checkout->next_step->slug() == 'payment_options' && isset($deprecated_filters['and_proceed_to_payment'])) {
76
+				$submit_button_text .= apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__and_proceed_to_payment', $submit_button_text);
77 77
 			}
78
-			if ( $checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset( $deprecated_filters[ 'proceed_to' ] ) ) {
79
-				$submit_button_text = apply_filters( 'FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text ) . $checkout->next_step->name();
78
+			if ($checkout->next_step->slug() != 'finalize_registration' && ! $checkout->revisit && isset($deprecated_filters['proceed_to'])) {
79
+				$submit_button_text = apply_filters('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__proceed_to', $submit_button_text).$checkout->next_step->name();
80 80
 			}
81 81
 		}
82 82
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	return $submit_button_text;
85 85
 
86 86
 }
87
-add_filter( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2 );
87
+add_filter('FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_deprecated__registration_checkout__button_text', 10, 2);
88 88
 
89 89
 
90 90
 
@@ -95,16 +95,16 @@  discard block
 block discarded – undo
95 95
  * @param \EE_Checkout $checkout
96 96
  * @param boolean $status_updates
97 97
  */
98
-function ee_deprecated_finalize_transaction( EE_Checkout $checkout, $status_updates ) {
98
+function ee_deprecated_finalize_transaction(EE_Checkout $checkout, $status_updates) {
99 99
 	$action_ref = NULL;
100
-	$action_ref = has_action( 'AHEE__EE_Transaction__finalize__new_transaction' ) ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref;
101
-	$action_ref = has_action( 'AHEE__EE_Transaction__finalize__all_transaction' ) ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref;
102
-	if ( $action_ref ) {
100
+	$action_ref = has_action('AHEE__EE_Transaction__finalize__new_transaction') ? 'AHEE__EE_Transaction__finalize__new_transaction' : $action_ref;
101
+	$action_ref = has_action('AHEE__EE_Transaction__finalize__all_transaction') ? 'AHEE__EE_Transaction__finalize__all_transaction' : $action_ref;
102
+	if ($action_ref) {
103 103
 
104 104
 		EE_Error::doing_it_wrong(
105 105
 			$action_ref,
106 106
 			sprintf(
107
-				__( 'This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso' ),
107
+				__('This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use one of the following new actions: %1$s"%3$s" found in "%2$s" %1$s"%4$s" found in "%2$s" %1$s"%5$s" found in "%2$s" %1$s"%6$s" found in "%2$s"', 'event_espresso'),
108 108
 				'<br />',
109 109
 				'/core/business/EE_Transaction_Processor.class.php',
110 110
 				'AHEE__EE_Transaction_Processor__finalize',
@@ -114,39 +114,39 @@  discard block
 block discarded – undo
114 114
 			),
115 115
 			'4.6.0'
116 116
 		);
117
-		switch ( $action_ref ) {
117
+		switch ($action_ref) {
118 118
 			case 'AHEE__EE_Transaction__finalize__new_transaction' :
119
-				do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request );
119
+				do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, $checkout->admin_request);
120 120
 				break;
121 121
 			case 'AHEE__EE_Transaction__finalize__all_transaction' :
122
-				do_action( 'AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array( 'new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates ), $checkout->admin_request );
122
+				do_action('AHEE__EE_Transaction__finalize__new_transaction', $checkout->transaction, array('new_reg' => ! $checkout->revisit, 'to_approved' => $status_updates), $checkout->admin_request);
123 123
 				break;
124 124
 		}
125 125
 	}
126 126
 }
127
-add_action( 'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2 );
127
+add_action('AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed', 'ee_deprecated_finalize_transaction', 10, 2);
128 128
 /**
129 129
  * ee_deprecated_finalize_registration
130 130
  *
131 131
  * @param EE_Registration $registration
132 132
  */
133
-function ee_deprecated_finalize_registration( EE_Registration $registration ) {
134
-	$action_ref = has_action( 'AHEE__EE_Registration__finalize__update_and_new_reg' ) ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL;
135
-	if ( $action_ref ) {
133
+function ee_deprecated_finalize_registration(EE_Registration $registration) {
134
+	$action_ref = has_action('AHEE__EE_Registration__finalize__update_and_new_reg') ? 'AHEE__EE_Registration__finalize__update_and_new_reg' : NULL;
135
+	if ($action_ref) {
136 136
 		EE_Error::doing_it_wrong(
137 137
 			$action_ref,
138 138
 			sprintf(
139
-				__( 'This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso' ),
139
+				__('This action is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the following new action: %1$s"%3$s" found in "%2$s"', 'event_espresso'),
140 140
 				'<br />',
141 141
 				'/core/business/EE_Registration_Processor.class.php',
142 142
 				'AHEE__EE_Registration_Processor__trigger_registration_status_changed_hook'
143 143
 			),
144 144
 			'4.6.0'
145 145
 		);
146
-		do_action( 'AHEE__EE_Registration__finalize__update_and_new_reg', $registration, ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX )));
146
+		do_action('AHEE__EE_Registration__finalize__update_and_new_reg', $registration, (is_admin() && ! (defined('DOING_AJAX') && DOING_AJAX)));
147 147
 	}
148 148
 }
149
-add_action( 'AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1 );
149
+add_action('AHEE__EE_Registration_Processor__trigger_registration_update_notifications', 'ee_deprecated_finalize_registration', 10, 1);
150 150
 
151 151
 
152 152
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
  *
168 168
  * @return array
169 169
  */
170
-function ee_deprecated_get_templates( $templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack ) {
170
+function ee_deprecated_get_templates($templates, EE_messenger $messenger, EE_message_type $message_type, EE_Messages_Template_Pack $template_pack) {
171 171
 	$old_default_classnames = array(
172 172
 		'EE_Messages_Email_Cancelled_Registration_Defaults',
173 173
 		'EE_Messages_Email_Declined_Registration_Defaults',
@@ -183,23 +183,23 @@  discard block
 block discarded – undo
183 183
 
184 184
 	$old_class_instance = new stdClass();
185 185
 
186
-	foreach ( $old_default_classnames as $classname ) {
187
-		$filter_ref = 'FHEE__' . $classname . '___create_new_templates___templates';
188
-		if ( has_filter( $filter_ref ) ) {
189
-			EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' );
186
+	foreach ($old_default_classnames as $classname) {
187
+		$filter_ref = 'FHEE__'.$classname.'___create_new_templates___templates';
188
+		if (has_filter($filter_ref)) {
189
+			EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Template_Pack___get_templates__templates" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0');
190 190
 		}
191
-		$templates = apply_filters( $filter_ref, $templates, $old_class_instance );
191
+		$templates = apply_filters($filter_ref, $templates, $old_class_instance);
192 192
 	}
193 193
 
194 194
 	return $templates;
195 195
 }
196
-add_filter( 'FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4 );
196
+add_filter('FHEE__EE_Template_Pack___get_templates__templates', 'ee_deprecated_get_templates', 10, 4);
197 197
 
198 198
 /**
199 199
  * Called after EED_Module::set_hooks() and EED_Module::set_admin_hooks() was called.
200 200
  * Checks if any deprecated hooks were hooked-into and provide doing_it_wrong messages appropriately.
201 201
  */
202
-function ee_deprecated_hooks(){
202
+function ee_deprecated_hooks() {
203 203
 	/**
204 204
 	 * @var $hooks array where keys are hook names, and their values are array{
205 205
 	 *			@type string $version  when deprecated
@@ -210,25 +210,25 @@  discard block
 block discarded – undo
210 210
 	$hooks = array(
211 211
 		'AHEE__EE_System___do_setup_validations' => array(
212 212
 			'version' => '4.6.0',
213
-			'alternative' => __( 'Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso' ),
213
+			'alternative' => __('Instead use "AHEE__EEH_Activation__validate_messages_system" which is called after validating messages (done on every new install, upgrade, reactivation, and downgrade)', 'event_espresso'),
214 214
 			'still_works' => FALSE
215 215
 		)
216 216
 	);
217
-	foreach( $hooks as $name => $deprecation_info ){
218
-		if( has_action( $name ) ){
217
+	foreach ($hooks as $name => $deprecation_info) {
218
+		if (has_action($name)) {
219 219
 			EE_Error::doing_it_wrong(
220 220
 				$name,
221 221
 				sprintf(
222
-					__('This filter is deprecated. %1$s%2$s','event_espresso'),
223
-					$deprecation_info[ 'still_works' ] ?  __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __( 'It has been completely removed.', 'event_espresso' ),
224
-					isset( $deprecation_info[ 'alternative' ] ) ? $deprecation_info[ 'alternative' ] : __( 'Please read the current EE4 documentation further or contact Support.', 'event_espresso' )
222
+					__('This filter is deprecated. %1$s%2$s', 'event_espresso'),
223
+					$deprecation_info['still_works'] ? __('It *may* work as an attempt to build in backwards compatibility.', 'event_espresso') : __('It has been completely removed.', 'event_espresso'),
224
+					isset($deprecation_info['alternative']) ? $deprecation_info['alternative'] : __('Please read the current EE4 documentation further or contact Support.', 'event_espresso')
225 225
 				),
226
-				isset( $deprecation_info[ 'version' ] ) ? $deprecation_info[ 'version' ] : __( 'recently', 'event_espresso' )
226
+				isset($deprecation_info['version']) ? $deprecation_info['version'] : __('recently', 'event_espresso')
227 227
 			);
228 228
 		}
229 229
 	}
230 230
 }
231
-add_action( 'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks' );
231
+add_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons', 'ee_deprecated_hooks');
232 232
 
233 233
 
234 234
 
@@ -251,25 +251,25 @@  discard block
 block discarded – undo
251 251
  *
252 252
  * @return string                    The default contents for the messenger, message type, context and field.
253 253
  */
254
-function ee_deprecated_get_default_field_content( $contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack ) {
254
+function ee_deprecated_get_default_field_content($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack) {
255 255
 
256 256
 	$classnames_to_try = array(
257
-		get_class( $messenger ) => $messenger,
258
-		get_class( $message_type ) => $message_type,
257
+		get_class($messenger) => $messenger,
258
+		get_class($message_type) => $message_type,
259 259
 		'EE_Messages_Base' => $message_type
260 260
 		);
261 261
 
262
-	foreach ( $classnames_to_try as $classname => $obj ) {
263
-		$filter_ref = 'FHEE__' . $classname . '__get_default_field_content';
264
-		if ( has_filter( $filter_ref ) ) {
265
-			EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' );
262
+	foreach ($classnames_to_try as $classname => $obj) {
263
+		$filter_ref = 'FHEE__'.$classname.'__get_default_field_content';
264
+		if (has_filter($filter_ref)) {
265
+			EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It *may* work as an attempt to build in backwards compatibility.  However, it is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_specific_template__contents" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0');
266 266
 		}
267
-		$contents = apply_filters( $filter_ref, $contents, $obj );
267
+		$contents = apply_filters($filter_ref, $contents, $obj);
268 268
 	}
269 269
 
270 270
 	return $contents;
271 271
 }
272
-add_filter( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7 );
272
+add_filter('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', 'ee_deprecated_get_default_field_content', 10, 7);
273 273
 
274 274
 
275 275
 
@@ -297,23 +297,23 @@  discard block
 block discarded – undo
297 297
  *
298 298
  * @return string                    The path to the file being used.
299 299
  */
300
-function ee_deprecated_get_inline_css_template_filters( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url,  EE_Messages_Template_Pack $template_pack ) {
300
+function ee_deprecated_get_inline_css_template_filters($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) {
301 301
 
302
-	if ( $messenger == 'email' ) {
302
+	if ($messenger == 'email') {
303 303
 		$filter_ref = $url ? 'FHEE__EE_Email_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Email_messenger__get_inline_css_template__css_path';
304
-	} elseif ( $messenger == 'html' ) {
304
+	} elseif ($messenger == 'html') {
305 305
 		$filter_ref = $url ? 'FHEE__EE_Html_messenger__get_inline_css_template__css_url' : 'FHEE__EE_Html_messenger__get_inline_css_template__css_path';
306 306
 	} else {
307 307
 		return $variation_path;
308 308
 	}
309 309
 
310
-	if ( has_filter( $filter_ref ) ) {
311
-		EE_Error::doing_it_wrong( $filter_ref, __('This filter is deprecated.  It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0' );
310
+	if (has_filter($filter_ref)) {
311
+		EE_Error::doing_it_wrong($filter_ref, __('This filter is deprecated.  It is recommended to use the new filter provided which is "FHEE__EE_Messages_Template_Pack__get_variation" found in the EE_Messages_Template_Pack class.', 'event_espresso'), '4.5.0');
312 312
 	}
313 313
 
314
-	return apply_filters( $filter_ref, $variation_path, $url, $type );
314
+	return apply_filters($filter_ref, $variation_path, $url, $type);
315 315
 }
316
-add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8 );
316
+add_filter('FHEE__EE_Messages_Template_Pack__get_variation', 'ee_deprecated_get_inline_css_template_filters', 10, 8);
317 317
 
318 318
 
319 319
 
@@ -329,78 +329,78 @@  discard block
 block discarded – undo
329 329
 class EE_Messages_Init extends EE_Base {
330 330
 
331 331
 	public function __construct() {
332
-		self::doing_it_wrong_call( __METHOD__ );
332
+		self::doing_it_wrong_call(__METHOD__);
333 333
 	}
334 334
 
335 335
 	/**
336 336
 	 * @param $method_name
337 337
 	 */
338
-	public static function doing_it_wrong_call( $method_name ) {
339
-		EE_Error::doing_it_wrong( __CLASS__, sprintf( __('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name ), '4.5.0' );
338
+	public static function doing_it_wrong_call($method_name) {
339
+		EE_Error::doing_it_wrong(__CLASS__, sprintf(__('The %s in this class is deprecated as of EE4.5.0.  All functionality formerly in this class is now in the EED_Messages module.', 'event_espresso'), $method_name), '4.5.0');
340 340
 	}
341 341
 
342 342
 	/**
343 343
 	 * @deprecated 4.5.0
344 344
 	 */
345 345
 	public static function set_autoloaders() {
346
-		self::doing_it_wrong_call( __METHOD__ );
346
+		self::doing_it_wrong_call(__METHOD__);
347 347
 		EED_Messages::set_autoloaders();
348 348
 	}
349 349
 
350 350
 	/**
351 351
 	 * @deprecated 4.5.0
352 352
 	 */
353
-	public function payment_reminder( $transaction ) {
354
-		self::doing_it_wrong_call( __METHOD__ );
355
-		EED_Messages::payment_reminder( $transaction );
353
+	public function payment_reminder($transaction) {
354
+		self::doing_it_wrong_call(__METHOD__);
355
+		EED_Messages::payment_reminder($transaction);
356 356
 	}
357 357
 
358 358
 	/**
359 359
 	 * @deprecated 4.5.0
360 360
 	 */
361
-	public function payment( $transaction, $payment ) {
362
-		self::doing_it_wrong_call( __METHOD__ );
363
-		EED_Messages::payment( $transaction, $payment );
361
+	public function payment($transaction, $payment) {
362
+		self::doing_it_wrong_call(__METHOD__);
363
+		EED_Messages::payment($transaction, $payment);
364 364
 	}
365 365
 
366 366
 	/**
367 367
 	 * @deprecated 4.5.0
368 368
 	 */
369
-	public function cancelled_registration( $transaction ) {
370
-		self::doing_it_wrong_call( __METHOD__ );
371
-		EED_Messages::cancelled_registration( $transaction );
369
+	public function cancelled_registration($transaction) {
370
+		self::doing_it_wrong_call(__METHOD__);
371
+		EED_Messages::cancelled_registration($transaction);
372 372
 	}
373 373
 
374 374
 	/**
375 375
 	 * @deprecated 4.5.0
376 376
 	 */
377
-	public function maybe_registration( $transaction, $reg_msg, $from_admin ) {
378
-		self::doing_it_wrong_call( __METHOD__ );
379
-		EED_Messages::maybe_registration( $transaction, $reg_msg, $from_admin );
377
+	public function maybe_registration($transaction, $reg_msg, $from_admin) {
378
+		self::doing_it_wrong_call(__METHOD__);
379
+		EED_Messages::maybe_registration($transaction, $reg_msg, $from_admin);
380 380
 	}
381 381
 
382 382
 	/**
383 383
 	 * @deprecated 4.5.0
384 384
 	 */
385
-	public function process_resend( $success, $req_data ) {
386
-		self::doing_it_wrong_call( __METHOD__ );
387
-		EED_Messages::process_resend( $req_data );
385
+	public function process_resend($success, $req_data) {
386
+		self::doing_it_wrong_call(__METHOD__);
387
+		EED_Messages::process_resend($req_data);
388 388
 	}
389 389
 
390 390
 	/**
391 391
 	 * @deprecated 4.5.0
392 392
 	 */
393
-	public function process_admin_payment( $success, $payment ) {
394
-		self::doing_it_wrong_call( __METHOD__ );
395
-		EED_Messages::process_admin_payment( $payment );
393
+	public function process_admin_payment($success, $payment) {
394
+		self::doing_it_wrong_call(__METHOD__);
395
+		EED_Messages::process_admin_payment($payment);
396 396
 	}
397 397
 
398 398
 	/**
399 399
 	 * @deprecated 4.5.0
400 400
 	 */
401
-	public function send_newsletter_message( $contacts, $grp_id ) {
402
-		self::doing_it_wrong_call( __METHOD__ );
403
-		EED_Messages::send_newsletter_message( $contacts, $grp_id );
401
+	public function send_newsletter_message($contacts, $grp_id) {
402
+		self::doing_it_wrong_call(__METHOD__);
403
+		EED_Messages::send_newsletter_message($contacts, $grp_id);
404 404
 	}
405 405
 
406 406
 
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
  *
422 422
  * @return array additional cpts.
423 423
  */
424
-function ee_deprecated_get_cpts( $cpts ) {
425
-	if ( has_filter( 'FHEE__EE_Register_CPTs__construct__CPTs' ) ) {
426
-		EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0' );
424
+function ee_deprecated_get_cpts($cpts) {
425
+	if (has_filter('FHEE__EE_Register_CPTs__construct__CPTs')) {
426
+		EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__CPTs', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_CPTs__cpts" found in EE_Register_CPTs::get_CPTs()', 'event_espresso'), '4.5.0');
427 427
 	}
428
-	return apply_filters( 'FHEE__EE_Register_CPTs__construct__CPTs', $cpts );
428
+	return apply_filters('FHEE__EE_Register_CPTs__construct__CPTs', $cpts);
429 429
 }
430
-add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10 );
430
+add_filter('FHEE__EE_Register_CPTs__get_CPTs__cpts', 'ee_deprecated_get_cpts', 10);
431 431
 
432 432
 
433 433
 
@@ -441,13 +441,13 @@  discard block
 block discarded – undo
441 441
  *
442 442
  * @return array additional custom taxonomies.
443 443
  */
444
-function ee_deprecated_get_taxonomies( $cts ) {
445
-	if ( has_filter( 'FHEE__EE_Register_CPTs__construct__taxonomies' ) ) {
446
-		EE_Error::doing_it_wrong( 'FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0' );
444
+function ee_deprecated_get_taxonomies($cts) {
445
+	if (has_filter('FHEE__EE_Register_CPTs__construct__taxonomies')) {
446
+		EE_Error::doing_it_wrong('FHEE__EE_Register_CPTs__construct__taxonomies', __('This filter is deprecated. It will still work for the time being.  However, it is recommended to use the new filter provided which is "FHEE__EE_Register_CPTs__get_taxonomies__taxonomies" found in EE_Register_CPTs::get_taxonomies()', 'event_espresso'), '4.5.0');
447 447
 	}
448
-	return apply_filters( 'FHEE__EE_Register_CPTs__construct__taxonomies', $cts );
448
+	return apply_filters('FHEE__EE_Register_CPTs__construct__taxonomies', $cts);
449 449
 }
450
-add_filter( 'FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10 );
450
+add_filter('FHEE__EE_Register_CPTs__get_taxonomies__taxonomies', 'ee_deprecated_get_taxonomies', 10);
451 451
 
452 452
 
453 453
 
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
  * @return boolean
460 460
  */
461 461
 function ee_deprecated_using_old_registration_admin_custom_questions_form_hooks() {
462
-	$in_use =  has_filter( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns' )
463
-			|| has_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save' );
464
-	if( $in_use ) {
462
+	$in_use = has_filter('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns')
463
+			|| has_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save');
464
+	if ($in_use) {
465 465
 		$msg = __(
466 466
 			'We detected you are using the filter FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns or AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save.'
467 467
 			. 'Both of these have been deprecated and should not be used anymore. You should instead use FHEE__EE_Form_Section_Proper___construct__options_array to customize the contents of the form,'
@@ -470,18 +470,18 @@  discard block
 block discarded – undo
470 470
 			'event_espresso' )
471 471
 		;
472 472
 		EE_Error::doing_it_wrong(
473
-			__CLASS__ . '::' . __FUNCTION__,
473
+			__CLASS__.'::'.__FUNCTION__,
474 474
 			$msg,
475 475
 			'4.8.32.rc.000'
476 476
 		);
477 477
 		//it seems the doing_it_wrong messages get output during some hidden html tags, so add an error to make sure this gets noticed
478
-		if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
479
-			EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
478
+		if (is_admin() && ! defined('DOING_AJAX')) {
479
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
480 480
 		}
481 481
 	}
482 482
 	return $in_use;
483 483
 }
484
-add_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks' );
484
+add_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', 'ee_deprecated_using_old_registration_admin_custom_questions_form_hooks');
485 485
 
486 486
 /**
487 487
  * @deprecated since 4.8.32.rc.000 because it has issues on https://events.codebasehq.com/projects/event-espresso/tickets/9165
@@ -490,34 +490,34 @@  discard block
 block discarded – undo
490 490
  * @param EE_Admin_Page $admin_page
491 491
  * @return void
492 492
  */
493
-function ee_deprecated_update_attendee_registration_form_old( $admin_page ) {
493
+function ee_deprecated_update_attendee_registration_form_old($admin_page) {
494 494
 	//check if the old hooks are in use. If not, do the default
495
-	if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks()
496
-		|| ! $admin_page instanceof EE_Admin_Page ) {
495
+	if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks()
496
+		|| ! $admin_page instanceof EE_Admin_Page) {
497 497
 		return;
498 498
 	}
499 499
 	$req_data = $admin_page->get_request_data();
500
-	$qstns = isset( $req_data['qstn'] ) ? $req_data['qstn'] : FALSE;
501
-	$REG_ID = isset( $req_data['_REG_ID'] ) ? absint( $req_data['_REG_ID'] ) : FALSE;
502
-	$qstns = apply_filters( 'FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns );
503
-	if ( ! $REG_ID || ! $qstns ) {
504
-		EE_Error::add_error( __('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
500
+	$qstns = isset($req_data['qstn']) ? $req_data['qstn'] : FALSE;
501
+	$REG_ID = isset($req_data['_REG_ID']) ? absint($req_data['_REG_ID']) : FALSE;
502
+	$qstns = apply_filters('FHEE__Registrations_Admin_Page___update_attendee_registration_form__qstns', $qstns);
503
+	if ( ! $REG_ID || ! $qstns) {
504
+		EE_Error::add_error(__('An error occurred. No registration ID and/or registration questions were received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
505 505
 	}
506 506
 	$success = TRUE;
507 507
 
508 508
 	// allow others to get in on this awesome fun   :D
509
-	do_action( 'AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns );
509
+	do_action('AHEE__Registrations_Admin_Page___save_attendee_registration_form__after_reg_and_attendee_save', $REG_ID, $qstns);
510 510
 	// loop thru questions... FINALLY!!!
511 511
 
512
-	foreach ( $qstns as $QST_ID => $qstn ) {
512
+	foreach ($qstns as $QST_ID => $qstn) {
513 513
 		//if $qstn isn't an array then it doesn't already have an answer, so let's create the answer
514
-		if ( !is_array($qstn) ) {
515
-			$success = $this->_save_new_answer( $REG_ID, $QST_ID, $qstn);
514
+		if ( ! is_array($qstn)) {
515
+			$success = $this->_save_new_answer($REG_ID, $QST_ID, $qstn);
516 516
 			continue;
517 517
 		}
518 518
 
519 519
 
520
-		foreach ( $qstn as $ANS_ID => $ANS_value ) {
520
+		foreach ($qstn as $ANS_ID => $ANS_value) {
521 521
 			//get answer
522 522
 			$query_params = array(
523 523
 				0 => array(
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 				);
529 529
 			$answer = EEM_Answer::instance()->get_one($query_params);
530 530
 			//this MAY be an array but NOT have an answer because its multi select.  If so then we need to create the answer
531
-			if ( ! $answer instanceof EE_Answer ) {
531
+			if ( ! $answer instanceof EE_Answer) {
532 532
 				$set_values = array(
533 533
 					'QST_ID' => $QST_ID,
534 534
 					'REG_ID' => $REG_ID,
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
 		}
544 544
 	}
545 545
 	$what = __('Registration Form', 'event_espresso');
546
-	$route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' );
547
-	$admin_page->redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route );
546
+	$route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default');
547
+	$admin_page->redirect_after_action($success, $what, __('updated', 'event_espresso'), $route);
548 548
 	exit;
549 549
 }
550
-add_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1 );
550
+add_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', 'ee_deprecated_update_attendee_registration_form_old', 10, 1);
551 551
 /**
552 552
  * Render the registration admin page's custom questions area in the old fashion
553 553
  * and firing the old hooks. When this method is removed, we can probably also
@@ -560,31 +560,31 @@  discard block
 block discarded – undo
560 560
  * @return bool
561 561
  * @throws \EE_Error
562 562
  */
563
-function ee_deprecated_reg_questions_meta_box_old( $do_default_action, $admin_page, $registration ) {
563
+function ee_deprecated_reg_questions_meta_box_old($do_default_action, $admin_page, $registration) {
564 564
 	//check if the old hooks are in use. If not, do the default
565
-	if( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks()
566
-		|| ! $admin_page instanceof EE_Admin_Page ) {
565
+	if ( ! ee_deprecated_using_old_registration_admin_custom_questions_form_hooks()
566
+		|| ! $admin_page instanceof EE_Admin_Page) {
567 567
 		return $do_default_action;
568 568
 	}
569
-	add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array( $admin_page, 'form_before_question_group' ), 10, 1 );
570
-	add_filter( 'FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array( $admin_page, 'form_after_question_group' ), 10, 1 );
571
-	add_filter( 'FHEE__EEH_Form_Fields__label_html', array( $admin_page, 'form_form_field_label_wrap' ), 10, 1 );
572
-	add_filter( 'FHEE__EEH_Form_Fields__input_html', array( $admin_page, 'form_form_field_input__wrap' ), 10, 1 );
569
+	add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__before_question_group_questions', array($admin_page, 'form_before_question_group'), 10, 1);
570
+	add_filter('FHEE__EEH_Form_Fields__generate_question_groups_html__after_question_group_questions', array($admin_page, 'form_after_question_group'), 10, 1);
571
+	add_filter('FHEE__EEH_Form_Fields__label_html', array($admin_page, 'form_form_field_label_wrap'), 10, 1);
572
+	add_filter('FHEE__EEH_Form_Fields__input_html', array($admin_page, 'form_form_field_input__wrap'), 10, 1);
573 573
 
574
-	$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options( $registration, $registration->get('EVT_ID') );
574
+	$question_groups = EEM_Event::instance()->assemble_array_of_groups_questions_and_options($registration, $registration->get('EVT_ID'));
575 575
 
576
-	EE_Registry::instance()->load_helper( 'Form_Fields' );
576
+	EE_Registry::instance()->load_helper('Form_Fields');
577 577
 	$template_args = array(
578
-		'att_questions' => EEH_Form_Fields::generate_question_groups_html( $question_groups ),
578
+		'att_questions' => EEH_Form_Fields::generate_question_groups_html($question_groups),
579 579
 		'reg_questions_form_action' => 'edit_registration',
580 580
 		'REG_ID' => $registration->ID()
581 581
 	);
582
-	$template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php';
583
-	echo EEH_Template::display_template( $template_path, $template_args, TRUE );
582
+	$template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php';
583
+	echo EEH_Template::display_template($template_path, $template_args, TRUE);
584 584
 	//indicate that we should not do the default admin page code
585 585
 	return false;
586 586
 }
587
-add_action( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3 );
587
+add_action('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', 'ee_deprecated_reg_questions_meta_box_old', 10, 3);
588 588
 
589 589
 
590 590
 
@@ -625,9 +625,9 @@  discard block
 block discarded – undo
625 625
 			'4.9.0'
626 626
 		);
627 627
 		/** @var EE_Message_Resource_Manager $message_resource_manager */
628
-		$message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
629
-		$messenger = $message_resource_manager->get_messenger( $messenger_name );
630
-		$message_type = $message_resource_manager->get_message_type( $message_type_name );
628
+		$message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
629
+		$messenger = $message_resource_manager->get_messenger($messenger_name);
630
+		$message_type = $message_resource_manager->get_message_type($message_type_name);
631 631
 		return EE_Registry::instance()->load_lib(
632 632
 			'Messages_Template_Defaults',
633 633
 			array(
@@ -692,15 +692,15 @@  discard block
 block discarded – undo
692 692
 	/**
693 693
 	 * @param string $method
694 694
 	 */
695
-	public function _class_is_deprecated( $method ) {
695
+	public function _class_is_deprecated($method) {
696 696
 		EE_Error::doing_it_wrong(
697
-			'EE_messages::' . $method,
698
-			__( 'EE_messages has been deprecated.  Please use EE_Message_Resource_Manager instead.' ),
697
+			'EE_messages::'.$method,
698
+			__('EE_messages has been deprecated.  Please use EE_Message_Resource_Manager instead.'),
699 699
 			'4.9.0',
700 700
 			'4.10.0.p'
701 701
 		);
702 702
 		// Please use EE_Message_Resource_Manager instead
703
-		$this->_message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
703
+		$this->_message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
704 704
 	}
705 705
 
706 706
 
@@ -710,10 +710,10 @@  discard block
 block discarded – undo
710 710
 	 * @param string $messenger_name
711 711
 	 * @return boolean TRUE if it was PREVIOUSLY active, and FALSE if it was previously inactive
712 712
 	 */
713
-	public function ensure_messenger_is_active( $messenger_name ) {
713
+	public function ensure_messenger_is_active($messenger_name) {
714 714
 		// EE_messages has been deprecated
715
-		$this->_class_is_deprecated( __FUNCTION__ );
716
-		return $this->_message_resource_manager->ensure_messenger_is_active( $messenger_name );
715
+		$this->_class_is_deprecated(__FUNCTION__);
716
+		return $this->_message_resource_manager->ensure_messenger_is_active($messenger_name);
717 717
 	}
718 718
 
719 719
 
@@ -725,10 +725,10 @@  discard block
 block discarded – undo
725 725
 	 * @return bool true if it got activated (or was active) and false if not.
726 726
 	 * @throws \EE_Error
727 727
 	 */
728
-	public function ensure_message_type_is_active( $message_type, $messenger ) {
728
+	public function ensure_message_type_is_active($message_type, $messenger) {
729 729
 		// EE_messages has been deprecated
730
-		$this->_class_is_deprecated( __FUNCTION__ );
731
-		return $this->_message_resource_manager->ensure_message_type_is_active( $message_type, $messenger );
730
+		$this->_class_is_deprecated(__FUNCTION__);
731
+		return $this->_message_resource_manager->ensure_message_type_is_active($message_type, $messenger);
732 732
 	}
733 733
 
734 734
 
@@ -741,10 +741,10 @@  discard block
 block discarded – undo
741 741
 	 *                                            they are already setup.)
742 742
 	 * @return boolean an array of generated templates or false if nothing generated/activated.
743 743
 	 */
744
-	public function activate_messenger( $messenger_name, $mts_to_activate = array() ) {
744
+	public function activate_messenger($messenger_name, $mts_to_activate = array()) {
745 745
 		// EE_messages has been deprecated
746
-		$this->_class_is_deprecated( __FUNCTION__ );
747
-		return $this->_message_resource_manager->activate_messenger( $messenger_name, $mts_to_activate );
746
+		$this->_class_is_deprecated(__FUNCTION__);
747
+		return $this->_message_resource_manager->activate_messenger($messenger_name, $mts_to_activate);
748 748
 	}
749 749
 
750 750
 
@@ -756,10 +756,10 @@  discard block
 block discarded – undo
756 756
 	 *
757 757
 	 * @return bool true is a generating messenger and can be sent OR FALSE meaning cannot send.
758 758
 	 */
759
-	public function is_generating_messenger_and_active( EE_messenger $messenger, EE_message_type $message_type ) {
759
+	public function is_generating_messenger_and_active(EE_messenger $messenger, EE_message_type $message_type) {
760 760
 		// EE_messages has been deprecated
761
-		$this->_class_is_deprecated( __FUNCTION__ );
762
-		return $this->_message_resource_manager->is_generating_messenger_and_active( $messenger, $message_type );
761
+		$this->_class_is_deprecated(__FUNCTION__);
762
+		return $this->_message_resource_manager->is_generating_messenger_and_active($messenger, $message_type);
763 763
 	}
764 764
 
765 765
 
@@ -769,10 +769,10 @@  discard block
 block discarded – undo
769 769
 	 * @param string $messenger
770 770
 	 * @return EE_messenger | null
771 771
 	 */
772
-	public function get_messenger_if_active( $messenger ) {
772
+	public function get_messenger_if_active($messenger) {
773 773
 		// EE_messages has been deprecated
774
-		$this->_class_is_deprecated( __FUNCTION__ );
775
-		return $this->_message_resource_manager->get_active_messenger( $messenger );
774
+		$this->_class_is_deprecated(__FUNCTION__);
775
+		return $this->_message_resource_manager->get_active_messenger($messenger);
776 776
 	}
777 777
 
778 778
 
@@ -793,9 +793,9 @@  discard block
 block discarded – undo
793 793
 	 *                  'message_type' => null
794 794
 	 *                  )
795 795
 	 */
796
-	public function validate_for_use( EE_Message $message ) {
796
+	public function validate_for_use(EE_Message $message) {
797 797
 		// EE_messages has been deprecated
798
-		$this->_class_is_deprecated( __FUNCTION__ );
798
+		$this->_class_is_deprecated(__FUNCTION__);
799 799
 		return array(
800 800
 			'messenger'    => $message->messenger_object(),
801 801
 			'message_type' => $message->message_type_object(),
@@ -823,41 +823,41 @@  discard block
 block discarded – undo
823 823
 		$send = true
824 824
 	) {
825 825
 		// EE_messages has been deprecated
826
-		$this->_class_is_deprecated( __FUNCTION__ );
826
+		$this->_class_is_deprecated(__FUNCTION__);
827 827
 		/** @type EE_Messages_Processor $processor */
828
-		$processor = EE_Registry::instance()->load_lib( 'Messages_Processor' );
828
+		$processor = EE_Registry::instance()->load_lib('Messages_Processor');
829 829
 		$error = false;
830 830
 		//try to intelligently determine what method we'll call based on the incoming data.
831 831
 		//if generating and sending are different then generate and send immediately.
832
-		if ( ! empty( $sending_messenger ) && $sending_messenger != $generating_messenger && $send ) {
832
+		if ( ! empty($sending_messenger) && $sending_messenger != $generating_messenger && $send) {
833 833
 			//in the legacy system, when generating and sending were different, that means all the
834 834
 			//vars are already in the request object.  So let's just use that.
835 835
 			try {
836 836
 				/** @type EE_Message_To_Generate_From_Request $mtg */
837
-				$mtg = EE_Registry::instance()->load_lib( 'Message_To_Generate_From_Request' );
838
-				$processor->generate_and_send_now( $mtg );
839
-			} catch ( EE_Error $e ) {
837
+				$mtg = EE_Registry::instance()->load_lib('Message_To_Generate_From_Request');
838
+				$processor->generate_and_send_now($mtg);
839
+			} catch (EE_Error $e) {
840 840
 				$error_msg = __(
841 841
 					'Please note that a system message failed to send due to a technical issue.',
842 842
 					'event_espresso'
843 843
 				);
844 844
 				// add specific message for developers if WP_DEBUG in on
845
-				$error_msg .= '||' . $e->getMessage();
846
-				EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ );
845
+				$error_msg .= '||'.$e->getMessage();
846
+				EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__);
847 847
 				$error = true;
848 848
 			}
849 849
 		} else {
850
-			$processor->generate_for_all_active_messengers( $type, $vars, $send );
850
+			$processor->generate_for_all_active_messengers($type, $vars, $send);
851 851
 			//let's find out if there were any errors and how many successfully were queued.
852 852
 			$count_errors = $processor->get_queue()->count_STS_in_queue(
853
-				array( EEM_Message::status_failed, EEM_Message::status_debug_only )
853
+				array(EEM_Message::status_failed, EEM_Message::status_debug_only)
854 854
 			);
855
-			$count_queued = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_incomplete );
856
-			$count_retry = $processor->get_queue()->count_STS_in_queue( EEM_Message::status_retry );
855
+			$count_queued = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_incomplete);
856
+			$count_retry = $processor->get_queue()->count_STS_in_queue(EEM_Message::status_retry);
857 857
 			$count_errors = $count_errors + $count_retry;
858
-			if ( $count_errors > 0 ) {
858
+			if ($count_errors > 0) {
859 859
 				$error = true;
860
-				if ( $count_errors > 1 && $count_retry > 1 && $count_queued > 1 ) {
860
+				if ($count_errors > 1 && $count_retry > 1 && $count_queued > 1) {
861 861
 					$message = sprintf(
862 862
 						__(
863 863
 							'There were %d errors and %d messages successfully queued for generation and sending',
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 						$count_errors,
867 867
 						$count_queued
868 868
 					);
869
-				} elseif ( $count_errors > 1 && $count_queued === 1 ) {
869
+				} elseif ($count_errors > 1 && $count_queued === 1) {
870 870
 					$message = sprintf(
871 871
 						__(
872 872
 							'There were %d errors and %d message successfully queued for generation.',
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 						$count_errors,
876 876
 						$count_queued
877 877
 					);
878
-				} elseif ( $count_errors === 1 && $count_queued > 1 ) {
878
+				} elseif ($count_errors === 1 && $count_queued > 1) {
879 879
 					$message = sprintf(
880 880
 						__(
881 881
 							'There was %d error and %d messages successfully queued for generation.',
@@ -893,9 +893,9 @@  discard block
 block discarded – undo
893 893
 						$count_errors
894 894
 					);
895 895
 				}
896
-				EE_Error::add_error( $message, __FILE__, __FUNCTION__, __LINE__ );
896
+				EE_Error::add_error($message, __FILE__, __FUNCTION__, __LINE__);
897 897
 			} else {
898
-				if ( $count_queued === 1 ) {
898
+				if ($count_queued === 1) {
899 899
 					$message = sprintf(
900 900
 						__(
901 901
 							'%d message successfully queued for generation.',
@@ -912,18 +912,18 @@  discard block
 block discarded – undo
912 912
 						$count_queued
913 913
 					);
914 914
 				}
915
-				EE_Error::add_success( $message );
915
+				EE_Error::add_success($message);
916 916
 			}
917 917
 		}
918 918
 		//if no error then return the generated message(s).
919
-		if ( ! $error && ! $send ) {
920
-			$generated_queue = $processor->generate_queue( false );
919
+		if ( ! $error && ! $send) {
920
+			$generated_queue = $processor->generate_queue(false);
921 921
 			//get message and return.
922 922
 			$generated_queue->get_message_repository()->rewind();
923 923
 			$messages = array();
924
-			while ( $generated_queue->get_message_repository()->valid() ) {
924
+			while ($generated_queue->get_message_repository()->valid()) {
925 925
 				$message = $generated_queue->get_message_repository()->current();
926
-				if ( $message instanceof EE_Message ) {
926
+				if ($message instanceof EE_Message) {
927 927
 					//set properties that might be expected by add-ons (backward compat)
928 928
 					$message->content = $message->content();
929 929
 					$message->template_pack = $message->get_template_pack();
@@ -948,10 +948,10 @@  discard block
 block discarded – undo
948 948
 	 * @param bool    $send      true we will do a test send using the messenger delivery, false we just do a regular preview
949 949
 	 * @return string          The body of the message.
950 950
 	 */
951
-	public function preview_message( $type, $context, $messenger, $send = false ) {
951
+	public function preview_message($type, $context, $messenger, $send = false) {
952 952
 		// EE_messages has been deprecated
953
-		$this->_class_is_deprecated( __FUNCTION__ );
954
-		return EED_Messages::preview_message( $type, $context, $messenger, $send );
953
+		$this->_class_is_deprecated(__FUNCTION__);
954
+		return EED_Messages::preview_message($type, $context, $messenger, $send);
955 955
 	}
956 956
 
957 957
 
@@ -965,14 +965,14 @@  discard block
 block discarded – undo
965 965
 	 *
966 966
 	 * @return bool          success or fail.
967 967
 	 */
968
-	public function send_message_with_messenger_only( $messenger, $message_type, $message ) {
968
+	public function send_message_with_messenger_only($messenger, $message_type, $message) {
969 969
 		// EE_messages has been deprecated
970
-		$this->_class_is_deprecated( __FUNCTION__ );
970
+		$this->_class_is_deprecated(__FUNCTION__);
971 971
 		//setup for sending to new method.
972 972
 		/** @type EE_Messages_Queue $queue */
973
-		$queue = EE_Registry::instance()->load_lib( 'Messages_Queue' );
973
+		$queue = EE_Registry::instance()->load_lib('Messages_Queue');
974 974
 		//make sure we have a proper message object
975
-		if ( ! $message instanceof EE_Message && is_object( $message ) && isset( $message->content ) ) {
975
+		if ( ! $message instanceof EE_Message && is_object($message) && isset($message->content)) {
976 976
 			$msg = EE_Message_Factory::create(
977 977
 				array(
978 978
 					'MSG_messenger'    => $messenger,
@@ -984,15 +984,15 @@  discard block
 block discarded – undo
984 984
 		} else {
985 985
 			$msg = $message;
986 986
 		}
987
-		if ( ! $msg instanceof EE_Message ) {
987
+		if ( ! $msg instanceof EE_Message) {
988 988
 			return false;
989 989
 		}
990 990
 		//make sure any content in a content property (if not empty) is set on the MSG_content.
991
-		if ( ! empty( $msg->content ) ) {
992
-			$msg->set( 'MSG_content', $msg->content );
991
+		if ( ! empty($msg->content)) {
992
+			$msg->set('MSG_content', $msg->content);
993 993
 		}
994
-		$queue->add( $msg );
995
-		return EED_Messages::send_message_with_messenger_only( $messenger, $message_type, $queue );
994
+		$queue->add($msg);
995
+		return EED_Messages::send_message_with_messenger_only($messenger, $message_type, $queue);
996 996
 	}
997 997
 
998 998
 
@@ -1006,11 +1006,11 @@  discard block
 block discarded – undo
1006 1006
 	 * @return array|object if creation is successful then we return an array of info, otherwise an error_object is returned.
1007 1007
 	 * @throws \EE_Error
1008 1008
 	 */
1009
-	public function create_new_templates( $messenger, $message_type, $GRP_ID = 0, $is_global = false ) {
1009
+	public function create_new_templates($messenger, $message_type, $GRP_ID = 0, $is_global = false) {
1010 1010
 		// EE_messages has been deprecated
1011
-		$this->_class_is_deprecated( __FUNCTION__ );
1012
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
1013
-		return EEH_MSG_Template::create_new_templates( $messenger, $message_type, $GRP_ID, $is_global );
1011
+		$this->_class_is_deprecated(__FUNCTION__);
1012
+		EE_Registry::instance()->load_helper('MSG_Template');
1013
+		return EEH_MSG_Template::create_new_templates($messenger, $message_type, $GRP_ID, $is_global);
1014 1014
 	}
1015 1015
 
1016 1016
 
@@ -1021,11 +1021,11 @@  discard block
 block discarded – undo
1021 1021
 	 * @param  string $message_type_name name of EE_message_type
1022 1022
 	 * @return array
1023 1023
 	 */
1024
-	public function get_fields( $messenger_name, $message_type_name ) {
1024
+	public function get_fields($messenger_name, $message_type_name) {
1025 1025
 		// EE_messages has been deprecated
1026
-		$this->_class_is_deprecated( __FUNCTION__ );
1027
-		EE_Registry::instance()->load_helper( 'MSG_Template' );
1028
-		return EEH_MSG_Template::get_fields( $messenger_name, $message_type_name );
1026
+		$this->_class_is_deprecated(__FUNCTION__);
1027
+		EE_Registry::instance()->load_helper('MSG_Template');
1028
+		return EEH_MSG_Template::get_fields($messenger_name, $message_type_name);
1029 1029
 	}
1030 1030
 
1031 1031
 
@@ -1039,13 +1039,13 @@  discard block
 block discarded – undo
1039 1039
 	 * @return array                    multidimensional array of messenger and message_type objects
1040 1040
 	 *                                    (messengers index, and message_type index);
1041 1041
 	 */
1042
-	public function get_installed( $type = 'all', $skip_cache = false ) {
1042
+	public function get_installed($type = 'all', $skip_cache = false) {
1043 1043
 		// EE_messages has been deprecated
1044
-		$this->_class_is_deprecated( __FUNCTION__ );
1045
-		if ( $skip_cache ) {
1044
+		$this->_class_is_deprecated(__FUNCTION__);
1045
+		if ($skip_cache) {
1046 1046
 			$this->_message_resource_manager->reset_active_messengers_and_message_types();
1047 1047
 		}
1048
-		switch ( $type ) {
1048
+		switch ($type) {
1049 1049
 			case 'messengers' :
1050 1050
 				return array(
1051 1051
 					'messenger' => $this->_message_resource_manager->installed_messengers(),
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
 	 */
1075 1075
 	public function get_active_messengers() {
1076 1076
 		// EE_messages has been deprecated
1077
-		$this->_class_is_deprecated( __FUNCTION__ );
1077
+		$this->_class_is_deprecated(__FUNCTION__);
1078 1078
 		return $this->_message_resource_manager->active_messengers();
1079 1079
 	}
1080 1080
 
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
 	 */
1087 1087
 	public function get_active_message_types() {
1088 1088
 		// EE_messages has been deprecated
1089
-		$this->_class_is_deprecated( __FUNCTION__ );
1089
+		$this->_class_is_deprecated(__FUNCTION__);
1090 1090
 		return $this->_message_resource_manager->list_of_active_message_types();
1091 1091
 	}
1092 1092
 
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
 	 */
1099 1099
 	public function get_active_message_type_objects() {
1100 1100
 		// EE_messages has been deprecated
1101
-		$this->_class_is_deprecated( __FUNCTION__ );
1101
+		$this->_class_is_deprecated(__FUNCTION__);
1102 1102
 		return $this->_message_resource_manager->get_active_message_type_objects();
1103 1103
 	}
1104 1104
 
@@ -1110,10 +1110,10 @@  discard block
 block discarded – undo
1110 1110
 	 * @param string $messenger The messenger being checked
1111 1111
 	 * @return EE_message_type[]    (or empty array if none present)
1112 1112
 	 */
1113
-	public function get_active_message_types_per_messenger( $messenger ) {
1113
+	public function get_active_message_types_per_messenger($messenger) {
1114 1114
 		// EE_messages has been deprecated
1115
-		$this->_class_is_deprecated( __FUNCTION__ );
1116
-		return $this->_message_resource_manager->get_active_message_types_for_messenger( $messenger );
1115
+		$this->_class_is_deprecated(__FUNCTION__);
1116
+		return $this->_message_resource_manager->get_active_message_types_for_messenger($messenger);
1117 1117
 	}
1118 1118
 
1119 1119
 
@@ -1124,10 +1124,10 @@  discard block
 block discarded – undo
1124 1124
 	 * @param string $message_type The string should correspond to a message type.
1125 1125
 	 * @return EE_message_type|null
1126 1126
 	 */
1127
-	public function get_active_message_type( $messenger, $message_type ) {
1127
+	public function get_active_message_type($messenger, $message_type) {
1128 1128
 		// EE_messages has been deprecated
1129
-		$this->_class_is_deprecated( __FUNCTION__ );
1130
-		return $this->_message_resource_manager->get_active_message_type_for_messenger( $messenger, $message_type );
1129
+		$this->_class_is_deprecated(__FUNCTION__);
1130
+		return $this->_message_resource_manager->get_active_message_type_for_messenger($messenger, $message_type);
1131 1131
 	}
1132 1132
 
1133 1133
 
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 	 */
1139 1139
 	public function get_installed_message_types() {
1140 1140
 		// EE_messages has been deprecated
1141
-		$this->_class_is_deprecated( __FUNCTION__ );
1141
+		$this->_class_is_deprecated(__FUNCTION__);
1142 1142
 		return $this->_message_resource_manager->installed_message_types();
1143 1143
 	}
1144 1144
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 	 */
1151 1151
 	public function get_installed_messengers() {
1152 1152
 		// EE_messages has been deprecated
1153
-		$this->_class_is_deprecated( __FUNCTION__ );
1153
+		$this->_class_is_deprecated(__FUNCTION__);
1154 1154
 		return $this->_message_resource_manager->installed_messengers();
1155 1155
 	}
1156 1156
 
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
 	 * @param   bool $slugs_only Whether to return an array of just slugs and labels (true) or all contexts indexed by message type.
1162 1162
 	 * @return array
1163 1163
 	 */
1164
-	public function get_all_contexts( $slugs_only = true ) {
1164
+	public function get_all_contexts($slugs_only = true) {
1165 1165
 		// EE_messages has been deprecated
1166
-		$this->_class_is_deprecated( __FUNCTION__ );
1167
-		return $this->_message_resource_manager->get_all_contexts( $slugs_only );
1166
+		$this->_class_is_deprecated(__FUNCTION__);
1167
+		return $this->_message_resource_manager->get_all_contexts($slugs_only);
1168 1168
 	}
1169 1169
 
1170 1170
 
Please login to merge, or discard this patch.