Completed
Branch BUG-10666-add-check-for-iconv (fb844e)
by
unknown
110:35 queued 98:22
created
core/services/locators/LocatorInterface.php 1 patch
Spacing   +3 added lines, -3 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\locators;
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
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param array|string $location
23 23
 	 * @return \FilesystemIterator
24 24
 	 */
25
-	public function locate( $location );
25
+	public function locate($location);
26 26
 
27 27
 }
28 28
 // End of file LocatorInterface.php
Please login to merge, or discard this patch.
strategies/display/EE_Compound_Input_Display_Strategy.strategy.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * @param bool   $add_pound_sign
28 28
 	 * @return string
29 29
 	 */
30
-	public function get_sub_input_id( $option_value, $add_pound_sign = false ) {
31
-		return $this->_append_chars( $this->_input->html_id( $add_pound_sign ), '-' ) . sanitize_key( $option_value );
30
+	public function get_sub_input_id($option_value, $add_pound_sign = false) {
31
+		return $this->_append_chars($this->_input->html_id($add_pound_sign), '-').sanitize_key($option_value);
32 32
 	}
33 33
 
34 34
 
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	 * @return array
41 41
 	 * @throws \EE_Error
42 42
 	 */
43
-	public function get_html_input_ids( $add_pound_sign = false ) {
43
+	public function get_html_input_ids($add_pound_sign = false) {
44 44
 		$html_input_ids = array();
45
-		foreach( $this->get_input()->options() as $value => $display ) {
46
-			$html_input_ids[] = $this->get_sub_input_id( $value, $add_pound_sign );
45
+		foreach ($this->get_input()->options() as $value => $display) {
46
+			$html_input_ids[] = $this->get_sub_input_id($value, $add_pound_sign);
47 47
 		}
48 48
 		return $html_input_ids;
49 49
 	}
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @throws \EE_Error
59 59
 	 */
60 60
 	public function get_input() {
61
-		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base ){
61
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
62 62
 			throw new EE_Error(
63 63
 				sprintf(
64 64
 					__(
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_To_Generate_From_Queue.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 	 * @param EE_Messages_Queue $queue
26 26
 	 * @param string            $custom_subject  Used if a custom subject is desired for the generated aggregate EE_Message object
27 27
 	 */
28
-	public function __construct( $messenger_name, $message_type_name, EE_Messages_Queue $queue, $custom_subject = '' ) {
28
+	public function __construct($messenger_name, $message_type_name, EE_Messages_Queue $queue, $custom_subject = '') {
29 29
 		$this->queue = $queue;
30
-		parent::__construct( $messenger_name, $message_type_name, array(), '', false, EEM_Message::status_idle );
31
-		if ( $this->valid() ) {
32
-			$this->_message->set_content( $this->_get_content() );
33
-			$this->_message->set_subject( $this->_get_subject( $custom_subject ) );
30
+		parent::__construct($messenger_name, $message_type_name, array(), '', false, EEM_Message::status_idle);
31
+		if ($this->valid()) {
32
+			$this->_message->set_content($this->_get_content());
33
+			$this->_message->set_subject($this->_get_subject($custom_subject));
34 34
 		}
35 35
 	}
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	protected function _get_content() {
45 45
 		$content = '';
46 46
 		$this->queue->get_message_repository()->rewind();
47
-		while ( $this->queue->get_message_repository()->valid() ) {
47
+		while ($this->queue->get_message_repository()->valid()) {
48 48
 			$content .= $this->queue->get_message_repository()->current()->content();
49 49
 			$this->queue->get_message_repository()->next();
50 50
 		}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return string
60 60
 	 */
61
-	protected function _get_subject( $custom_subject = '' ) {
62
-		if ( ! empty( $custom_subject ) ) {
61
+	protected function _get_subject($custom_subject = '') {
62
+		if ( ! empty($custom_subject)) {
63 63
 			return $custom_subject;
64 64
 		}
65 65
 		$this->queue->get_message_repository()->rewind();
66 66
 		$count_of_items = $this->queue->get_message_repository()->count();
67 67
 
68 68
 		//if $count of items in queue == 1, then let's just return the subject for that item.
69
-		if ( $count_of_items === 1 ) {
69
+		if ($count_of_items === 1) {
70 70
 			return $this->queue->get_message_repository()->current()->subject();
71 71
 		}
72 72
 
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messages_Generator.lib.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -458,8 +458,8 @@  discard block
 block discarded – undo
458 458
 		//if the 'to' field is empty (messages will ALWAYS have a "to" field, then we get out because that means this
459 459
 		//context is turned off) EXCEPT if we're previewing
460 460
 		if ( empty( $templates['to'][ $context ] )
461
-		     && ! $this->_generation_queue->get_message_repository()->is_preview()
462
-		     && ! $this->_current_messenger->allow_empty_to_field() ) {
461
+			 && ! $this->_generation_queue->get_message_repository()->is_preview()
462
+			 && ! $this->_current_messenger->allow_empty_to_field() ) {
463 463
 			//we silently exit here and do NOT record a fail because the message is "turned off" by having no "to" field.
464 464
 			return false;
465 465
 		}
@@ -575,9 +575,9 @@  discard block
 block discarded – undo
575 575
 		 * Check if there is any generation data, but only if this is not for a preview.
576 576
 		 */
577 577
 		if ( ! $this->_generation_queue->get_message_repository()->get_generation_data()
578
-		     && (
579
-			     ! $this->_generation_queue->get_message_repository()->is_preview()
580
-			     && $this->_generation_queue->get_message_repository()->get_data_handler() !== 'EE_Messages_Preview_incoming_data' )
578
+			 && (
579
+				 ! $this->_generation_queue->get_message_repository()->is_preview()
580
+				 && $this->_generation_queue->get_message_repository()->get_data_handler() !== 'EE_Messages_Preview_incoming_data' )
581 581
 		) {
582 582
 			$this->_error_msg[] = __( 'There is no generation data for this message. Unable to generate.' );
583 583
 		}
Please login to merge, or discard this patch.
Spacing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' )) { exit( 'No direct script access allowed' ); }
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
 
3 3
 /**
4 4
  * This class is used for generating EE_Message objects with given info.
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 	 *
117 117
 	 * @return EE_Messages_Queue  The new queue for holding generated EE_Message objects.
118 118
 	 */
119
-	public function generate( $save = true ) {
119
+	public function generate($save = true) {
120 120
 		//iterate through the messages in the queue, generate, and add to new queue.
121 121
 		$this->_generation_queue->get_message_repository()->rewind();
122
-		while ( $this->_generation_queue->get_message_repository()->valid() ) {
122
+		while ($this->_generation_queue->get_message_repository()->valid()) {
123 123
 			//reset "current" properties
124 124
 			$this->_reset_current_properties();
125 125
 
@@ -133,18 +133,18 @@  discard block
 block discarded – undo
133 133
 			$this->_generation_queue->get_message_repository()->next();
134 134
 			$next_msg = $this->_generation_queue->get_message_repository()->current();
135 135
 			//restore pointer to current item
136
-			$this->_generation_queue->get_message_repository()->set_current( $msg );
136
+			$this->_generation_queue->get_message_repository()->set_current($msg);
137 137
 
138 138
 			//skip and delete if the current $msg is NOT incomplete (queued for generation)
139
-			if ( $msg->STS_ID() !== EEM_Message::status_incomplete ) {
139
+			if ($msg->STS_ID() !== EEM_Message::status_incomplete) {
140 140
 				//we keep this item in the db just remove from the repo.
141
-				$this->_generation_queue->get_message_repository()->remove( $msg );
141
+				$this->_generation_queue->get_message_repository()->remove($msg);
142 142
 				//next item
143
-				$this->_generation_queue->get_message_repository()->set_current( $next_msg );
143
+				$this->_generation_queue->get_message_repository()->set_current($next_msg);
144 144
 				continue;
145 145
 			}
146 146
 
147
-			if ( $this->_verify() ) {
147
+			if ($this->_verify()) {
148 148
 				//let's get generating!
149 149
 				$this->_generate();
150 150
 			}
@@ -154,32 +154,32 @@  discard block
 block discarded – undo
154 154
 				$msg->STS_ID() === EEM_Message::status_debug_only
155 155
 				&& ! EEM_Message::debug()
156 156
 			) {
157
-				do_action( 'AHEE__EE_Messages_Generator__generate__before_debug_delete', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler );
157
+				do_action('AHEE__EE_Messages_Generator__generate__before_debug_delete', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler);
158 158
 				$this->_generation_queue->get_message_repository()->delete();
159
-				$this->_generation_queue->get_message_repository()->set_current( $next_msg );
159
+				$this->_generation_queue->get_message_repository()->set_current($next_msg);
160 160
 				continue;
161 161
 			}
162 162
 
163 163
 			//if there are error messages then let's set the status and the error message.
164
-			if ( $this->_error_msg ) {
164
+			if ($this->_error_msg) {
165 165
 				//if the status is already debug only, then let's leave it at that.
166
-				if ( $msg->STS_ID() !== EEM_Message::status_debug_only ) {
167
-					$msg->set_STS_ID( EEM_Message::status_failed );
166
+				if ($msg->STS_ID() !== EEM_Message::status_debug_only) {
167
+					$msg->set_STS_ID(EEM_Message::status_failed);
168 168
 				}
169
-				do_action( 'AHEE__EE_Messages_Generator__generate__processing_failed_message', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler );
169
+				do_action('AHEE__EE_Messages_Generator__generate__processing_failed_message', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler);
170 170
 				$msg->set_error_message(
171
-					__( 'Message failed to generate for the following reasons: ' )
171
+					__('Message failed to generate for the following reasons: ')
172 172
 					. "\n"
173
-					. implode( "\n", $this->_error_msg )
173
+					. implode("\n", $this->_error_msg)
174 174
 				);
175
-				$msg->set_modified( time() );
175
+				$msg->set_modified(time());
176 176
 			} else {
177
-				do_action( 'AHEE__EE_Messages_Generator__generate__before_successful_generated_message_delete', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler );
177
+				do_action('AHEE__EE_Messages_Generator__generate__before_successful_generated_message_delete', $msg, $this->_error_msg, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler);
178 178
 				//remove from db
179 179
 				$this->_generation_queue->get_message_repository()->delete();
180 180
 			}
181 181
 			//next item
182
-			$this->_generation_queue->get_message_repository()->set_current( $next_msg );
182
+			$this->_generation_queue->get_message_repository()->set_current($next_msg);
183 183
 		}
184 184
 
185 185
 		//generation queue is ALWAYS saved to record any errors in the generation process.
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		 * so a EE_Extra_Meta entry could be created and attached to the EE_Message.  In those cases the save flag is
193 193
 		 * irrelevant.
194 194
 		 */
195
-		if ( $save ) {
195
+		if ($save) {
196 196
 			$this->_ready_queue->save();
197 197
 		}
198 198
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	protected function _reset_current_properties() {
211 211
 		$this->_verified = false;
212 212
 		//make sure any _data value in the current message type is reset
213
-		if ( $this->_current_message_type instanceof EE_message_type ) {
213
+		if ($this->_current_message_type instanceof EE_message_type) {
214 214
 			$this->_current_message_type->reset_data();
215 215
 		}
216 216
 		$this->_current_messenger = $this->_current_message_type = $this->_current_data_handler = null;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	protected function _generate() {
231 231
 		//double check verification has run and that everything is ready to work with (saves us having to validate everything again).
232
-		if ( ! $this->_verified ) {
232
+		if ( ! $this->_verified) {
233 233
 			return false; //get out because we don't have a valid setup to work with.
234 234
 		}
235 235
 
@@ -239,35 +239,35 @@  discard block
 block discarded – undo
239 239
 				$this->_current_data_handler,
240 240
 				$this->_generation_queue->get_message_repository()->current()->context()
241 241
 			);
242
-		} catch ( EE_Error $e ) {
242
+		} catch (EE_Error $e) {
243 243
 			$this->_error_msg[] = $e->getMessage();
244 244
 			return false;
245 245
 		}
246 246
 
247 247
 
248 248
 		//if no addressees then get out because there is nothing to generation (possible bad data).
249
-		if ( ! $this->_valid_addressees( $addressees ) ) {
250
-			do_action( 'AHEE__EE_Messages_Generator___generate__invalid_addressees', $this->_generation_queue->get_message_repository()->current(), $addressees, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler );
251
-			$this->_generation_queue->get_message_repository()->current()->set_STS_ID( EEM_Message::status_debug_only );
252
-			$this->_error_msg[] = __( 'This is not a critical error but an informational notice. Unable to generate messages EE_Messages_Addressee objects.  There were no attendees prepared by the data handler.
253
-			  Sometimes this is because messages only get generated for certain registration statuses. For example, the ticket notice message type only goes to approved registrations.', 'event_espresso' );
249
+		if ( ! $this->_valid_addressees($addressees)) {
250
+			do_action('AHEE__EE_Messages_Generator___generate__invalid_addressees', $this->_generation_queue->get_message_repository()->current(), $addressees, $this->_current_messenger, $this->_current_message_type, $this->_current_data_handler);
251
+			$this->_generation_queue->get_message_repository()->current()->set_STS_ID(EEM_Message::status_debug_only);
252
+			$this->_error_msg[] = __('This is not a critical error but an informational notice. Unable to generate messages EE_Messages_Addressee objects.  There were no attendees prepared by the data handler.
253
+			  Sometimes this is because messages only get generated for certain registration statuses. For example, the ticket notice message type only goes to approved registrations.', 'event_espresso');
254 254
 			return false;
255 255
 		}
256 256
 
257 257
 		$message_template_group = $this->_get_message_template_group();
258 258
 
259 259
 		//in the unlikely event there is no EE_Message_Template_Group available, get out!
260
-		if ( ! $message_template_group instanceof EE_Message_Template_Group ) {
261
-			$this->_error_msg[] = __( 'Unable to get the Message Templates for the Message being generated.  No message template group accessible.', 'event_espresso' );
260
+		if ( ! $message_template_group instanceof EE_Message_Template_Group) {
261
+			$this->_error_msg[] = __('Unable to get the Message Templates for the Message being generated.  No message template group accessible.', 'event_espresso');
262 262
 			return false;
263 263
 		}
264 264
 
265 265
 		//get formatted templates for using to parse and setup EE_Message objects.
266
-		$templates = $this->_get_templates( $message_template_group );
266
+		$templates = $this->_get_templates($message_template_group);
267 267
 
268 268
 
269 269
 		//setup new EE_Message objects (and add to _ready_queue)
270
-		return $this->_assemble_messages( $addressees, $templates, $message_template_group );
270
+		return $this->_assemble_messages($addressees, $templates, $message_template_group);
271 271
 	}
272 272
 
273 273
 
@@ -285,18 +285,18 @@  discard block
 block discarded – undo
285 285
 		//so let's use that.
286 286
 		$GRP_ID = $this->_generation_queue->get_message_repository()->current()->GRP_ID();
287 287
 
288
-		if ( $GRP_ID ) {
288
+		if ($GRP_ID) {
289 289
 			//attempt to retrieve from repo first
290
-			$GRP = $this->_template_collection->get_by_ID( $GRP_ID );
291
-			if ( $GRP instanceof EE_Message_Template_Group ) {
292
-				return $GRP;  //got it!
290
+			$GRP = $this->_template_collection->get_by_ID($GRP_ID);
291
+			if ($GRP instanceof EE_Message_Template_Group) {
292
+				return $GRP; //got it!
293 293
 			}
294 294
 
295 295
 			//nope don't have it yet.  Get from DB then add to repo if its not here, then that means the current GRP_ID
296 296
 			//is not valid, so we'll continue on in the code assuming there's NO GRP_ID.
297
-			$GRP = EEM_Message_Template_Group::instance()->get_one_by_ID( $GRP_ID );
298
-			if ( $GRP instanceof EE_Message_Template_Group ) {
299
-				$this->_template_collection->add( $GRP );
297
+			$GRP = EEM_Message_Template_Group::instance()->get_one_by_ID($GRP_ID);
298
+			if ($GRP instanceof EE_Message_Template_Group) {
299
+				$this->_template_collection->add($GRP);
300 300
 				return $GRP;
301 301
 			}
302 302
 		}
@@ -315,41 +315,41 @@  discard block
 block discarded – undo
315 315
 		//in vanilla EE we're assuming there's only one event.
316 316
 		//However, if there are multiple events then we'll just use the default templates instead of different
317 317
 		// templates per event (which could create problems).
318
-		if ( count( $this->_current_data_handler->events ) === 1 ) {
319
-			foreach ( $this->_current_data_handler->events as $event ) {
318
+		if (count($this->_current_data_handler->events) === 1) {
319
+			foreach ($this->_current_data_handler->events as $event) {
320 320
 				$EVT_ID = $event['ID'];
321 321
 			}
322 322
 		}
323 323
 
324 324
 		//before going any further, let's see if its in the queue
325
-		$GRP = $this->_template_collection->get_by_key( $this->_template_collection->get_key( $this->_current_messenger->name, $this->_current_message_type->name, $EVT_ID ) );
325
+		$GRP = $this->_template_collection->get_by_key($this->_template_collection->get_key($this->_current_messenger->name, $this->_current_message_type->name, $EVT_ID));
326 326
 
327
-		if ( $GRP instanceof EE_Message_Template_Group ) {
327
+		if ($GRP instanceof EE_Message_Template_Group) {
328 328
 			return $GRP;
329 329
 		}
330 330
 
331 331
 		//nope still no GRP?
332 332
 		//first we get the global template in case it has an override set.
333
-		$global_template_qa = array_merge( array( 'MTP_is_global' => true ), $template_qa );
334
-		$global_GRP = EEM_Message_Template_Group::instance()->get_one( array( $global_template_qa ) );
333
+		$global_template_qa = array_merge(array('MTP_is_global' => true), $template_qa);
334
+		$global_GRP = EEM_Message_Template_Group::instance()->get_one(array($global_template_qa));
335 335
 
336 336
 		//if this is an override, then we just return it.
337
-		if ( $global_GRP instanceof EE_Message_Template_Group && $global_GRP->get( 'MTP_is_override' ) ) {
338
-			$this->_template_collection->add( $global_GRP, $EVT_ID );
337
+		if ($global_GRP instanceof EE_Message_Template_Group && $global_GRP->get('MTP_is_override')) {
338
+			$this->_template_collection->add($global_GRP, $EVT_ID);
339 339
 			return $global_GRP;
340 340
 		}
341 341
 
342 342
 		//STILL here? Okay that means we want to see if there is event specific group and if there is we return it,
343 343
 		//otherwise we return the global group we retrieved.
344
-		if ( $EVT_ID ) {
344
+		if ($EVT_ID) {
345 345
 			$template_qa['Event.EVT_ID'] = $EVT_ID;
346 346
 		}
347 347
 
348
-		$GRP = EEM_Message_Template_Group::instance()->get_one( array( $template_qa ) );
348
+		$GRP = EEM_Message_Template_Group::instance()->get_one(array($template_qa));
349 349
 		$GRP = $GRP instanceof EE_Message_Template_Group ? $GRP : $global_GRP;
350 350
 
351
-		if ( $GRP instanceof EE_Message_Template_Group ) {
352
-			$this->_template_collection->add( $GRP, $EVT_ID );
351
+		if ($GRP instanceof EE_Message_Template_Group) {
352
+			$this->_template_collection->add($GRP, $EVT_ID);
353 353
 			return $GRP;
354 354
 		}
355 355
 
@@ -373,15 +373,15 @@  discard block
 block discarded – undo
373 373
 	 *                      )
374 374
 	 *                  )
375 375
 	 */
376
-	protected function _get_templates( EE_Message_Template_Group $message_template_group ) {
376
+	protected function _get_templates(EE_Message_Template_Group $message_template_group) {
377 377
 		$templates = array();
378 378
 		$context_templates = $message_template_group->context_templates();
379
-		foreach ( $context_templates as $context => $template_fields ) {
380
-			foreach ( $template_fields as $template_field => $template_obj ) {
381
-				if ( ! $template_obj instanceof EE_Message_Template ) {
379
+		foreach ($context_templates as $context => $template_fields) {
380
+			foreach ($template_fields as $template_field => $template_obj) {
381
+				if ( ! $template_obj instanceof EE_Message_Template) {
382 382
 					continue;
383 383
 				}
384
-				$templates[ $template_field ][ $context ] = $template_obj->get( 'MTP_content' );
384
+				$templates[$template_field][$context] = $template_obj->get('MTP_content');
385 385
 			}
386 386
 		}
387 387
 		return $templates;
@@ -403,21 +403,21 @@  discard block
 block discarded – undo
403 403
 	 *                get added to the queue with EEM_Message::status_idle, unsuccessfully generated messages will get added
404 404
 	 *                to the queue as EEM_Message::status_failed.  Very rarely should "false" be returned from this method.
405 405
 	 */
406
-	protected function _assemble_messages( $addressees, $templates, EE_Message_Template_Group $message_template_group ) {
406
+	protected function _assemble_messages($addressees, $templates, EE_Message_Template_Group $message_template_group) {
407 407
 
408 408
 		//if templates are empty then get out because we can't generate anything.
409
-		if ( ! $templates ) {
410
-			$this->_error_msg[] = __( 'Unable to assemble messages because there are no templates retrieved for generating the messages with', 'event_espresso' );
409
+		if ( ! $templates) {
410
+			$this->_error_msg[] = __('Unable to assemble messages because there are no templates retrieved for generating the messages with', 'event_espresso');
411 411
 			return false;
412 412
 		}
413 413
 
414 414
 		//We use this as the counter for generated messages because don't forget we may be executing this inside of a
415 415
 		//generation_queue.  So _ready_queue may have generated EE_Message objects already.
416 416
 		$generated_count = 0;
417
-		foreach ( $addressees as $context => $recipients ) {
418
-			foreach ( $recipients as $recipient ) {
419
-				$message = $this->_setup_message_object( $context, $recipient, $templates, $message_template_group );
420
-				if ( $message instanceof EE_Message ) {
417
+		foreach ($addressees as $context => $recipients) {
418
+			foreach ($recipients as $recipient) {
419
+				$message = $this->_setup_message_object($context, $recipient, $templates, $message_template_group);
420
+				if ($message instanceof EE_Message) {
421 421
 					$this->_ready_queue->add(
422 422
 						$message,
423 423
 						array(),
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 				}
429 429
 
430 430
 				//if the current MSG being generated is for a test send then we'll only use ONE message in the generation.
431
-				if ( $this->_generation_queue->get_message_repository()->is_test_send() ) {
431
+				if ($this->_generation_queue->get_message_repository()->is_test_send()) {
432 432
 					break 2;
433 433
 				}
434 434
 			}
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 	) {
458 458
 		//stuff we already know
459 459
 		$transaction_id = $recipient->txn instanceof EE_Transaction ? $recipient->txn->ID() : 0;
460
-		$transaction_id = empty( $transaction_id ) && $this->_current_data_handler->txn instanceof EE_Transaction
460
+		$transaction_id = empty($transaction_id) && $this->_current_data_handler->txn instanceof EE_Transaction
461 461
 			? $this->_current_data_handler->txn->ID()
462 462
 			: $transaction_id;
463 463
 		$message_fields = array(
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 
471 471
 		//recipient id and type should be on the EE_Messages_Addressee object but if this is empty, let's try to grab the
472 472
 		//info from the att_obj found in the EE_Messages_Addressee object.
473
-		if ( empty( $recipient->recipient_id ) || empty( $recipient->recipient_type ) ) {
473
+		if (empty($recipient->recipient_id) || empty($recipient->recipient_type)) {
474 474
 			$message_fields['MSG_recipient_ID'] = $recipient->att_obj instanceof EE_Attendee
475 475
 				? $recipient->att_obj->ID()
476 476
 				: 0;
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 			$message_fields['MSG_recipient_ID'] = $recipient->recipient_id;
480 480
 			$message_fields['MSG_recipient_type'] = $recipient->recipient_type;
481 481
 		}
482
-		$message = EE_Message_Factory::create( $message_fields );
482
+		$message = EE_Message_Factory::create($message_fields);
483 483
 
484 484
 		//grab valid shortcodes for shortcode parser
485 485
 		$mt_shortcodes = $this->_current_message_type->get_valid_shortcodes();
@@ -487,43 +487,43 @@  discard block
 block discarded – undo
487 487
 
488 488
 		//if the 'to' field is empty (messages will ALWAYS have a "to" field, then we get out because that means this
489 489
 		//context is turned off) EXCEPT if we're previewing
490
-		if ( empty( $templates['to'][ $context ] )
490
+		if (empty($templates['to'][$context])
491 491
 		     && ! $this->_generation_queue->get_message_repository()->is_preview()
492
-		     && ! $this->_current_messenger->allow_empty_to_field() ) {
492
+		     && ! $this->_current_messenger->allow_empty_to_field()) {
493 493
 			//we silently exit here and do NOT record a fail because the message is "turned off" by having no "to" field.
494 494
 			return false;
495 495
 		}
496 496
 		$error_msg = array();
497
-		foreach ( $templates as $field => $field_context ) {
497
+		foreach ($templates as $field => $field_context) {
498 498
 			$error_msg = array();
499 499
 			//let's setup the valid shortcodes for the incoming context.
500
-			$valid_shortcodes = $mt_shortcodes[ $context ];
500
+			$valid_shortcodes = $mt_shortcodes[$context];
501 501
 			//merge in valid shortcodes for the field.
502
-			$shortcodes = isset($m_shortcodes[ $field ]) ? $m_shortcodes[ $field ] : $valid_shortcodes;
503
-			if ( isset( $templates[ $field ][ $context ] ) ) {
502
+			$shortcodes = isset($m_shortcodes[$field]) ? $m_shortcodes[$field] : $valid_shortcodes;
503
+			if (isset($templates[$field][$context])) {
504 504
 				//prefix field.
505
-				$column_name = 'MSG_' . $field;
505
+				$column_name = 'MSG_'.$field;
506 506
 				try {
507 507
 					$content = $this->_shortcode_parser->parse_message_template(
508
-						$templates[ $field ][ $context ],
508
+						$templates[$field][$context],
509 509
 						$recipient,
510 510
 						$shortcodes,
511 511
 						$this->_current_message_type,
512 512
 						$this->_current_messenger,
513 513
 						$message );
514
-					$message->set_field_or_extra_meta( $column_name, $content );
515
-				} catch ( EE_Error $e ) {
516
-					$error_msg[] = sprintf( __( 'There was a problem generating the content for the field %s: %s', 'event_espresso' ), $field, $e->getMessage() );
517
-					$message->set_STS_ID( EEM_Message::status_failed );
514
+					$message->set_field_or_extra_meta($column_name, $content);
515
+				} catch (EE_Error $e) {
516
+					$error_msg[] = sprintf(__('There was a problem generating the content for the field %s: %s', 'event_espresso'), $field, $e->getMessage());
517
+					$message->set_STS_ID(EEM_Message::status_failed);
518 518
 				}
519 519
 			}
520 520
 		}
521 521
 
522
-		if ( $message->STS_ID() === EEM_Message::status_failed ) {
523
-			$error_msg = __( 'There were problems generating this message:', 'event_espresso' ) . "\n" . implode( "\n", $error_msg );
524
-			$message->set_error_message( $error_msg );
522
+		if ($message->STS_ID() === EEM_Message::status_failed) {
523
+			$error_msg = __('There were problems generating this message:', 'event_espresso')."\n".implode("\n", $error_msg);
524
+			$message->set_error_message($error_msg);
525 525
 		} else {
526
-			$message->set_STS_ID( EEM_Message::status_idle );
526
+			$message->set_STS_ID(EEM_Message::status_idle);
527 527
 		}
528 528
 		return $message;
529 529
 	}
@@ -557,14 +557,14 @@  discard block
 block discarded – undo
557 557
 	 * @param array $addressees  Keys correspond to contexts for the message type and values are EE_Messages_Addressee[]
558 558
 	 * @return bool
559 559
 	 */
560
-	protected function _valid_addressees( $addressees ) {
561
-		if ( ! $addressees || ! is_array( $addressees ) ) {
560
+	protected function _valid_addressees($addressees) {
561
+		if ( ! $addressees || ! is_array($addressees)) {
562 562
 			return false;
563 563
 		}
564 564
 
565
-		foreach ( $addressees as $addressee_array ) {
566
-			foreach ( $addressee_array as $addressee ) {
567
-				if ( ! $addressee instanceof EE_Messages_Addressee ) {
565
+		foreach ($addressees as $addressee_array) {
566
+			foreach ($addressee_array as $addressee) {
567
+				if ( ! $addressee instanceof EE_Messages_Addressee) {
568 568
 					return false;
569 569
 				}
570 570
 			}
@@ -585,19 +585,19 @@  discard block
 block discarded – undo
585 585
 	protected function _validate_messenger_and_message_type() {
586 586
 
587 587
 		//first are there any existing error messages?  If so then return.
588
-		if ( $this->_error_msg ) {
588
+		if ($this->_error_msg) {
589 589
 			return false;
590 590
 		}
591 591
 		/** @type EE_Message $message */
592 592
 		$message = $this->_generation_queue->get_message_repository()->current();
593 593
 		try {
594
-			$this->_current_messenger = $message->valid_messenger( true ) ? $message->messenger_object() : null;
595
-		} catch ( Exception $e ) {
594
+			$this->_current_messenger = $message->valid_messenger(true) ? $message->messenger_object() : null;
595
+		} catch (Exception $e) {
596 596
 			$this->_error_msg[] = $e->getMessage();
597 597
 		}
598 598
 		try {
599
-			$this->_current_message_type = $message->valid_message_type( true ) ? $message->message_type_object() : null;
600
-		} catch ( Exception $e ) {
599
+			$this->_current_message_type = $message->valid_message_type(true) ? $message->message_type_object() : null;
600
+		} catch (Exception $e) {
601 601
 			$this->_error_msg[] = $e->getMessage();
602 602
 		}
603 603
 
@@ -609,10 +609,10 @@  discard block
 block discarded – undo
609 609
 			     ! $this->_generation_queue->get_message_repository()->is_preview()
610 610
 			     && $this->_generation_queue->get_message_repository()->get_data_handler() !== 'EE_Messages_Preview_incoming_data' )
611 611
 		) {
612
-			$this->_error_msg[] = __( 'There is no generation data for this message. Unable to generate.' );
612
+			$this->_error_msg[] = __('There is no generation data for this message. Unable to generate.');
613 613
 		}
614 614
 
615
-		return empty( $this->_error_msg );
615
+		return empty($this->_error_msg);
616 616
 	}
617 617
 
618 618
 
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 
630 630
 		//First, are there any existing error messages?  If so, return because if there were errors elsewhere this can't
631 631
 		//be used anyways.
632
-		if ( $this->_error_msg ) {
632
+		if ($this->_error_msg) {
633 633
 			return false;
634 634
 		}
635 635
 
@@ -638,29 +638,29 @@  discard block
 block discarded – undo
638 638
 		/** @type EE_Messages_incoming_data $data_handler_class_name - well not really... just the class name actually */
639 639
 		$data_handler_class_name = $this->_generation_queue->get_message_repository()->get_data_handler()
640 640
 			? $this->_generation_queue->get_message_repository()->get_data_handler()
641
-			: 'EE_Messages_' .  $this->_current_message_type->get_data_handler( $generation_data ) . '_incoming_data';
641
+			: 'EE_Messages_'.$this->_current_message_type->get_data_handler($generation_data).'_incoming_data';
642 642
 
643 643
 		//If this EE_Message is for a preview, then let's switch out to the preview data handler.
644
-		if ( $this->_generation_queue->get_message_repository()->is_preview() ) {
645
-			$data_handler_class_name  = 'EE_Messages_Preview_incoming_data';
644
+		if ($this->_generation_queue->get_message_repository()->is_preview()) {
645
+			$data_handler_class_name = 'EE_Messages_Preview_incoming_data';
646 646
 		}
647 647
 
648 648
 		//First get the class name for the data handler (and also verifies it exists.
649
-		if ( ! class_exists( $data_handler_class_name ) ) {
649
+		if ( ! class_exists($data_handler_class_name)) {
650 650
 			$this->_error_msg[] = sprintf(
651
-				__( 'The included data handler class name does not match any valid, accessible, "EE_Messages_incoming_data" classes.  Looking for %s.', 'event_espresso' ),
651
+				__('The included data handler class name does not match any valid, accessible, "EE_Messages_incoming_data" classes.  Looking for %s.', 'event_espresso'),
652 652
 				$data_handler_class_name
653 653
 			);
654 654
 			return false;
655 655
 		}
656 656
 
657 657
 		//convert generation_data for data_handler_instantiation.
658
-		$generation_data = $data_handler_class_name::convert_data_from_persistent_storage( $generation_data );
658
+		$generation_data = $data_handler_class_name::convert_data_from_persistent_storage($generation_data);
659 659
 
660 660
 		//note, this may set error messages as well.
661
-		$this->_set_data_handler( $generation_data, $data_handler_class_name );
661
+		$this->_set_data_handler($generation_data, $data_handler_class_name);
662 662
 
663
-		return empty( $this->_error_msg );
663
+		return empty($this->_error_msg);
664 664
 	}
665 665
 
666 666
 
@@ -677,16 +677,16 @@  discard block
 block discarded – undo
677 677
 	 *
678 678
 	 * @return void.
679 679
 	 */
680
-	protected function _set_data_handler( $generating_data, $data_handler_class_name ) {
680
+	protected function _set_data_handler($generating_data, $data_handler_class_name) {
681 681
 		//valid classname for the data handler.  Now let's setup the key for the data handler repository to see if there
682 682
 		//is already a ready data handler in the repository.
683
-		$this->_current_data_handler = $this->_data_handler_collection->get_by_key( $this->_data_handler_collection->get_key( $data_handler_class_name, $generating_data ) );
684
-		if ( ! $this->_current_data_handler instanceof EE_Messages_incoming_data ) {
683
+		$this->_current_data_handler = $this->_data_handler_collection->get_by_key($this->_data_handler_collection->get_key($data_handler_class_name, $generating_data));
684
+		if ( ! $this->_current_data_handler instanceof EE_Messages_incoming_data) {
685 685
 			//no saved data_handler in the repo so let's set one up and add it to the repo.
686 686
 			try {
687
-				$this->_current_data_handler = new $data_handler_class_name( $generating_data );
688
-				$this->_data_handler_collection->add( $this->_current_data_handler, $generating_data );
689
-			} catch( EE_Error $e ) {
687
+				$this->_current_data_handler = new $data_handler_class_name($generating_data);
688
+				$this->_data_handler_collection->add($this->_current_data_handler, $generating_data);
689
+			} catch (EE_Error $e) {
690 690
 				$this->_error_msg[] = $e->get_error();
691 691
 			}
692 692
 		}
@@ -706,13 +706,13 @@  discard block
 block discarded – undo
706 706
 	 * @param bool                   $preview Indicate whether this is being used for a preview or not.
707 707
 	 * @return mixed Prepped data for persisting to the queue.  false is returned if unable to prep data.
708 708
 	 */
709
-	protected function _prepare_data_for_queue( EE_Message_To_Generate $message_to_generate, $preview ) {
709
+	protected function _prepare_data_for_queue(EE_Message_To_Generate $message_to_generate, $preview) {
710 710
 		/** @type EE_Messages_incoming_data $data_handler - well not really... just the class name actually */
711
-		$data_handler = $message_to_generate->get_data_handler_class_name( $preview );
712
-		if ( ! $message_to_generate->valid() ) {
711
+		$data_handler = $message_to_generate->get_data_handler_class_name($preview);
712
+		if ( ! $message_to_generate->valid()) {
713 713
 			return false; //unable to get the data because the info in the EE_Message_To_Generate class is invalid.
714 714
 		}
715
-		return $data_handler::convert_data_for_persistent_storage( $message_to_generate->data() );
715
+		return $data_handler::convert_data_for_persistent_storage($message_to_generate->data());
716 716
 	}
717 717
 
718 718
 
@@ -725,26 +725,26 @@  discard block
 block discarded – undo
725 725
 	 * @param EE_Message_To_Generate $message_to_generate
726 726
 	 * @param bool                   $test_send Whether this is just a test send or not.  Typically used for previews.
727 727
 	 */
728
-	public function create_and_add_message_to_queue( EE_Message_To_Generate $message_to_generate, $test_send = false ) {
728
+	public function create_and_add_message_to_queue(EE_Message_To_Generate $message_to_generate, $test_send = false) {
729 729
 		//prep data
730
-		$data = $this->_prepare_data_for_queue( $message_to_generate, $message_to_generate->preview() );
730
+		$data = $this->_prepare_data_for_queue($message_to_generate, $message_to_generate->preview());
731 731
 
732 732
 		$message = $message_to_generate->get_EE_Message();
733 733
 
734 734
 		//is there a GRP_ID in the request?
735
-		if ( $GRP_ID = EE_Registry::instance()->REQ->get( 'GRP_ID' ) ) {
736
-			$message->set_GRP_ID( $GRP_ID );
735
+		if ($GRP_ID = EE_Registry::instance()->REQ->get('GRP_ID')) {
736
+			$message->set_GRP_ID($GRP_ID);
737 737
 		}
738 738
 
739
-		if ( $data === false ) {
740
-			$message->set_STS_ID( EEM_Message::status_failed );
741
-			$message->set_error_message( __( 'Unable to prepare data for persistence to the database.', 'event_espresso' ) );
739
+		if ($data === false) {
740
+			$message->set_STS_ID(EEM_Message::status_failed);
741
+			$message->set_error_message(__('Unable to prepare data for persistence to the database.', 'event_espresso'));
742 742
 		} else {
743 743
 			//make sure that the data handler is cached on the message as well
744 744
 			$data['data_handler_class_name'] = $message_to_generate->get_data_handler_class_name();
745 745
 		}
746 746
 
747
-		$this->_generation_queue->add( $message, $data, $message_to_generate->preview(), $test_send );
747
+		$this->_generation_queue->add($message, $data, $message_to_generate->preview(), $test_send);
748 748
 	}
749 749
 
750 750
 
Please login to merge, or discard this patch.
display_strategies/number_bubbles/number_bubbles.template.php 1 patch
Spacing   +5 added lines, -5 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
  * This is the template for the "Number Bubbles" Progress Steps
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 <!-- progress step display -->
15 15
 <div class="ee-progress-step-main-container">
16 16
 	<div class="progress-step-container number-bubbles-container">
17
-		<?php foreach ( $progress_steps as $progress_step ) : ?>
18
-		<div data-step-nmbr="<?php echo $progress_step->order();?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
17
+		<?php foreach ($progress_steps as $progress_step) : ?>
18
+		<div data-step-nmbr="<?php echo $progress_step->order(); ?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
19 19
 			<div class="progress-step-line"></div>
20 20
 			<div class="progress-step-bubble"><p><?php echo $progress_step->order(); ?></p></div>
21 21
 			<span class="progress-step-text"><?php echo $progress_step->text(); ?></span>
22 22
 		</div>
23
-		<?php endforeach;?>
23
+		<?php endforeach; ?>
24 24
 	</div>
25 25
 </div>
26 26
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Hidden_Input.input.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Hidden_Input extends EE_Form_Input_Base{
9
+class EE_Hidden_Input extends EE_Form_Input_Base {
10 10
 
11 11
 	/**
12 12
 	 * @param array $input_settings
13 13
 	 */
14
-	public function __construct($input_settings = array()){
14
+	public function __construct($input_settings = array()) {
15 15
 		//require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
16 16
 		$this->_set_display_strategy(new EE_Hidden_Display_Strategy());
17
-		if ( isset( $input_settings['normalization_strategy'] ) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base ) {
18
-			$this->_set_normalization_strategy( $input_settings['normalization_strategy'] );
17
+		if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
18
+			$this->_set_normalization_strategy($input_settings['normalization_strategy']);
19 19
 		} else {
20
-			$this->_set_normalization_strategy( new EE_Text_Normalization() );
20
+			$this->_set_normalization_strategy(new EE_Text_Normalization());
21 21
 		}
22
-		parent::__construct( $input_settings );
22
+		parent::__construct($input_settings);
23 23
 	}
24 24
 
25 25
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Submit_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
  *
9 9
  * This input has a default validation strategy of plaintext (which can be removed after construction)
10 10
  */
11
-class EE_Submit_Input extends EE_Form_Input_Base{
11
+class EE_Submit_Input extends EE_Form_Input_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param array $options
15 15
 	 */
16
-	public function __construct($options = array()){
16
+	public function __construct($options = array()) {
17 17
 		$this->_set_display_strategy(new EE_Submit_Input_Display_Strategy());
18 18
 		$this->_set_normalization_strategy(new EE_Text_Normalization());
19
-		$this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() );
19
+		$this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
20 20
 		parent::__construct($options);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
strategies/display/EE_Submit_Input_Display_Strategy.strategy.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,18 +9,18 @@
 block discarded – undo
9 9
  * @package       Event Espresso
10 10
  * @author        Mike Nelson
11 11
  */
12
-class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base{
12
+class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base {
13 13
 	/**
14 14
 	 *
15 15
 	 * @return string of html to display the input
16 16
 	 */
17
-	public function display(){
17
+	public function display() {
18 18
 		$html = '<input type="submit" ';
19
-		$html .= 'name="' . $this->_input->html_name() . '" ';
20
-		$html .= 'value="' . $this->_input->raw_value_in_form() . '" ';
21
-		$html .= 'id="' . $this->_input->html_id() . '-submit" ';
22
-		$html .= 'class="' . $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() . '" ';
23
-		$html .= 'style="' . $this->_input->html_style() . '" ';
19
+		$html .= 'name="'.$this->_input->html_name().'" ';
20
+		$html .= 'value="'.$this->_input->raw_value_in_form().'" ';
21
+		$html .= 'id="'.$this->_input->html_id().'-submit" ';
22
+		$html .= 'class="'.$this->_input->html_class().' '.$this->_input->button_css_attributes().'" ';
23
+		$html .= 'style="'.$this->_input->html_style().'" ';
24 24
 		$html .= $this->_input->other_html_attributes();
25 25
 		$html .= '/>';
26 26
 		return $html;
Please login to merge, or discard this patch.
core/db_classes/EE_Line_Item.class.php 3 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 			if( isset( $this->_children[ $code ] ) ) {
672 672
 				unset( $this->_children[ $code ] );
673 673
 				return 1;
674
-			}else{
674
+			} else{
675 675
 				return 0;
676 676
 			}
677 677
 		}
@@ -1110,10 +1110,10 @@  discard block
 block discarded – undo
1110 1110
 					//that's taxable too (the taxable total so far)
1111 1111
 					if( $child_line_item->is_percent() ) {
1112 1112
 						$total = $total + ( $total * $child_line_item->percent() / 100 );
1113
-					}else{
1113
+					} else{
1114 1114
 						$total += $child_line_item->total();
1115 1115
 					}
1116
-				}elseif( $child_line_item->type() === EEM_Line_Item::type_sub_total ){
1116
+				} elseif( $child_line_item->type() === EEM_Line_Item::type_sub_total ){
1117 1117
 					$total += $child_line_item->taxable_total();
1118 1118
 				}
1119 1119
 			}
Please login to merge, or discard this patch.
Spacing   +209 added lines, -209 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 	 *                             		    date_format and the second value is the time format
51 51
 	 * @return EE_Line_Item
52 52
 	 */
53
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
54
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
55
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
53
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
54
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
55
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
56 56
 	}
57 57
 
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 *                          		the website will be used.
64 64
 	 * @return EE_Line_Item
65 65
 	 */
66
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
67
-		return new self( $props_n_values, TRUE, $timezone );
66
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
67
+		return new self($props_n_values, TRUE, $timezone);
68 68
 	}
69 69
 
70 70
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 * @param bool   $bydb
76 76
 	 * @param string $timezone
77 77
 	 */
78
-	protected function __construct( $fieldValues = array(), $bydb = FALSE, $timezone = '' ) {
79
-		parent::__construct( $fieldValues, $bydb, $timezone );
80
-		if ( ! $this->get( 'LIN_code' ) ) {
81
-			$this->set_code( $this->generate_code() );
78
+	protected function __construct($fieldValues = array(), $bydb = FALSE, $timezone = '') {
79
+		parent::__construct($fieldValues, $bydb, $timezone);
80
+		if ( ! $this->get('LIN_code')) {
81
+			$this->set_code($this->generate_code());
82 82
 		}
83 83
 	}
84 84
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @return int
90 90
 	 */
91 91
 	public function ID() {
92
-		return $this->get( 'LIN_ID' );
92
+		return $this->get('LIN_ID');
93 93
 	}
94 94
 
95 95
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return int
100 100
 	 */
101 101
 	public function TXN_ID() {
102
-		return $this->get( 'TXN_ID' );
102
+		return $this->get('TXN_ID');
103 103
 	}
104 104
 
105 105
 
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
 	 * Sets TXN_ID
109 109
 	 * @param int $TXN_ID
110 110
 	 */
111
-	public function set_TXN_ID( $TXN_ID ) {
112
-		$this->set( 'TXN_ID', $TXN_ID );
111
+	public function set_TXN_ID($TXN_ID) {
112
+		$this->set('TXN_ID', $TXN_ID);
113 113
 	}
114 114
 
115 115
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 	 * @return string
120 120
 	 */
121 121
 	public function name() {
122
-		$name =  $this->get( 'LIN_name' );
123
-		if( ! $name ){
124
-			$name = ucwords( str_replace( '-', ' ', $this->type() ) );
122
+		$name = $this->get('LIN_name');
123
+		if ( ! $name) {
124
+			$name = ucwords(str_replace('-', ' ', $this->type()));
125 125
 		}
126 126
 		return $name;
127 127
 	}
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 * Sets name
133 133
 	 * @param string $name
134 134
 	 */
135
-	public function set_name( $name ) {
136
-		$this->set( 'LIN_name', $name );
135
+	public function set_name($name) {
136
+		$this->set('LIN_name', $name);
137 137
 	}
138 138
 
139 139
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @return string
144 144
 	 */
145 145
 	public function desc() {
146
-		return $this->get( 'LIN_desc' );
146
+		return $this->get('LIN_desc');
147 147
 	}
148 148
 
149 149
 
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 	 * Sets desc
153 153
 	 * @param string $desc
154 154
 	 */
155
-	public function set_desc( $desc ) {
156
-		$this->set( 'LIN_desc', $desc );
155
+	public function set_desc($desc) {
156
+		$this->set('LIN_desc', $desc);
157 157
 	}
158 158
 
159 159
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 * @return int
164 164
 	 */
165 165
 	public function quantity() {
166
-		return $this->get( 'LIN_quantity' );
166
+		return $this->get('LIN_quantity');
167 167
 	}
168 168
 
169 169
 
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	 * Sets quantity
173 173
 	 * @param int $quantity
174 174
 	 */
175
-    public function set_quantity( $quantity ) {
176
-		$this->set( 'LIN_quantity', max( $quantity, 0 ) );
175
+    public function set_quantity($quantity) {
176
+		$this->set('LIN_quantity', max($quantity, 0));
177 177
 	}
178 178
 
179 179
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 * @return string
184 184
 	 */
185 185
 	public function OBJ_ID() {
186
-		return $this->get( 'OBJ_ID' );
186
+		return $this->get('OBJ_ID');
187 187
 	}
188 188
 
189 189
 
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 	 * Sets item_id
193 193
 	 * @param string $item_id
194 194
 	 */
195
-	public function set_OBJ_ID( $item_id ) {
196
-		$this->set( 'OBJ_ID', $item_id );
195
+	public function set_OBJ_ID($item_id) {
196
+		$this->set('OBJ_ID', $item_id);
197 197
 	}
198 198
 
199 199
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @return string
204 204
 	 */
205 205
 	public function OBJ_type() {
206
-		return $this->get( 'OBJ_type' );
206
+		return $this->get('OBJ_type');
207 207
 	}
208 208
 
209 209
 
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 	 * Sets item_type
241 241
 	 * @param string $OBJ_type
242 242
 	 */
243
-	public function set_OBJ_type( $OBJ_type ) {
244
-		$this->set( 'OBJ_type', $OBJ_type );
243
+	public function set_OBJ_type($OBJ_type) {
244
+		$this->set('OBJ_type', $OBJ_type);
245 245
 	}
246 246
 
247 247
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @return float
252 252
 	 */
253 253
 	public function unit_price() {
254
-		return $this->get( 'LIN_unit_price' );
254
+		return $this->get('LIN_unit_price');
255 255
 	}
256 256
 
257 257
 
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
 	 *
262 262
 	 * @param float $unit_price
263 263
 	 */
264
-	public function set_unit_price( $unit_price ) {
265
-		$this->set( 'LIN_unit_price', $unit_price );
264
+	public function set_unit_price($unit_price) {
265
+		$this->set('LIN_unit_price', $unit_price);
266 266
 	}
267 267
 
268 268
 
@@ -273,19 +273,19 @@  discard block
 block discarded – undo
273 273
 	 * @return boolean
274 274
 	 */
275 275
 	public function is_percent() {
276
-		if( $this->is_tax_sub_total() ) {
276
+		if ($this->is_tax_sub_total()) {
277 277
 			//tax subtotals HAVE a percent on them, that percentage only applies
278 278
 			//to taxable items, so its' an exception. Treat it like a flat line item
279 279
 			return false;
280 280
 		}
281
-		$unit_price = abs( $this->get( 'LIN_unit_price' ) );
282
-		$percent = abs( $this->get( 'LIN_percent' ) );
283
-		if ( $unit_price < .001 && $percent ) {
281
+		$unit_price = abs($this->get('LIN_unit_price'));
282
+		$percent = abs($this->get('LIN_percent'));
283
+		if ($unit_price < .001 && $percent) {
284 284
 			return TRUE;
285
-		} elseif ( $unit_price >= .001 && !$percent ) {
285
+		} elseif ($unit_price >= .001 && ! $percent) {
286 286
 			return FALSE;
287
-		} elseif ( $unit_price >= .001 && $percent ) {
288
-			throw new EE_Error( sprintf( __( "A Line Item can not have a unit price of (%s) AND a percent (%s)!", "event_espresso" ), $unit_price, $percent ) );
287
+		} elseif ($unit_price >= .001 && $percent) {
288
+			throw new EE_Error(sprintf(__("A Line Item can not have a unit price of (%s) AND a percent (%s)!", "event_espresso"), $unit_price, $percent));
289 289
 		} else {
290 290
 			// if they're both 0, assume its not a percent item
291 291
 			return FALSE;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @return float
300 300
 	 */
301 301
 	public function percent() {
302
-		return $this->get( 'LIN_percent' );
302
+		return $this->get('LIN_percent');
303 303
 	}
304 304
 
305 305
 
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 	 * Sets percent (between 100-0.01)
309 309
 	 * @param float $percent
310 310
 	 */
311
-	public function set_percent( $percent ) {
312
-		$this->set( 'LIN_percent', $percent );
311
+	public function set_percent($percent) {
312
+		$this->set('LIN_percent', $percent);
313 313
 	}
314 314
 
315 315
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @return float
320 320
 	 */
321 321
 	public function total() {
322
-		return $this->get( 'LIN_total' );
322
+		return $this->get('LIN_total');
323 323
 	}
324 324
 
325 325
 
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * Sets total
329 329
 	 * @param float $total
330 330
 	 */
331
-	public function set_total( $total ) {
332
-		$this->set( 'LIN_total', $total );
331
+	public function set_total($total) {
332
+		$this->set('LIN_total', $total);
333 333
 	}
334 334
 
335 335
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 * @return int
340 340
 	 */
341 341
 	public function order() {
342
-		return $this->get( 'LIN_order' );
342
+		return $this->get('LIN_order');
343 343
 	}
344 344
 
345 345
 
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
 	 * Sets order
349 349
 	 * @param int $order
350 350
 	 */
351
-	public function set_order( $order ) {
352
-		$this->set( 'LIN_order', $order );
351
+	public function set_order($order) {
352
+		$this->set('LIN_order', $order);
353 353
 	}
354 354
 
355 355
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	 * @return int
360 360
 	 */
361 361
 	public function parent_ID() {
362
-		return $this->get( 'LIN_parent' );
362
+		return $this->get('LIN_parent');
363 363
 	}
364 364
 
365 365
 
@@ -368,8 +368,8 @@  discard block
 block discarded – undo
368 368
 	 * Sets parent
369 369
 	 * @param int $parent
370 370
 	 */
371
-	public function set_parent_ID( $parent ) {
372
-		$this->set( 'LIN_parent', $parent );
371
+	public function set_parent_ID($parent) {
372
+		$this->set('LIN_parent', $parent);
373 373
 	}
374 374
 
375 375
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 	 * @return string
380 380
 	 */
381 381
 	public function type() {
382
-		return $this->get( 'LIN_type' );
382
+		return $this->get('LIN_type');
383 383
 	}
384 384
 
385 385
 
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 	 * Sets type
389 389
 	 * @param string $type
390 390
 	 */
391
-	public function set_type( $type ) {
392
-		$this->set( 'LIN_type', $type );
391
+	public function set_type($type) {
392
+		$this->set('LIN_type', $type);
393 393
 	}
394 394
 
395 395
 
@@ -402,8 +402,8 @@  discard block
 block discarded – undo
402 402
 	 * @return EE_Line_Item
403 403
 	 */
404 404
 	public function parent() {
405
-		if( $this->ID() ) {
406
-			return $this->get_model()->get_one_by_ID( $this->parent_ID() );
405
+		if ($this->ID()) {
406
+			return $this->get_model()->get_one_by_ID($this->parent_ID());
407 407
 		} else {
408 408
 			return $this->_parent;
409 409
 		}
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
 	 * @return EE_Line_Item[]
417 417
 	 */
418 418
 	public function children() {
419
-		if ( $this->ID() ) {
419
+		if ($this->ID()) {
420 420
 			return $this->get_model()->get_all(
421 421
 					array(
422
-						array( 'LIN_parent' => $this->ID() ),
423
-						'order_by' => array( 'LIN_order' => 'ASC' ) ) );
422
+						array('LIN_parent' => $this->ID()),
423
+						'order_by' => array('LIN_order' => 'ASC') ) );
424 424
 		} else {
425
-			if ( ! is_array( $this->_children ) ) {
425
+			if ( ! is_array($this->_children)) {
426 426
 				$this->_children = array();
427 427
 			}
428 428
 			return $this->_children;
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	 * @return string
437 437
 	 */
438 438
 	public function code() {
439
-		return $this->get( 'LIN_code' );
439
+		return $this->get('LIN_code');
440 440
 	}
441 441
 
442 442
 
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 	 * Sets code
446 446
 	 * @param string $code
447 447
 	 */
448
-	public function set_code( $code ) {
449
-		$this->set( 'LIN_code', $code );
448
+	public function set_code($code) {
449
+		$this->set('LIN_code', $code);
450 450
 	}
451 451
 
452 452
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	 * @return boolean
457 457
 	 */
458 458
 	public function is_taxable() {
459
-		return $this->get( 'LIN_is_taxable' );
459
+		return $this->get('LIN_is_taxable');
460 460
 	}
461 461
 
462 462
 
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 	 * Sets is_taxable
466 466
 	 * @param boolean $is_taxable
467 467
 	 */
468
-	public function set_is_taxable( $is_taxable ) {
469
-		$this->set( 'LIN_is_taxable', $is_taxable );
468
+	public function set_is_taxable($is_taxable) {
469
+		$this->set('LIN_is_taxable', $is_taxable);
470 470
 	}
471 471
 
472 472
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	 */
482 482
 	public function get_object() {
483 483
 		$model_name_of_related_obj = $this->OBJ_type();
484
-		return $this->get_model()->has_relation(  $model_name_of_related_obj ) ? $this->get_first_related( $model_name_of_related_obj ) : NULL;
484
+		return $this->get_model()->has_relation($model_name_of_related_obj) ? $this->get_first_related($model_name_of_related_obj) : NULL;
485 485
 	}
486 486
 
487 487
 
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
 	 * @param array $query_params
493 493
 	 * @return EE_Ticket
494 494
 	 */
495
-	public function ticket( $query_params = array() ) {
495
+	public function ticket($query_params = array()) {
496 496
 		//we're going to assume that when this method is called we always want to receive the attached ticket EVEN if that ticket is archived.  This can be overridden via the incoming $query_params argument
497
-		$remove_defaults = array( 'default_where_conditions' => 'none' );
498
-		$query_params = array_merge( $remove_defaults, $query_params );
499
-		return $this->get_first_related( 'Ticket', $query_params );
497
+		$remove_defaults = array('default_where_conditions' => 'none');
498
+		$query_params = array_merge($remove_defaults, $query_params);
499
+		return $this->get_first_related('Ticket', $query_params);
500 500
 	}
501 501
 
502 502
 
@@ -506,11 +506,11 @@  discard block
 block discarded – undo
506 506
 	 * @return EE_Datetime | NULL
507 507
 	 */
508 508
 	public function get_ticket_datetime() {
509
-		if ( $this->OBJ_type() === 'Ticket' ) {
509
+		if ($this->OBJ_type() === 'Ticket') {
510 510
 			$ticket = $this->ticket();
511
-			if ( $ticket instanceof EE_Ticket ) {
511
+			if ($ticket instanceof EE_Ticket) {
512 512
 				$datetime = $ticket->first_datetime();
513
-				if ( $datetime instanceof EE_Datetime ) {
513
+				if ($datetime instanceof EE_Datetime) {
514 514
 					return $datetime;
515 515
 				}
516 516
 			}
@@ -526,9 +526,9 @@  discard block
 block discarded – undo
526 526
 	 * @return string
527 527
 	 */
528 528
 	public function ticket_event_name() {
529
-		$event_name = __( "Unknown", "event_espresso" );
529
+		$event_name = __("Unknown", "event_espresso");
530 530
 		$event = $this->ticket_event();
531
-		if ( $event instanceof EE_Event ) {
531
+		if ($event instanceof EE_Event) {
532 532
 			$event_name = $event->name();
533 533
 		}
534 534
 		return $event_name;
@@ -542,9 +542,9 @@  discard block
 block discarded – undo
542 542
 	public function ticket_event() {
543 543
 		$event = null;
544 544
 		$ticket = $this->ticket();
545
-		if ( $ticket instanceof EE_Ticket ) {
545
+		if ($ticket instanceof EE_Ticket) {
546 546
 			$datetime = $ticket->first_datetime();
547
-			if ( $datetime instanceof EE_Datetime ) {
547
+			if ($datetime instanceof EE_Datetime) {
548 548
 				$event = $datetime->event();
549 549
 			}
550 550
 		}
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 	 * @param string $time_format
560 560
 	 * @return string
561 561
 	 */
562
-	public function ticket_datetime_start( $date_format = '', $time_format = '' ) {
563
-		$first_datetime_string = __( "Unknown", "event_espresso" );
562
+	public function ticket_datetime_start($date_format = '', $time_format = '') {
563
+		$first_datetime_string = __("Unknown", "event_espresso");
564 564
 		$datetime = $this->get_ticket_datetime();
565
-		if ( $datetime ) {
566
-			$first_datetime_string = $datetime->start_date_and_time( $date_format, $time_format );
565
+		if ($datetime) {
566
+			$first_datetime_string = $datetime->start_date_and_time($date_format, $time_format);
567 567
 		}
568 568
 		return $first_datetime_string;
569 569
 	}
@@ -578,26 +578,26 @@  discard block
 block discarded – undo
578 578
 	 * @return bool success
579 579
 	 * @throws \EE_Error
580 580
 	 */
581
-	public function add_child_line_item( EEI_Line_Item $line_item, $set_order = true ) {
581
+	public function add_child_line_item(EEI_Line_Item $line_item, $set_order = true) {
582 582
 		// should we calculate the LIN_order for this line item ?
583
-		if ( $set_order || $line_item->order() === null ) {
584
-			$line_item->set_order( count( $this->children() ) );
583
+		if ($set_order || $line_item->order() === null) {
584
+			$line_item->set_order(count($this->children()));
585 585
 		}
586
-		if ( $this->ID() ) {
586
+		if ($this->ID()) {
587 587
 			//check for any duplicate line items (with the same code), if so, this replaces it
588
-			$line_item_with_same_code = $this->get_child_line_item(  $line_item->code() );
589
-			if( $line_item_with_same_code instanceof EE_Line_Item && $line_item_with_same_code !== $line_item ) {
590
-				$this->delete_child_line_item( $line_item_with_same_code->code() );
588
+			$line_item_with_same_code = $this->get_child_line_item($line_item->code());
589
+			if ($line_item_with_same_code instanceof EE_Line_Item && $line_item_with_same_code !== $line_item) {
590
+				$this->delete_child_line_item($line_item_with_same_code->code());
591 591
 			}
592
-			$line_item->set_parent_ID( $this->ID() );
593
-			if( $this->TXN_ID() ){
594
-				$line_item->set_TXN_ID( $this->TXN_ID() );
592
+			$line_item->set_parent_ID($this->ID());
593
+			if ($this->TXN_ID()) {
594
+				$line_item->set_TXN_ID($this->TXN_ID());
595 595
 			}
596 596
 			return $line_item->save();
597 597
 		} else {
598
-			$this->_children[ $line_item->code() ] = $line_item;
599
-			if( $line_item->parent() != $this ) {
600
-				$line_item->set_parent( $this );
598
+			$this->_children[$line_item->code()] = $line_item;
599
+			if ($line_item->parent() != $this) {
600
+				$line_item->set_parent($this);
601 601
 			}
602 602
 			return TRUE;
603 603
 		}
@@ -611,16 +611,16 @@  discard block
 block discarded – undo
611 611
 	 * @param EE_Line_Item $line_item
612 612
 	 *
613 613
 	 */
614
-	public function set_parent( $line_item ) {
615
-		if ( $this->ID() ) {
616
-			if( ! $line_item->ID() ) {
614
+	public function set_parent($line_item) {
615
+		if ($this->ID()) {
616
+			if ( ! $line_item->ID()) {
617 617
 				$line_item->save();
618 618
 			}
619
-			$this->set_parent_ID( $line_item->ID() );
619
+			$this->set_parent_ID($line_item->ID());
620 620
 			$this->save();
621 621
 		} else {
622 622
 			$this->_parent = $line_item;
623
-			$this->set_parent_ID( $line_item->ID() );
623
+			$this->set_parent_ID($line_item->ID());
624 624
 		}
625 625
 	}
626 626
 
@@ -633,11 +633,11 @@  discard block
 block discarded – undo
633 633
 	 * @param string $code
634 634
 	 * @return EE_Line_Item
635 635
 	 */
636
-	public function get_child_line_item( $code ) {
637
-		if ( $this->ID() ) {
638
-			return $this->get_model()->get_one( array( array( 'LIN_parent' => $this->ID(), 'LIN_code' => $code ) ) );
636
+	public function get_child_line_item($code) {
637
+		if ($this->ID()) {
638
+			return $this->get_model()->get_one(array(array('LIN_parent' => $this->ID(), 'LIN_code' => $code)));
639 639
 		} else {
640
-			return isset( $this->_children[ $code ] ) ? $this->_children[ $code ] : null;
640
+			return isset($this->_children[$code]) ? $this->_children[$code] : null;
641 641
 		}
642 642
 	}
643 643
 
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 	 * @return int
649 649
 	 */
650 650
 	public function delete_children_line_items() {
651
-		if ( $this->ID() ) {
652
-			return $this->get_model()->delete( array( array( 'LIN_parent' => $this->ID() ) ) );
651
+		if ($this->ID()) {
652
+			return $this->get_model()->delete(array(array('LIN_parent' => $this->ID())));
653 653
 		} else {
654
-			$count = count( $this->_children );
654
+			$count = count($this->_children);
655 655
 			$this->_children = array();
656 656
 			return $count;
657 657
 		}
@@ -668,25 +668,25 @@  discard block
 block discarded – undo
668 668
 	 * @param bool $stop_search_once_found
669 669
 	 * @return int count of items deleted (or simply removed from the line item's cache, if not has not been saved to the DB yet)
670 670
 	 */
671
-	public function delete_child_line_item( $code, $stop_search_once_found = true ) {
672
-		if ( $this->ID() ) {
671
+	public function delete_child_line_item($code, $stop_search_once_found = true) {
672
+		if ($this->ID()) {
673 673
 			$items_deleted = 0;
674
-			if( $this->code() == $code ) {
675
-				$items_deleted += EEH_Line_Item::delete_all_child_items( $this );
674
+			if ($this->code() == $code) {
675
+				$items_deleted += EEH_Line_Item::delete_all_child_items($this);
676 676
 				$items_deleted += (int) $this->delete();
677
-				if( $stop_search_once_found ){
677
+				if ($stop_search_once_found) {
678 678
 					return $items_deleted;
679 679
 				}
680 680
 			}
681
-			foreach( $this->children() as $child_line_item ) {
682
-				$items_deleted += $child_line_item->delete_child_line_item( $code, $stop_search_once_found );
681
+			foreach ($this->children() as $child_line_item) {
682
+				$items_deleted += $child_line_item->delete_child_line_item($code, $stop_search_once_found);
683 683
 			}
684 684
 			return $items_deleted;
685 685
 		} else {
686
-			if( isset( $this->_children[ $code ] ) ) {
687
-				unset( $this->_children[ $code ] );
686
+			if (isset($this->_children[$code])) {
687
+				unset($this->_children[$code]);
688 688
 				return 1;
689
-			}else{
689
+			} else {
690 690
 				return 0;
691 691
 			}
692 692
 		}
@@ -699,9 +699,9 @@  discard block
 block discarded – undo
699 699
 	 * @return boolean
700 700
 	 */
701 701
 	public function delete_if_childless_subtotal() {
702
-		if( $this->ID() &&
702
+		if ($this->ID() &&
703 703
 				$this->type() == EEM_Line_Item::type_sub_total &&
704
-				! $this->children() ) {
704
+				! $this->children()) {
705 705
 			return $this->delete();
706 706
 		} else {
707 707
 			return false;
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 	 */
717 717
 	public function generate_code() {
718 718
 		// each line item in the cart requires a unique identifier
719
-		return md5( $this->get( 'OBJ_type' ) . $this->get( 'OBJ_ID' ) . microtime() );
719
+		return md5($this->get('OBJ_type').$this->get('OBJ_ID').microtime());
720 720
 	}
721 721
 
722 722
 
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 	 * @return string like '2, 004.00', formatted according to the localized currency
800 800
 	 */
801 801
 	public function unit_price_no_code() {
802
-		return $this->get_pretty( 'LIN_unit_price', 'no_currency_code' );
802
+		return $this->get_pretty('LIN_unit_price', 'no_currency_code');
803 803
 	}
804 804
 
805 805
 
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	 * @return string like '2, 004.00', formatted according to the localized currency
810 810
 	 */
811 811
 	public function total_no_code() {
812
-		return $this->get_pretty( 'LIN_total', 'no_currency_code' );
812
+		return $this->get_pretty('LIN_total', 'no_currency_code');
813 813
 	}
814 814
 
815 815
 
@@ -829,17 +829,17 @@  discard block
 block discarded – undo
829 829
 		$tax_total = $this->recalculate_taxes_and_tax_total();
830 830
 		$total = $pre_tax_total + $tax_total;
831 831
 		// no negative totals plz
832
-		$total = max( $total, 0 );
833
-		$this->set_total( $total );
832
+		$total = max($total, 0);
833
+		$this->set_total($total);
834 834
 		//only update the related transaction's total
835 835
 		//if we intend to save this line item and its a grand total
836
-		if(
836
+		if (
837 837
 			$this->allow_persist() &&
838 838
 			$this->type() === EEM_Line_Item::type_total &&
839 839
 			$this->transaction() instanceof EE_Transaction
840
-		){
841
-			$this->transaction()->set_total( $total );
842
-			if ( $this->transaction()->ID() ) {
840
+		) {
841
+			$this->transaction()->set_total($total);
842
+			if ($this->transaction()->ID()) {
843 843
 				$this->transaction()->save();
844 844
 			}
845 845
 		}
@@ -858,47 +858,47 @@  discard block
 block discarded – undo
858 858
 	public function recalculate_pre_tax_total() {
859 859
 		$total = 0;
860 860
 		$my_children = $this->children();
861
-		$has_children = ! empty( $my_children );
862
-		if ( $has_children && $this->is_line_item() ) {
863
-			$total = $this->_recalculate_pretax_total_for_line_item( $total, $my_children );
864
-		} elseif ( ! $has_children && ( $this->is_sub_line_item() || $this->is_line_item() ) ) {
861
+		$has_children = ! empty($my_children);
862
+		if ($has_children && $this->is_line_item()) {
863
+			$total = $this->_recalculate_pretax_total_for_line_item($total, $my_children);
864
+		} elseif ( ! $has_children && ($this->is_sub_line_item() || $this->is_line_item())) {
865 865
 			$total = $this->unit_price() * $this->quantity();
866
-		} elseif( $this->is_sub_total() || $this->is_total() ) {
867
-			$total = $this->_recalculate_pretax_total_for_subtotal( $total, $my_children );
868
-		} elseif ( $this->is_tax_sub_total() || $this->is_tax() || $this->is_cancelled() ) {
866
+		} elseif ($this->is_sub_total() || $this->is_total()) {
867
+			$total = $this->_recalculate_pretax_total_for_subtotal($total, $my_children);
868
+		} elseif ($this->is_tax_sub_total() || $this->is_tax() || $this->is_cancelled()) {
869 869
 			// completely ignore tax totals, tax sub-totals, and cancelled line items, when calculating the pre-tax-total
870 870
 			return 0;
871 871
 		}
872 872
 		// ensure all non-line items and non-sub-line-items have a quantity of 1 (except for Events)
873
-		if(
873
+		if (
874 874
 			! $this->is_line_item() &&
875 875
 			! $this->is_sub_line_item() &&
876 876
 			! $this->is_cancellation()
877 877
 		) {
878
-			if ( $this->OBJ_type() !== 'Event' ) {
879
-				$this->set_quantity( 1 );
878
+			if ($this->OBJ_type() !== 'Event') {
879
+				$this->set_quantity(1);
880 880
 			}
881
-			if( ! $this->is_percent() ) {
882
-				$this->set_unit_price( $this->total() );
881
+			if ( ! $this->is_percent()) {
882
+				$this->set_unit_price($this->total());
883 883
 			}
884 884
 		}
885 885
 
886 886
 		//we don't want to bother saving grand totals, because that needs to factor in taxes anyways
887 887
 		//so it ought to be
888
-		if( ! $this->is_total() ) {
889
-			$this->set_total( $total );
888
+		if ( ! $this->is_total()) {
889
+			$this->set_total($total);
890 890
 			//if not a percent line item, make sure we keep the unit price in sync
891
-			if(
891
+			if (
892 892
 				$has_children
893 893
 				&& $this->is_line_item()
894 894
 				&& ! $this->is_percent()
895 895
 			) {
896
-				if( $this->quantity() === 0 ){
896
+				if ($this->quantity() === 0) {
897 897
 					$new_unit_price = 0;
898 898
 				} else {
899 899
 					$new_unit_price = $this->total() / $this->quantity();
900 900
 				}
901
-				$this->set_unit_price( $new_unit_price );
901
+				$this->set_unit_price($new_unit_price);
902 902
 			}
903 903
 			$this->maybe_save();
904 904
 		}
@@ -918,39 +918,39 @@  discard block
 block discarded – undo
918 918
 	 * @return float
919 919
 	 * @throws \EE_Error
920 920
 	 */
921
-	protected function _recalculate_pretax_total_for_subtotal( $calculated_total_so_far, $my_children = null ) {
922
-		if( $my_children === null ) {
921
+	protected function _recalculate_pretax_total_for_subtotal($calculated_total_so_far, $my_children = null) {
922
+		if ($my_children === null) {
923 923
 			$my_children = $this->children();
924 924
 		}
925 925
 		//get the total of all its children
926
-		foreach ( $my_children as $child_line_item ) {
927
-			if ( $child_line_item instanceof EE_Line_Item && ! $child_line_item->is_cancellation() ) {
926
+		foreach ($my_children as $child_line_item) {
927
+			if ($child_line_item instanceof EE_Line_Item && ! $child_line_item->is_cancellation()) {
928 928
 				// percentage line items are based on total so far
929
-				if ( $child_line_item->is_percent() ) {
929
+				if ($child_line_item->is_percent()) {
930 930
 					//round as we go so that the line items add up ok
931 931
 					$percent_total = round(
932 932
 						$calculated_total_so_far * $child_line_item->percent() / 100,
933 933
 						EE_Registry::instance()->CFG->currency->dec_plc
934 934
 					);
935
-					$child_line_item->set_total( $percent_total );
935
+					$child_line_item->set_total($percent_total);
936 936
 					//so far all percent line items should have a quantity of 1
937 937
 					//(ie, no double percent discounts. Although that might be requested someday)
938
-					$child_line_item->set_quantity( 1 );
938
+					$child_line_item->set_quantity(1);
939 939
 					$child_line_item->maybe_save();
940 940
 					$calculated_total_so_far += $percent_total;
941 941
 				} else {
942 942
 					//verify flat sub-line-item quantities match their parent
943
-					if( $child_line_item->is_sub_line_item() ) {
944
-						$child_line_item->set_quantity( $this->quantity() );
943
+					if ($child_line_item->is_sub_line_item()) {
944
+						$child_line_item->set_quantity($this->quantity());
945 945
 					}
946 946
 					$calculated_total_so_far += $child_line_item->recalculate_pre_tax_total();
947 947
 				}
948 948
 			}
949 949
 		}
950 950
 
951
-		if( $this->is_sub_total() ){
951
+		if ($this->is_sub_total()) {
952 952
 			// no negative totals plz
953
-			$calculated_total_so_far = max( $calculated_total_so_far, 0 );
953
+			$calculated_total_so_far = max($calculated_total_so_far, 0);
954 954
 		}
955 955
 		return $calculated_total_so_far;
956 956
 	}
@@ -968,8 +968,8 @@  discard block
 block discarded – undo
968 968
 	 * @return float
969 969
 	 * @throws \EE_Error
970 970
 	 */
971
-	protected function _recalculate_pretax_total_for_line_item( $calculated_total_so_far, $my_children = null ) {
972
-		if( $my_children === null ) {
971
+	protected function _recalculate_pretax_total_for_line_item($calculated_total_so_far, $my_children = null) {
972
+		if ($my_children === null) {
973 973
 			$my_children = $this->children();
974 974
 		}
975 975
 		//we need to keep track of the running total for a single item,
@@ -977,10 +977,10 @@  discard block
 block discarded – undo
977 977
 		$unit_price_for_total = 0;
978 978
 		$quantity_for_total = 1;
979 979
 		//get the total of all its children
980
-		foreach ( $my_children as $child_line_item ) {
981
-			if ( $child_line_item instanceof EE_Line_Item &&
980
+		foreach ($my_children as $child_line_item) {
981
+			if ($child_line_item instanceof EE_Line_Item &&
982 982
 					! $child_line_item->is_cancellation()) {
983
-				if ( $child_line_item->is_percent() ) {
983
+				if ($child_line_item->is_percent()) {
984 984
 					//it should be the unit-price-so-far multiplied by teh percent multiplied by the quantity
985 985
 					//not total multiplied by percent, because that ignores rounding along-the-way
986 986
 					$percent_unit_price = round(
@@ -988,17 +988,17 @@  discard block
 block discarded – undo
988 988
 						EE_Registry::instance()->CFG->currency->dec_plc
989 989
 					);
990 990
 					$percent_total = $percent_unit_price * $quantity_for_total;
991
-					$child_line_item->set_total( $percent_total );
991
+					$child_line_item->set_total($percent_total);
992 992
 					//so far all percent line items should have a quantity of 1
993 993
 					//(ie, no double percent discounts. Although that might be requested someday)
994
-					$child_line_item->set_quantity( 1 );
994
+					$child_line_item->set_quantity(1);
995 995
 					$child_line_item->maybe_save();
996 996
 					$calculated_total_so_far += $percent_total;
997 997
 					$unit_price_for_total += $percent_unit_price;
998 998
 				} else {
999 999
 					//verify flat sub-line-item quantities match their parent
1000
-					if( $child_line_item->is_sub_line_item() ) {
1001
-						$child_line_item->set_quantity( $this->quantity() );
1000
+					if ($child_line_item->is_sub_line_item()) {
1001
+						$child_line_item->set_quantity($this->quantity());
1002 1002
 					}
1003 1003
 					$quantity_for_total = $child_line_item->quantity();
1004 1004
 					$calculated_total_so_far += $child_line_item->recalculate_pre_tax_total();
@@ -1022,10 +1022,10 @@  discard block
 block discarded – undo
1022 1022
 		//calculate the pretax total
1023 1023
 		$taxable_total = $this->taxable_total();
1024 1024
 		$tax_total = 0;
1025
-		foreach ( $taxes as $tax ) {
1025
+		foreach ($taxes as $tax) {
1026 1026
 			$total_on_this_tax = $taxable_total * $tax->percent() / 100;
1027 1027
 			//remember the total on this line item
1028
-			$tax->set_total( $total_on_this_tax );
1028
+			$tax->set_total($total_on_this_tax);
1029 1029
 			$tax_total += $tax->total();
1030 1030
 		}
1031 1031
 		$this->_recalculate_tax_sub_total();
@@ -1039,21 +1039,21 @@  discard block
 block discarded – undo
1039 1039
 	 * @return void
1040 1040
 	 */
1041 1041
 	private function _recalculate_tax_sub_total() {
1042
-		if ( $this->is_tax_sub_total() ) {
1042
+		if ($this->is_tax_sub_total()) {
1043 1043
 			$total = 0;
1044 1044
 			$total_percent = 0;
1045 1045
 			//simply loop through all its children (which should be taxes) and sum their total
1046
-			foreach ( $this->children() as $child_tax ) {
1047
-				if ( $child_tax instanceof EE_Line_Item ) {
1046
+			foreach ($this->children() as $child_tax) {
1047
+				if ($child_tax instanceof EE_Line_Item) {
1048 1048
 					$total += $child_tax->total();
1049 1049
 					$total_percent += $child_tax->percent();
1050 1050
 				}
1051 1051
 			}
1052
-			$this->set_total( $total );
1053
-			$this->set_percent( $total_percent );
1054
-		} elseif ( $this->is_total() ) {
1055
-			foreach ( $this->children() as $maybe_tax_subtotal ) {
1056
-				if ( $maybe_tax_subtotal instanceof EE_Line_Item ) {
1052
+			$this->set_total($total);
1053
+			$this->set_percent($total_percent);
1054
+		} elseif ($this->is_total()) {
1055
+			foreach ($this->children() as $maybe_tax_subtotal) {
1056
+				if ($maybe_tax_subtotal instanceof EE_Line_Item) {
1057 1057
 					$maybe_tax_subtotal->_recalculate_tax_sub_total();
1058 1058
 				}
1059 1059
 			}
@@ -1069,8 +1069,8 @@  discard block
 block discarded – undo
1069 1069
 	public function get_total_tax() {
1070 1070
 		$this->_recalculate_tax_sub_total();
1071 1071
 		$total = 0;
1072
-		foreach ( $this->tax_descendants() as $tax_line_item ) {
1073
-			if ( $tax_line_item instanceof EE_Line_Item ) {
1072
+		foreach ($this->tax_descendants() as $tax_line_item) {
1073
+			if ($tax_line_item instanceof EE_Line_Item) {
1074 1074
 				$total += $tax_line_item->total();
1075 1075
 			}
1076 1076
 		}
@@ -1084,15 +1084,15 @@  discard block
 block discarded – undo
1084 1084
 	 */
1085 1085
 	public function get_items_total() {
1086 1086
 		//by default, let's make sure we're consistent with the existing line item
1087
-		if( $this->is_total() ) {
1088
-			$pretax_subtotal_li = EEH_Line_Item::get_pre_tax_subtotal( $this );
1089
-			if( $pretax_subtotal_li instanceof EE_Line_Item ) {
1087
+		if ($this->is_total()) {
1088
+			$pretax_subtotal_li = EEH_Line_Item::get_pre_tax_subtotal($this);
1089
+			if ($pretax_subtotal_li instanceof EE_Line_Item) {
1090 1090
 				return $pretax_subtotal_li->total();
1091 1091
 			}
1092 1092
 		}
1093 1093
 		$total = 0;
1094
-		foreach ( $this->get_items() as $item ) {
1095
-			if ( $item instanceof EE_Line_Item ) {
1094
+		foreach ($this->get_items() as $item) {
1095
+			if ($item instanceof EE_Line_Item) {
1096 1096
 				$total += $item->total();
1097 1097
 			}
1098 1098
 		}
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 	 * @return EE_Line_Item[]
1108 1108
 	 */
1109 1109
 	public function tax_descendants() {
1110
-		return EEH_Line_Item::get_tax_descendants( $this );
1110
+		return EEH_Line_Item::get_tax_descendants($this);
1111 1111
 	}
1112 1112
 
1113 1113
 
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 	 * @return EE_Line_Item[]
1118 1118
 	 */
1119 1119
 	public function get_items() {
1120
-		return EEH_Line_Item::get_line_item_descendants( $this );
1120
+		return EEH_Line_Item::get_line_item_descendants($this);
1121 1121
 	}
1122 1122
 
1123 1123
 
@@ -1133,22 +1133,22 @@  discard block
 block discarded – undo
1133 1133
 	 */
1134 1134
 	public function taxable_total() {
1135 1135
 		$total = 0;
1136
-		if ( $this->children() ) {
1137
-			foreach ( $this->children() as $child_line_item ) {
1138
-				if ( $child_line_item->type() === EEM_Line_Item::type_line_item && $child_line_item->is_taxable()) {
1136
+		if ($this->children()) {
1137
+			foreach ($this->children() as $child_line_item) {
1138
+				if ($child_line_item->type() === EEM_Line_Item::type_line_item && $child_line_item->is_taxable()) {
1139 1139
 					//if it's a percent item, only take into account the percent
1140 1140
 					//that's taxable too (the taxable total so far)
1141
-					if( $child_line_item->is_percent() ) {
1142
-						$total = $total + ( $total * $child_line_item->percent() / 100 );
1143
-					}else{
1141
+					if ($child_line_item->is_percent()) {
1142
+						$total = $total + ($total * $child_line_item->percent() / 100);
1143
+					} else {
1144 1144
 						$total += $child_line_item->total();
1145 1145
 					}
1146
-				}elseif( $child_line_item->type() === EEM_Line_Item::type_sub_total ){
1146
+				}elseif ($child_line_item->type() === EEM_Line_Item::type_sub_total) {
1147 1147
 					$total += $child_line_item->taxable_total();
1148 1148
 				}
1149 1149
 			}
1150 1150
 		}
1151
-		return max( $total, 0 );
1151
+		return max($total, 0);
1152 1152
 	}
1153 1153
 
1154 1154
 
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 	 * @return EE_Transaction
1159 1159
 	 */
1160 1160
 	public function transaction() {
1161
-		return $this->get_first_related( 'Transaction' );
1161
+		return $this->get_first_related('Transaction');
1162 1162
 	}
1163 1163
 
1164 1164
 
@@ -1171,18 +1171,18 @@  discard block
 block discarded – undo
1171 1171
 	 * @param int $txn_id if none is provided, assumes $this->TXN_ID()
1172 1172
 	 * @return int count of items saved
1173 1173
 	 */
1174
-	public function save_this_and_descendants_to_txn( $txn_id = NULL ) {
1174
+	public function save_this_and_descendants_to_txn($txn_id = NULL) {
1175 1175
 		$count = 0;
1176
-		if ( ! $txn_id ) {
1176
+		if ( ! $txn_id) {
1177 1177
 			$txn_id = $this->TXN_ID();
1178 1178
 		}
1179
-		$this->set_TXN_ID( $txn_id );
1179
+		$this->set_TXN_ID($txn_id);
1180 1180
 		$children = $this->children();
1181 1181
 		$count += $this->save() ? 1 : 0;
1182
-		foreach ( $children as $child_line_item ) {
1183
-			if ( $child_line_item instanceof EE_Line_Item ) {
1184
-				$child_line_item->set_parent_ID( $this->ID() );
1185
-				$count += $child_line_item->save_this_and_descendants_to_txn( $txn_id );
1182
+		foreach ($children as $child_line_item) {
1183
+			if ($child_line_item instanceof EE_Line_Item) {
1184
+				$child_line_item->set_parent_ID($this->ID());
1185
+				$count += $child_line_item->save_this_and_descendants_to_txn($txn_id);
1186 1186
 			}
1187 1187
 		}
1188 1188
 		return $count;
@@ -1199,9 +1199,9 @@  discard block
 block discarded – undo
1199 1199
 		$count = 0;
1200 1200
 		$children = $this->children();
1201 1201
 		$count += $this->save() ? 1 : 0;
1202
-		foreach ( $children as $child_line_item ) {
1203
-			if ( $child_line_item instanceof EE_Line_Item ) {
1204
-				$child_line_item->set_parent_ID( $this->ID() );
1202
+		foreach ($children as $child_line_item) {
1203
+			if ($child_line_item instanceof EE_Line_Item) {
1204
+				$child_line_item->set_parent_ID($this->ID());
1205 1205
 				$count += $child_line_item->save_this_and_descendants();
1206 1206
 			}
1207 1207
 		}
@@ -1215,8 +1215,8 @@  discard block
 block discarded – undo
1215 1215
 	 * @return EE_Line_Item[]
1216 1216
 	 */
1217 1217
 	public function get_cancellations() {
1218
-		EE_Registry::instance()->load_helper( 'Line_Item' );
1219
-		return EEH_Line_Item::get_descendants_of_type( $this, EEM_Line_Item::type_cancellation );
1218
+		EE_Registry::instance()->load_helper('Line_Item');
1219
+		return EEH_Line_Item::get_descendants_of_type($this, EEM_Line_Item::type_cancellation);
1220 1220
 	}
1221 1221
 
1222 1222
 
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
 	 * @return int count of items saved
1228 1228
 	 */
1229 1229
 	public function maybe_save() {
1230
-		if ( $this->ID() ) {
1230
+		if ($this->ID()) {
1231 1231
 			return $this->save();
1232 1232
 		}
1233 1233
 		return false;
Please login to merge, or discard this patch.
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * Sets quantity
173 173
 	 * @param int $quantity
174 174
 	 */
175
-    public function set_quantity( $quantity ) {
175
+	public function set_quantity( $quantity ) {
176 176
 		$this->set( 'LIN_quantity', max( $quantity, 0 ) );
177 177
 	}
178 178
 
@@ -212,25 +212,25 @@  discard block
 block discarded – undo
212 212
 	 * Gets item_type
213 213
 	 * @return string
214 214
 	 */
215
-    public function OBJ_type_i18n() {
216
-	    $obj_type = $this->OBJ_type();
217
-        switch ($obj_type) {
218
-            case 'Event':
219
-                $obj_type = __('Event', 'event_espresso');
220
-                break;
221
-            case 'Price':
222
-                $obj_type = __('Price', 'event_espresso');
223
-                break;
224
-            case 'Promotion':
225
-                $obj_type = __('Promotion', 'event_espresso');
226
-                break;
227
-            case 'Ticket':
228
-                $obj_type = __('Ticket', 'event_espresso');
229
-                break;
230
-            case 'Transaction':
231
-                $obj_type = __('Transaction', 'event_espresso');
232
-                break;
233
-        }
215
+	public function OBJ_type_i18n() {
216
+		$obj_type = $this->OBJ_type();
217
+		switch ($obj_type) {
218
+			case 'Event':
219
+				$obj_type = __('Event', 'event_espresso');
220
+				break;
221
+			case 'Price':
222
+				$obj_type = __('Price', 'event_espresso');
223
+				break;
224
+			case 'Promotion':
225
+				$obj_type = __('Promotion', 'event_espresso');
226
+				break;
227
+			case 'Ticket':
228
+				$obj_type = __('Ticket', 'event_espresso');
229
+				break;
230
+			case 'Transaction':
231
+				$obj_type = __('Transaction', 'event_espresso');
232
+				break;
233
+		}
234 234
 		return apply_filters('FHEE__EE_Line_Item__OBJ_type_i18n', $obj_type, $this);
235 235
 	}
236 236
 
@@ -1244,48 +1244,48 @@  discard block
 block discarded – undo
1244 1244
 
1245 1245
 
1246 1246
 
1247
-    /**
1248
-     * @param bool $raw
1249
-     * @return int
1250
-     * @throws \EE_Error
1251
-     */
1252
-    public function timestamp($raw = false)
1253
-    {
1254
-        return $raw ? $this->get_raw('LIN_timestamp') : $this->get('LIN_timestamp');
1255
-    }
1247
+	/**
1248
+	 * @param bool $raw
1249
+	 * @return int
1250
+	 * @throws \EE_Error
1251
+	 */
1252
+	public function timestamp($raw = false)
1253
+	{
1254
+		return $raw ? $this->get_raw('LIN_timestamp') : $this->get('LIN_timestamp');
1255
+	}
1256 1256
 
1257 1257
 
1258 1258
 
1259 1259
 
1260
-    /************************* DEPRECATED *************************/
1260
+	/************************* DEPRECATED *************************/
1261 1261
 
1262 1262
 
1263 1263
 
1264
-    /**
1265
-     * @deprecated 4.6.0
1266
-     * @param string $type one of the constants on EEM_Line_Item
1267
-     * @return EE_Line_Item[]
1268
-     */
1269
-    protected function _get_descendants_of_type($type)
1270
-    {
1271
-        EE_Error::doing_it_wrong('EE_Line_Item::_get_descendants_of_type()',
1272
-            __('Method replaced with EEH_Line_Item::get_descendants_of_type()', 'event_espresso'), '4.6.0');
1273
-        return EEH_Line_Item::get_descendants_of_type($this, $type);
1274
-    }
1264
+	/**
1265
+	 * @deprecated 4.6.0
1266
+	 * @param string $type one of the constants on EEM_Line_Item
1267
+	 * @return EE_Line_Item[]
1268
+	 */
1269
+	protected function _get_descendants_of_type($type)
1270
+	{
1271
+		EE_Error::doing_it_wrong('EE_Line_Item::_get_descendants_of_type()',
1272
+			__('Method replaced with EEH_Line_Item::get_descendants_of_type()', 'event_espresso'), '4.6.0');
1273
+		return EEH_Line_Item::get_descendants_of_type($this, $type);
1274
+	}
1275 1275
 
1276 1276
 
1277 1277
 
1278
-    /**
1279
-     * @deprecated 4.6.0
1280
-     * @param string $type like one of the EEM_Line_Item::type_*
1281
-     * @return EE_Line_Item
1282
-     */
1283
-    public function get_nearest_descendant_of_type($type)
1284
-    {
1285
-        EE_Error::doing_it_wrong('EE_Line_Item::get_nearest_descendant_of_type()',
1286
-            __('Method replaced with EEH_Line_Item::get_nearest_descendant_of_type()', 'event_espresso'), '4.6.0');
1287
-        return EEH_Line_Item::get_nearest_descendant_of_type($this, $type);
1288
-    }
1278
+	/**
1279
+	 * @deprecated 4.6.0
1280
+	 * @param string $type like one of the EEM_Line_Item::type_*
1281
+	 * @return EE_Line_Item
1282
+	 */
1283
+	public function get_nearest_descendant_of_type($type)
1284
+	{
1285
+		EE_Error::doing_it_wrong('EE_Line_Item::get_nearest_descendant_of_type()',
1286
+			__('Method replaced with EEH_Line_Item::get_nearest_descendant_of_type()', 'event_espresso'), '4.6.0');
1287
+		return EEH_Line_Item::get_nearest_descendant_of_type($this, $type);
1288
+	}
1289 1289
 
1290 1290
 
1291 1291
 
Please login to merge, or discard this patch.