Completed
Branch FET-9747-doing-it-wrong (e31ff3)
by
unknown
358:54 queued 340:15
created
core/libraries/messages/messenger/EE_Email_messenger.class.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 	 *
94 94
 	 * @abstract
95 95
 	 * @access protected
96
-	 * @return array
96
+	 * @return string[]
97 97
 	 */
98 98
 	protected function _get_table_filters() {
99 99
 		$filters = array();
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 /**
30 30
  * This sets up the email messenger for the EE_messages (notifications) subsystem in EE.
31 31
  */
32
-class EE_Email_messenger extends EE_messenger  {
32
+class EE_Email_messenger extends EE_messenger {
33 33
 
34 34
 	/**
35 35
 	 * The following are the properties that email requires for the message going out.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	protected function _set_valid_shortcodes() {
78 78
 		//remember by leaving the other fields not set, those fields will inherit the valid shortcodes from the message type.
79 79
 		$this->_valid_shortcodes = array(
80
-			'to' => array('email','event_author', 'primary_registration_details', 'recipient_details'),
80
+			'to' => array('email', 'event_author', 'primary_registration_details', 'recipient_details'),
81 81
 			'from' => array('email', 'event_author', 'primary_registration_details', 'recipient_details')
82 82
 			);
83 83
 	}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 				'shortcodes' => array('organization', 'primary_registration_details', 'event_author', 'primary_registration_details', 'recipient_details')
112 112
 				),
113 113
 			'content' => array(
114
-				'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger')
114
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'primary_registration_details', 'primary_registration_list', 'event_author', 'recipient_details', 'recipient_list', 'transaction', 'messenger')
115 115
 				),
116 116
 			'attendee_list' => array(
117 117
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list'),
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 				'required' => array('[EVENT_LIST]')
123 123
 				),
124 124
 			'ticket_list' => array(
125
-				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'),
125
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'),
126 126
 				'required' => array('[TICKET_LIST]')
127 127
 				),
128 128
 			'datetime_list' => array(
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
 	 *
142 142
 	 * @since 4.5.0
143 143
 	 */
144
-	public function do_secondary_messenger_hooks( $sending_messenger_name ) {
145
-		if ( $sending_messenger_name = 'html' ) {
146
-			add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 );
144
+	public function do_secondary_messenger_hooks($sending_messenger_name) {
145
+		if ($sending_messenger_name = 'html') {
146
+			add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8);
147 147
 		}
148 148
 	}
149 149
 
150 150
 
151 151
 
152 152
 
153
-	public function add_email_css( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) {
153
+	public function add_email_css($variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack) {
154 154
 		//prevent recursion on this callback.
155
-		remove_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10 );
156
-		$variation = $this->get_variation( $template_pack, $message_type, $url, 'main', $variation, FALSE  );
155
+		remove_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10);
156
+		$variation = $this->get_variation($template_pack, $message_type, $url, 'main', $variation, FALSE);
157 157
 
158
-		add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', array( $this, 'add_email_css' ), 10, 8 );
158
+		add_filter('FHEE__EE_Messages_Template_Pack__get_variation', array($this, 'add_email_css'), 10, 8);
159 159
 		return $variation;
160 160
 	}
161 161
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 				'required' => FALSE,
188 188
 				'validation' => FALSE,
189 189
 				'format' => '%s',
190
-				'value' => sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') ),
190
+				'value' => sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name')),
191 191
 				'default'=> '',
192 192
 				'css_class' => ''
193 193
 				)
@@ -349,16 +349,16 @@  discard block
 block discarded – undo
349 349
 	 * @return bool | WP_Error  true if message delivered, false if it didn't deliver OR bubble up any error object if present.
350 350
 	 */
351 351
 	protected function _send_message() {
352
-		$success =  wp_mail(
353
-			html_entity_decode( $this->_to, ENT_QUOTES, "UTF-8" ),
354
-			stripslashes( html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8" )),
352
+		$success = wp_mail(
353
+			html_entity_decode($this->_to, ENT_QUOTES, "UTF-8"),
354
+			stripslashes(html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8")),
355 355
 			$this->_body(),
356 356
 			$this->_headers()
357 357
 		);
358
-		if ( ! $success ) {
358
+		if ( ! $success) {
359 359
 			EE_Error::add_error(
360 360
 				sprintf(
361
-					__( 'The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'),
361
+					__('The email did not send successfully.%3$sThe WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.%3$sIt is possible the "to" address (%1$s) or "from" address (%2$s) is invalid.%3$s', 'event_espresso'),
362 362
 					$this->_to,
363 363
 					$this->_from,
364 364
 					'<br />'
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @return string html body of the message content and the related css.
378 378
 	 */
379 379
 	protected function _preview() {
380
-		return $this->_body( true );
380
+		return $this->_body(true);
381 381
 	}
382 382
 
383 383
 
@@ -391,18 +391,18 @@  discard block
 block discarded – undo
391 391
 	 * @return string formatted header for email
392 392
 	 */
393 393
 	protected function _headers() {
394
-		$from = stripslashes_deep( html_entity_decode($this->_from,  ENT_QUOTES,"UTF-8" ) );
394
+		$from = stripslashes_deep(html_entity_decode($this->_from, ENT_QUOTES, "UTF-8"));
395 395
 		$headers = array(
396 396
 			'MIME-Version: 1.0',
397
-			'From:' . $from,
398
-			'Reply-To:' . $from,
397
+			'From:'.$from,
398
+			'Reply-To:'.$from,
399 399
 			'Content-Type:text/html; charset=utf-8'
400 400
 			);
401 401
 
402 402
 		//but wait!  Header's for the from is NOT reliable because some plugins don't respect From: as set in the header.
403
-		add_filter( 'wp_mail_from',  array( $this, 'set_from_address' ), 100 );
404
-		add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ), 100 );
405
-		return apply_filters( 'FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this );
403
+		add_filter('wp_mail_from', array($this, 'set_from_address'), 100);
404
+		add_filter('wp_mail_from_name', array($this, 'set_from_name'), 100);
405
+		return apply_filters('FHEE__EE_Email_messenger___headers', $headers, $this->_incoming_message_type, $this);
406 406
 	}
407 407
 
408 408
 
@@ -418,19 +418,19 @@  discard block
 block discarded – undo
418 418
 	 * @return array
419 419
 	 */
420 420
 	private function _parse_from() {
421
-		if ( strpos( $this->_from, '<' ) !== false ) {
422
-			$from_name = substr( $this->_from, 0, strpos( $this->_from, '<' ) - 1 );
423
-			$from_name = str_replace( '"', '', $from_name );
424
-			$from_name = trim( $from_name );
425
-
426
-			$from_email = substr( $this->_from, strpos( $this->_from, '<' ) + 1 );
427
-			$from_email = str_replace( '>', '', $from_email );
428
-			$from_email = trim( $from_email );
421
+		if (strpos($this->_from, '<') !== false) {
422
+			$from_name = substr($this->_from, 0, strpos($this->_from, '<') - 1);
423
+			$from_name = str_replace('"', '', $from_name);
424
+			$from_name = trim($from_name);
425
+
426
+			$from_email = substr($this->_from, strpos($this->_from, '<') + 1);
427
+			$from_email = str_replace('>', '', $from_email);
428
+			$from_email = trim($from_email);
429 429
 		} else {
430 430
 			$from_name = '';
431
-			$from_email = trim( $this->_from );
431
+			$from_email = trim($this->_from);
432 432
 		}
433
-		return array( $from_name, $from_email );
433
+		return array($from_name, $from_email);
434 434
 	}
435 435
 
436 436
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 	 *
444 444
 	 * @param string $from_email What the original from_email is.
445 445
 	 */
446
-	public function set_from_address( $from_email ) {
446
+	public function set_from_address($from_email) {
447 447
 		$parsed_from = $this->_parse_from();
448 448
 		return $parsed_from[1];
449 449
 	}
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
 	 *
459 459
 	 * @param string $from_name The original from_name.
460 460
 	 */
461
-	public function set_from_name( $from_name ) {
461
+	public function set_from_name($from_name) {
462 462
 		$parsed_from = $this->_parse_from();
463
-		if ( is_array( $parsed_from) && ! empty( $parsed_from[0] ) ) {
464
-			$from_name =  $parsed_from[0];
463
+		if (is_array($parsed_from) && ! empty($parsed_from[0])) {
464
+			$from_name = $parsed_from[0];
465 465
 		}
466 466
 
467
-		return stripslashes_deep( html_entity_decode($from_name,  ENT_QUOTES,"UTF-8" ) );
467
+		return stripslashes_deep(html_entity_decode($from_name, ENT_QUOTES, "UTF-8"));
468 468
 	}
469 469
 
470 470
 
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
 	 * @param bool $preview will determine whether this is preview template or not.
476 476
 	 * @return string formatted body for email.
477 477
 	 */
478
-	protected function _body( $preview = false ) {
478
+	protected function _body($preview = false) {
479 479
 		//setup template args!
480 480
 		$this->_template_args = array(
481 481
 			'subject' => $this->_subject,
482 482
 			'from' => $this->_from,
483
-			'main_body' => wpautop(stripslashes_deep( html_entity_decode($this->_content,  ENT_QUOTES,"UTF-8" ) ))
483
+			'main_body' => wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8")))
484 484
 			);
485
-		$body =  $this->_get_main_template( $preview );
485
+		$body = $this->_get_main_template($preview);
486 486
 
487 487
 		/**
488 488
 		 * This filter allows one to bypass the CSSToInlineStyles tool and leave the body untouched.
@@ -490,17 +490,17 @@  discard block
 block discarded – undo
490 490
 		 * @type    bool    $preview    Indicates whether a preview is being generated or not.
491 491
 		 * @return  bool    true  indicates to use the inliner, false bypasses it.
492 492
 		 */
493
-		if ( apply_filters( 'FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview ) ) {
493
+		if (apply_filters('FHEE__EE_Email_messenger__apply_CSSInliner ', true, $preview)) {
494 494
 
495 495
 			//require CssToInlineStyles library and its dependencies via composer autoloader
496
-			require_once EE_THIRD_PARTY . 'cssinliner/vendor/autoload.php';
496
+			require_once EE_THIRD_PARTY.'cssinliner/vendor/autoload.php';
497 497
 
498 498
 			//now if this isn't a preview, let's setup the body so it has inline styles
499
-			if ( ! $preview || ( $preview && defined( 'DOING_AJAX' ) ) ) {
500
-				$style = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation ), TRUE );
501
-				$CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles( $body, $style );
502
-				$body = ltrim( $CSS->convert( true ), ">\n" ); //for some reason the library has a bracket and new line at the beginning.  This takes care of that.
503
-				$body = ltrim( $body, "<?" ); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609
499
+			if ( ! $preview || ($preview && defined('DOING_AJAX'))) {
500
+				$style = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, 'main', $this->_variation), TRUE);
501
+				$CSS = new TijsVerkoyen\CssToInlineStyles\CssToInlineStyles($body, $style);
502
+				$body = ltrim($CSS->convert(true), ">\n"); //for some reason the library has a bracket and new line at the beginning.  This takes care of that.
503
+				$body = ltrim($body, "<?"); //see https://events.codebasehq.com/projects/event-espresso/tickets/8609
504 504
 			}
505 505
 
506 506
 		}
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
 	public function get_existing_test_settings() {
520 520
 		$settings = parent::get_existing_test_settings();
521 521
 		//override subject if present because we always want it to be fresh.
522
-		if ( is_array( $settings ) && ! empty( $settings['subject'] ) ) {
523
-			$settings['subject'] = sprintf( __('Test email sent from %s', 'event_espresso'), get_bloginfo('name') );
522
+		if (is_array($settings) && ! empty($settings['subject'])) {
523
+			$settings['subject'] = sprintf(__('Test email sent from %s', 'event_espresso'), get_bloginfo('name'));
524 524
 		}
525 525
 		return $settings;
526 526
 	}
Please login to merge, or discard this patch.
core/libraries/messages/messenger/EE_Html_messenger.class.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * @subpackage		messages
20 20
  * @author			Darren Ethier
21 21
  */
22
-class EE_Html_messenger extends EE_messenger  {
22
+class EE_Html_messenger extends EE_messenger {
23 23
 
24 24
 
25 25
 	/**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * @see abstract declaration in EE_messenger for details.
63 63
 	 */
64 64
 	protected function _set_admin_pages() {
65
-		$this->admin_registered_pages = array( 'events_edit' => true );
65
+		$this->admin_registered_pages = array('events_edit' => true);
66 66
 	}
67 67
 
68 68
 
@@ -82,29 +82,29 @@  discard block
 block discarded – undo
82 82
 	protected function _set_validator_config() {
83 83
 		$this->_validator_config = array(
84 84
 			'subject' => array(
85
-				'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction' )
85
+				'shortcodes' => array('organization', 'primary_registration_details', 'email', 'transaction')
86 86
 				),
87 87
 			'content' => array(
88
-				'shortcodes' => array( 'organization',  'primary_registration_list', 'primary_registration_details',  'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list')
88
+				'shortcodes' => array('organization', 'primary_registration_list', 'primary_registration_details', 'email', 'transaction', 'event_list', 'payment_list', 'venue', 'line_item_list', 'messenger', 'ticket_list')
89 89
 				),
90 90
 			'event_list' => array(
91
-				'shortcodes' => array( 'event', 'ticket_list', 'venue',  'primary_registration_details', 'primary_registration_list', 'event_author' ),
91
+				'shortcodes' => array('event', 'ticket_list', 'venue', 'primary_registration_details', 'primary_registration_list', 'event_author'),
92 92
 				'required' => array('[EVENT_LIST]')
93 93
 				),
94 94
 			'ticket_list' => array(
95
-				'shortcodes' => array( 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'line_item_list', 'venue'),
95
+				'shortcodes' => array('attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'line_item_list', 'venue'),
96 96
 				'required' => array('[TICKET_LIST]')
97 97
 				),
98 98
 			'ticket_line_item_no_pms' => array(
99
-				'shortcodes' => array( 'line_item', 'ticket' ),
99
+				'shortcodes' => array('line_item', 'ticket'),
100 100
 				'required' => array('[TICKET_LINE_ITEM_LIST]')
101 101
 				),
102 102
 			'ticket_line_item_pms' => array(
103
-				'shortcodes' => array( 'line_item', 'ticket', 'line_item_list' ),
103
+				'shortcodes' => array('line_item', 'ticket', 'line_item_list'),
104 104
 				'required' => array('[TICKET_LINE_ITEM_LIST]'),
105 105
 				),
106 106
 			'price_modifier_line_item_list' => array(
107
-				'shortcodes' => array( 'line_item' ),
107
+				'shortcodes' => array('line_item'),
108 108
 				'required' => array('[PRICE_MODIFIER_LINE_ITEM_LIST]')
109 109
 				),
110 110
 			'datetime_list' => array(
@@ -132,16 +132,16 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 
135
-	public function do_secondary_messenger_hooks( $sending_messenger_name ) {
136
-		if ( $sending_messenger_name = 'pdf' ) {
137
-			add_filter( 'EE_messenger__get_variation__variation', array( $this, 'add_html_css' ), 10, 8 );
135
+	public function do_secondary_messenger_hooks($sending_messenger_name) {
136
+		if ($sending_messenger_name = 'pdf') {
137
+			add_filter('EE_messenger__get_variation__variation', array($this, 'add_html_css'), 10, 8);
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 
143
-	public function add_html_css( $variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters ) {
144
-		$variation = $template_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters );
143
+	public function add_html_css($variation_path, EE_Messages_Template_Pack $template_pack, $messenger_name, $message_type_name, $url, $type, $variation, $skip_filters) {
144
+		$variation = $template_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters);
145 145
 		return $variation;
146 146
 	}
147 147
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public  function enqueue_scripts_styles() {
156 156
 		parent::enqueue_scripts_styles();
157
-		do_action( 'AHEE__EE_Html_messenger__enqueue_scripts_styles');
157
+		do_action('AHEE__EE_Html_messenger__enqueue_scripts_styles');
158 158
 	}
159 159
 
160 160
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 						),
215 215
 					'ticket_line_item_no_pms' => array(
216 216
 						'input' => 'textarea',
217
-						'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with no Price Modifiers', 'event_espresso'),
217
+						'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with no Price Modifiers', 'event_espresso'),
218 218
 						'type' => 'string',
219 219
 						'required' => FALSE,
220 220
 						'validation' => TRUE,
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 						),
226 226
 					'ticket_line_item_pms' => array(
227 227
 						'input' => 'textarea',
228
-						'label' => '[TICKET_LINE_ITEM_LIST] <br>' . __('Ticket Line Item List with Price Modifiers', 'event_espresso'),
228
+						'label' => '[TICKET_LINE_ITEM_LIST] <br>'.__('Ticket Line Item List with Price Modifiers', 'event_espresso'),
229 229
 						'type' => 'string',
230 230
 						'required' => FALSE,
231 231
 						'validation' => TRUE,
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 *
319 319
 	 */
320 320
 	protected function _set_default_message_types() {
321
-		$this->_default_message_types = array( 'receipt', 'invoice' );
321
+		$this->_default_message_types = array('receipt', 'invoice');
322 322
 	}
323 323
 
324 324
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	 * @since 4.5.0
330 330
 	 */
331 331
 	protected function _set_valid_message_types() {
332
-		$this->_valid_message_types = array( 'receipt', 'invoice' );
332
+		$this->_valid_message_types = array('receipt', 'invoice');
333 333
 	}
334 334
 
335 335
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
 	 */
345 345
 	protected function _send_message() {
346 346
 		$this->_template_args = array(
347
-			'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"),
348
-			'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ),
349
-			'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ),
350
-			'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ),
351
-			'main_body' => apply_filters( 'FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content,  ENT_QUOTES,"UTF-8" ) )), $this->_content )
347
+			'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"),
348
+			'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation),
349
+			'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation),
350
+			'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation),
351
+			'main_body' => apply_filters('FHEE__EE_Html_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content)
352 352
 			);
353 353
 
354 354
 		$this->_deregister_wp_hooks();
355
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) );
355
+		add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'));
356 356
 		echo $this->_get_main_template();
357 357
 		exit();
358 358
 	}
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
 		$wp_scripts = $wp_styles = array();
377 377
 
378 378
 		//just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load.
379
-		add_action( 'wp_footer', 'wp_print_footer_scripts' );
380
-		add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
379
+		add_action('wp_footer', 'wp_print_footer_scripts');
380
+		add_action('wp_print_footer_scripts', '_wp_footer_scripts');
381 381
 		add_action('wp_head', 'wp_enqueue_scripts');
382 382
 	}
383 383
 
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 	 *
392 392
 	 * @return string
393 393
 	 */
394
-	protected function _get_main_template( $preview = FALSE ) {
395
-		$wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, 'main' );
394
+	protected function _get_main_template($preview = FALSE) {
395
+		$wrapper_template = $this->_tmp_pack->get_wrapper($this->name, 'main');
396 396
 
397 397
 		//include message type as a template arg
398 398
 		$this->_template_args['message_type'] = $this->_incoming_message_type;
399 399
 
400
-		return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE );
400
+		return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
401 401
 	}
402 402
 
403 403
 
Please login to merge, or discard this patch.
email/EE_Messages_Email_Not_Approved_Registration_Validator.class.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this 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 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'cancelled_registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
47 47
 			'required' => array('[EVENT_LIST]')
48 48
 			);
49
-		$this->_messenger->set_validator_config( $new_config );
49
+		$this->_messenger->set_validator_config($new_config);
50 50
 
51
-		if ( $this->_context != 'admin' )
51
+		if ($this->_context != 'admin')
52 52
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53 53
 
54 54
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Payment_Refund_Validator.class.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment_reminder';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_messenger->set_validator_config( $new_config );
56
+		$this->_messenger->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
messages/validators/email/EE_Messages_Email_Payment_Validator.class.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Payment_Reminder_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'payment_reminder';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 
46 46
 		//modify just event_list
47 47
 		$new_config['event_list'] = array(
48
-			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization','recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
48
+			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'recipient_details', 'recipient_list', 'event_author', 'primary_registration_details', 'primary_registration_list')
49 49
 			);
50 50
 		$new_config['ticket_list'] = array(
51 51
 			'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'recipient_details', 'transaction')
52 52
 			);
53 53
 		$new_config['content'] = array(
54
-			'shortcodes' => array('event_list','attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
54
+			'shortcodes' => array('event_list', 'attendee_list', 'ticket_list', 'organization', 'recipient_details', 'recipient_list', 'transaction', 'primary_registration_details', 'primary_registration_list', 'messenger')
55 55
 			);
56
-		$this->_messenger->set_validator_config( $new_config );
56
+		$this->_messenger->set_validator_config($new_config);
57 57
 
58
-		if ( $this->_context != 'admin' )
58
+		if ($this->_context != 'admin')
59 59
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
60 60
 
61 61
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Pending_Approval_Validator.class.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this 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 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'cancelled_registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
47 47
 			'required' => array('[EVENT_LIST]')
48 48
 			);
49
-		$this->_messenger->set_validator_config( $new_config );
49
+		$this->_messenger->set_validator_config($new_config);
50 50
 
51
-		if ( $this->_context != 'admin' )
51
+		if ($this->_context != 'admin')
52 52
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53 53
 
54 54
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
validators/email/EE_Messages_Email_Registration_Summary_Validator.class.php 2 patches
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
4 4
 	exit('NO direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -49,8 +50,9 @@  discard block
 block discarded – undo
49 50
 			);
50 51
 		$this->_MSGR->set_validator_config( $new_config );
51 52
 
52
-		if ( $this->_context != 'admin' )
53
-			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53
+		if ( $this->_context != 'admin' ) {
54
+					$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
55
+		}
54 56
 
55 57
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
56 58
 	}
Please login to merge, or discard this 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 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION') )
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('NO direct script access allowed');
5 5
 
6 6
 /**
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 class EE_Messages_Email_Cancelled_Registration_Validator extends EE_Messages_Validator {
31 31
 
32 32
 
33
-	public function __construct( $fields, $context ) {
33
+	public function __construct($fields, $context) {
34 34
 		$this->_m_name = 'email';
35 35
 		$this->_mt_name = 'cancelled_registration';
36 36
 
37
-		parent::__construct( $fields, $context );
37
+		parent::__construct($fields, $context);
38 38
 	}
39 39
 
40 40
 	/**
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 			'shortcodes' => array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list'),
47 47
 			'required' => array('[EVENT_LIST]')
48 48
 			);
49
-		$this->_messenger->set_validator_config( $new_config );
49
+		$this->_messenger->set_validator_config($new_config);
50 50
 
51
-		if ( $this->_context != 'admin' )
51
+		if ($this->_context != 'admin')
52 52
 			$this->_valid_shortcodes_modifier[$this->_context]['event_list'] = array('event', 'attendee_list', 'ticket_list', 'datetime_list', 'venue', 'organization', 'event_author', 'primary_registration_details', 'primary_registration_list', 'recipient_details', 'recipient_list');
53 53
 
54 54
 		$this->_specific_shortcode_excludes['content'] = array('[DISPLAY_PDF_URL]', '[DISPLAY_PDF_BUTTON]');
Please login to merge, or discard this patch.
messages/validators/html/EE_Messages_Html_Invoice_Validator.class.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator {
26 26
 
27
-	public function __construct( $fields, $context ) {
27
+	public function __construct($fields, $context) {
28 28
 		$this->_m_name = 'html';
29 29
 		$this->_mt_name = 'receipt';
30 30
 
31
-		parent::__construct( $fields, $context );
31
+		parent::__construct($fields, $context);
32 32
 	}
33 33
 
34 34
 	/**
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/payment_methods/EE_Gateway.lib.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @subpackage		core/libraries/payment_methods
16 16
  * @author			Mike Nelson
17 17
  */
18
-abstract class EE_Gateway{
18
+abstract class EE_Gateway {
19 19
 	/**
20 20
 	 * a constant used as a possible value for $_currencies_supported to indicate
21 21
 	 * that ALL currencies are supported by this gateway
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	/**
94 94
 	 * @return EE_Gateway
95 95
 	 */
96
-	public function __construct(){
96
+	public function __construct() {
97 97
 	}
98 98
 
99 99
 	/**
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 	 * beginning again)
106 106
 	 * @return array
107 107
 	 */
108
-	public function __sleep(){
108
+	public function __sleep() {
109 109
 		$properties = get_object_vars($this);
110
-		unset( $properties[ '_pay_model' ], $properties[ '_pay_log' ] );
110
+		unset($properties['_pay_model'], $properties['_pay_log']);
111 111
 		return array_keys($properties);
112 112
 	}
113 113
 	/**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * see $_supports_sending_refunds
116 116
 	 * @return boolean
117 117
 	 */
118
-	public function supports_sending_refunds(){
118
+	public function supports_sending_refunds() {
119 119
 		return $this->_supports_sending_refunds;
120 120
 	}
121 121
 	/**
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * see $_supports_receiving_refunds
124 124
 	 * @return boolean
125 125
 	 */
126
-	public function supports_receiving_refunds(){
126
+	public function supports_receiving_refunds() {
127 127
 		return $this->_supports_receiving_refunds;
128 128
 	}
129 129
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @return EE_Payment for the refund
139 139
 	 * @throws EE_Error
140 140
 	 */
141
-	public function do_direct_refund( EE_Payment $payment, $refund_info = null ) {
141
+	public function do_direct_refund(EE_Payment $payment, $refund_info = null) {
142 142
 		return NULL;
143 143
 	}
144 144
 
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * etc
150 150
 	 * @param array $settings_array
151 151
 	 */
152
-	public function set_settings($settings_array){
153
-		foreach($settings_array as $name => $value){
152
+	public function set_settings($settings_array) {
153
+		foreach ($settings_array as $name => $value) {
154 154
 			$property_name = "_".$name;
155 155
 			$this->{$property_name} = $value;
156 156
 		}
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
 	 * See this class description
160 160
 	 * @param EEMI_Payment $payment_model
161 161
 	 */
162
-	public function set_payment_model($payment_model){
162
+	public function set_payment_model($payment_model) {
163 163
 		$this->_pay_model = $payment_model;
164 164
 	}
165 165
 	/**
166 166
 	 * See this class description
167 167
 	 * @param EEMI_Payment_Log $payment_log_model
168 168
 	 */
169
-	public function set_payment_log($payment_log_model){
169
+	public function set_payment_log($payment_log_model) {
170 170
 		$this->_pay_log = $payment_log_model;
171 171
 	}
172 172
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * See this class description
175 175
 	 * @param EEHI_Template $template_helper
176 176
 	 */
177
-	public function set_template_helper($template_helper){
177
+	public function set_template_helper($template_helper) {
178 178
 		$this->_template = $template_helper;
179 179
 	}
180 180
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 * See this class description
183 183
 	 * @param EEHI_Line_Item $line_item_helper
184 184
 	 */
185
-	public function set_line_item_helper( $line_item_helper ){
185
+	public function set_line_item_helper($line_item_helper) {
186 186
 		$this->_line_item = $line_item_helper;
187 187
 	}
188 188
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 * See this class description
191 191
 	 * @param EEHI_Money $money_helper
192 192
 	 */
193
-	public function set_money_helper( $money_helper ){
193
+	public function set_money_helper($money_helper) {
194 194
 		$this->_money = $money_helper;
195 195
 	}
196 196
 
@@ -199,23 +199,23 @@  discard block
 block discarded – undo
199 199
 	 * @param $message
200 200
 	 * @param $payment
201 201
 	 */
202
-	public function log($message,$payment){
203
-		if($payment instanceof EEI_Payment){
204
-			$type='Payment';
202
+	public function log($message, $payment) {
203
+		if ($payment instanceof EEI_Payment) {
204
+			$type = 'Payment';
205 205
 			$id = $payment->ID();
206
-		}else{
206
+		} else {
207 207
 			$type = 'Payment_Method';
208 208
 			$id = $this->_ID;
209 209
 		}
210
-		$this->_pay_log->gateway_log($message,$id,$type);
210
+		$this->_pay_log->gateway_log($message, $id, $type);
211 211
 	}
212 212
 	/**
213 213
 	 * Formats the amount so it can generally be sent to gateways
214 214
 	 * @param float $amount
215 215
 	 * @return string
216 216
 	 */
217
-	public function format_currency($amount){
218
-		return number_format( $amount, 2, '.', '' );
217
+	public function format_currency($amount) {
218
+		return number_format($amount, 2, '.', '');
219 219
 //		return $this->_template->format_currency($amount, true);
220 220
 	}
221 221
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 * or a string indicating they're all supported (EE_gateway::all_currencies_supported)
225 225
 	 * @return mixed array or string
226 226
 	 */
227
-	public function currencies_supported(){
227
+	public function currencies_supported() {
228 228
 		return $this->_currencies_supported;
229 229
 	}
230 230
 
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
 	 * @param EE_Transaction  $transaction
237 237
 	 * @return float
238 238
 	 */
239
-	protected function _sum_items_and_taxes( EE_Transaction  $transaction){
239
+	protected function _sum_items_and_taxes(EE_Transaction  $transaction) {
240 240
 		$total_line_item = $transaction->total_line_item();
241 241
 		$total = 0;
242
-		foreach($total_line_item->get_items() as $item_line_item ){
243
-			$total += max( $item_line_item->total(), 0 );
242
+		foreach ($total_line_item->get_items() as $item_line_item) {
243
+			$total += max($item_line_item->total(), 0);
244 244
 		}
245
-		foreach($total_line_item->tax_descendants() as $tax_line_item ){
246
-			$total += max( $tax_line_item->total(), 0 );
245
+		foreach ($total_line_item->tax_descendants() as $tax_line_item) {
246
+			$total += max($tax_line_item->total(), 0);
247 247
 		}
248 248
 		return $total;
249 249
 	}
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
 	 * @param EEI_Payment $payment
255 255
 	 * @return boolean
256 256
 	 */
257
-	protected function _can_easily_itemize_transaction_for( EEI_Payment $payment ){
257
+	protected function _can_easily_itemize_transaction_for(EEI_Payment $payment) {
258 258
 		return  $this->_money->compare_floats(
259
-					$this->_sum_items_and_taxes( $payment->transaction() ),
259
+					$this->_sum_items_and_taxes($payment->transaction()),
260 260
 					$payment->transaction()->total() ) &&
261 261
 				$this->_money->compare_floats(
262 262
 					$payment->amount(),
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 * @param EE_Payment $payment
275 275
 	 * @return void
276 276
 	 */
277
-	public function update_txn_based_on_payment( $payment ){
277
+	public function update_txn_based_on_payment($payment) {
278 278
 		//maybe update the transaction or line items or registrations
279 279
 		//but most gateways don't need to do this, because they only update the payment
280 280
 	}
Please login to merge, or discard this patch.