Completed
Branch FET/9584/add-back-view-recipie... (c1eac2)
by
unknown
67:40 queued 55:12
created
help_tabs/registration_form_reg_form_settings.help_tab.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@
 block discarded – undo
3 3
 <?php _e('This page shows options for Email Validation, the EE "Bot Trap" and reCAPTCHA which can help prevent SPAM registrations on your site.', 'event_espresso'); ?>
4 4
 </p>
5 5
 <div id="email_validation_info">
6
-<p><strong><?php _e('Email Validation', 'event_espresso');?></strong></p>
6
+<p><strong><?php _e('Email Validation', 'event_espresso'); ?></strong></p>
7 7
 <p><?php _e("Validating an email address is extremely difficult to do correctly. Your server's configuration, as well as your own tolerances and needs, can affect the type of validation needed. We offer different types of validation so that you can control how strict your registration form responds to entered email addresses. If you are receiving too many bogus email addresses, then you can try the WordPress Default validation setting. If you find that the form validation is blocking a valid email address you can try the Basic setting, or if available, the International validation settings.", 'event_espresso'); ?>
8 8
 </p>
9
-<p><strong><?php _e('Validation Options:', 'event_espresso' );?></strong></p>
9
+<p><strong><?php _e('Validation Options:', 'event_espresso'); ?></strong></p>
10 10
 <ul>
11 11
 <li>
12 12
 	<?php _e('"Basic" - only checks that an email address follows the most basic structure guidelines ( ie: [email protected] ). Will work with the widest range of email addresses but will also allow the most garbage through.', 'event_espresso'); ?></li>
13 13
 <li>
14
-	<?php _e('"WordPress Default" - uses built in WordPress email validation, but does not support unicode characters (ie: international characters from non-latin based languages).','event_espresso'); ?></li>
14
+	<?php _e('"WordPress Default" - uses built in WordPress email validation, but does not support unicode characters (ie: international characters from non-latin based languages).', 'event_espresso'); ?></li>
15 15
 <li>
16 16
 	<?php _e('"International" - supports unicode characters but may not be supported by all server configurations. Try this first if you need to international language support, but drop back down to "Basic" if your server configuration conflicts.', 'event_espresso'); ?>
17 17
 </li>
Please login to merge, or discard this patch.
core/middleware/EE_Middleware.core.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @access 	public
44 44
 	 * @param 	\EEI_Request_Decorator $request_stack
45 45
 	 */
46
-	public function __construct( EEI_Request_Decorator $request_stack ) {
46
+	public function __construct(EEI_Request_Decorator $request_stack) {
47 47
 		$this->_request_stack = $request_stack;
48 48
 	}
49 49
 
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 	 * @param 	EE_Response $response
58 58
 	 * @return 	EE_Response
59 59
 	 */
60
-	protected function process_request_stack( EE_Request $request, EE_Response $response ) {
60
+	protected function process_request_stack(EE_Request $request, EE_Response $response) {
61 61
 		$this->_request = $request;
62 62
 		$this->_response = $response;
63
-		if ( ! $this->_response->request_terminated() ) {
64
-			$this->_response = $this->_request_stack->handle_request( $this->_request, $this->_response );
63
+		if ( ! $this->_response->request_terminated()) {
64
+			$this->_response = $this->_request_stack->handle_request($this->_request, $this->_response);
65 65
 		}
66 66
 		return $this->_response;
67 67
 	}
Please login to merge, or discard this patch.
core/middleware/EE_Alpha_Banner_Warning.core.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 	 * @param 	EE_Response $response
22 22
 	 * @return 	EE_Response
23 23
 	 */
24
-	public function handle_request( EE_Request $request, EE_Response $response ) {
24
+	public function handle_request(EE_Request $request, EE_Response $response) {
25 25
 		$this->_request = $request;
26 26
 		$this->_response = $response;
27 27
 		$this->display_alpha_banner_warning();
28
-		$this->_response = $this->process_request_stack( $this->_request, $this->_response );
28
+		$this->_response = $this->process_request_stack($this->_request, $this->_response);
29 29
 		return $this->_response;
30 30
 	}
31 31
 
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function display_alpha_banner_warning() {
43 43
 		// skip AJAX requests
44
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
44
+		if (defined('DOING_AJAX') && DOING_AJAX) {
45 45
 			return;
46 46
 		}
47 47
 		// skip stable releases
48
-		if ( strpos( EVENT_ESPRESSO_VERSION, '.alpha' ) === false ) {
48
+		if (strpos(EVENT_ESPRESSO_VERSION, '.alpha') === false) {
49 49
 			return;
50 50
 		}
51 51
 		// post release candidate warning
52
-		if ( is_admin() ) {
53
-			add_action( 'admin_notices', array( $this, 'alpha_banner_admin_notice' ), -999 );
52
+		if (is_admin()) {
53
+			add_action('admin_notices', array($this, 'alpha_banner_admin_notice'), -999);
54 54
 		} else {
55 55
 			// site admin has authorized use of non-stable release candidate for production
56
-			if ( defined( 'ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE' ) && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE ) {
56
+			if (defined('ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE') && ALLOW_NON_STABLE_RELEASE_ON_LIVE_SITE) {
57 57
 				return;
58 58
 			}
59
-			add_action( 'shutdown', array( $this, 'alpha_banner_warning_notice' ), 10 );
59
+			add_action('shutdown', array($this, 'alpha_banner_warning_notice'), 10);
60 60
 		}
61 61
 	}
62 62
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	public function alpha_banner_admin_notice() {
73 73
 		EE_Error::add_attention(
74 74
 			sprintf(
75
-				__( 'This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.', 'event_espresso' ),
75
+				__('This version of Event Espresso is for testing and/or evaluation purposes only. It is %1$snot%2$s considered a stable release and should therefore %1$snot%2$s be activated on a live or production website.', 'event_espresso'),
76 76
 				'<strong>',
77 77
 				'</strong>'
78 78
 			),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function alpha_banner_warning_notice() {
93 93
 		printf(
94
-			__( '%1$sThis version of Event Espresso is for testing and/or evaluation purposes only. It is %2$snot%3$s considered a stable release and should therefore %2$snot%3$s be activated on a live or production website.%4$s', 'event_espresso' ),
94
+			__('%1$sThis version of Event Espresso is for testing and/or evaluation purposes only. It is %2$snot%3$s considered a stable release and should therefore %2$snot%3$s be activated on a live or production website.%4$s', 'event_espresso'),
95 95
 			'<div id="ee-release-candidate-notice-dv" class="ee-really-important-notice-dv"><p>',
96 96
 			'<strong>',
97 97
 			'</strong>',
Please login to merge, or discard this patch.
core/request_stack/EE_Request_Stack.core.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @param 	EEI_Request_Decorator $application
44 44
 	 * @param 	array $middlewares
45 45
 	 */
46
-	public function __construct( EEI_Request_Decorator $application, $middlewares = array() ) {
46
+	public function __construct(EEI_Request_Decorator $application, $middlewares = array()) {
47 47
 		$this->_application = $application;
48 48
 		$this->_middlewares = $middlewares;
49 49
 	}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 	 * @param 	EE_Response $response
56 56
 	 * @return 	EE_Response
57 57
 	 */
58
-	public function handle_request( EE_Request $request, EE_Response $response ) {
58
+	public function handle_request(EE_Request $request, EE_Response $response) {
59 59
 		$this->_request = $request;
60 60
 		$this->_response = $response;
61
-		return $this->_application->handle_request( $request, $response );
61
+		return $this->_application->handle_request($request, $response);
62 62
 	}
63 63
 
64 64
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 * after the request stack has been fully processed
70 70
 	 */
71 71
 	public function handle_response() {
72
-		foreach ( $this->_middlewares as $middleware ) {
73
-			if ( $middleware instanceof EEI_Request_Stack_Core_App ) {
74
-				$middleware->handle_response( $this->_request, $this->_response );
72
+		foreach ($this->_middlewares as $middleware) {
73
+			if ($middleware instanceof EEI_Request_Stack_Core_App) {
74
+				$middleware->handle_response($this->_request, $this->_response);
75 75
 				// exit loop since we should be done
76 76
 				// (also in case someone has accidentally labeled multiple apps as the EEI_Request_Stack_Core_App )
77 77
 				break;
Please login to merge, or discard this patch.
caffeinated/admin/extend/about/templates/whats_new.template.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@
 block discarded – undo
1 1
 <div class="changelog point-releases">
2
-	<!-- <h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3> -->
3
-	<h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3>
2
+	<!-- <h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3> -->
3
+	<h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3>
4 4
 	<?php //$type = 'minor'; ?>
5 5
 	<?php $type = 'major'; ?>
6
-	<p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?>
6
+	<p><?php printf(__('<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?>
7 7
 		<?php
8
-			$ver = explode( '.', EVENT_ESPRESSO_VERSION );
9
-			array_pop( $ver );
10
-			$ver = implode( '.', $ver );
8
+			$ver = explode('.', EVENT_ESPRESSO_VERSION);
9
+			array_pop($ver);
10
+			$ver = implode('.', $ver);
11 11
 		?>
12
-		<?php printf( __( 'For more information, see <a href="%s" target="_blank">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?>
12
+		<?php printf(__('For more information, see <a href="%s" target="_blank">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?>
13 13
  	</p>
14 14
 </div>
15 15
 
16 16
 <div class="changelog">
17 17
 	<?php
18 18
 	//maintenance mode on?
19
-	if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) {
19
+	if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) {
20 20
 		?>
21 21
 		<div class="ee-attention">
22
-			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2>
22
+			<h2 class="ee-maintenance-mode-callout"><?php  _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2>
23 23
 			<p>
24 24
 			<?php
25 25
 				printf(
Please login to merge, or discard this patch.
core/libraries/batch/JobHandlerBaseClasses/JobHandlerFile.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 
17 17
 use EventEspressoBatchRequest\Helpers\BatchRequestException;
18 18
 
19
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
20
-	exit( 'No direct script access allowed' );
19
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
20
+	exit('No direct script access allowed');
21 21
 }
22 22
 
23 23
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @param \EEHI_File|null $file_helper
41 41
 	 */
42
-	public function __construct( \EEHI_File $file_helper = null ) {
43
-		if( ! $file_helper ) {
42
+	public function __construct(\EEHI_File $file_helper = null) {
43
+		if ( ! $file_helper) {
44 44
 			$this->_file_helper = new \EEH_File();
45 45
 		}
46 46
 	}
@@ -56,39 +56,39 @@  discard block
 block discarded – undo
56 56
 	 * @return string
57 57
 	 * @throws \EventEspressoBatchRequest\Helpers\BatchRequestException
58 58
 	 */
59
-	public function create_file_from_job_with_name( $job_id, $filename, $filetype = 'application/ms-excel' ) {
59
+	public function create_file_from_job_with_name($job_id, $filename, $filetype = 'application/ms-excel') {
60 60
 		$filepath = '';
61
-		try{
61
+		try {
62 62
 			$base_folder = $this->get_base_folder();
63 63
 			$success = $this->_file_helper->ensure_folder_exists_and_is_writable(
64
-				$base_folder . JobHandlerFile::temp_folder_name
64
+				$base_folder.JobHandlerFile::temp_folder_name
65 65
 			);
66
-			if ( $success ) {
66
+			if ($success) {
67 67
 				$success = $this->_file_helper->ensure_folder_exists_and_is_writable(
68
-					$base_folder . JobHandlerFile::temp_folder_name . DS . $job_id
68
+					$base_folder.JobHandlerFile::temp_folder_name.DS.$job_id
69 69
 				);
70 70
 			}
71
-			if( $success ) {
72
-				$filepath = $base_folder . JobHandlerFile::temp_folder_name . DS . $job_id . DS. $filename;
73
-				$success = $this->_file_helper->ensure_file_exists_and_is_writable( $filepath );
71
+			if ($success) {
72
+				$filepath = $base_folder.JobHandlerFile::temp_folder_name.DS.$job_id.DS.$filename;
73
+				$success = $this->_file_helper->ensure_file_exists_and_is_writable($filepath);
74 74
 			}
75 75
 			//let's add the .htaccess file so safari will open the file properly
76
-			if( $success ) {
77
-				$extension = \EEH_File::get_file_extension( $filepath );
76
+			if ($success) {
77
+				$extension = \EEH_File::get_file_extension($filepath);
78 78
 				\EEH_File::write_to_file(
79
-					$base_folder . JobHandlerFile::temp_folder_name . DS . $job_id . DS . '.htaccess',
80
-					'AddType ' . $filetype . ' ' . $extension,
79
+					$base_folder.JobHandlerFile::temp_folder_name.DS.$job_id.DS.'.htaccess',
80
+					'AddType '.$filetype.' '.$extension,
81 81
 					'.htaccess'
82 82
 				);
83 83
 			}
84 84
 			//those methods normally fail with an exception, but if not, let's do it
85
-			if( ! $success ) {
86
-				throw new \EE_Error( __( 'Could not create temporary file, an unknown error occurred', 'event_espresso' ) );
85
+			if ( ! $success) {
86
+				throw new \EE_Error(__('Could not create temporary file, an unknown error occurred', 'event_espresso'));
87 87
 			}
88
-		} catch( \EE_Error $e ) {
88
+		} catch (\EE_Error $e) {
89 89
 			throw new BatchRequestException(
90 90
 				sprintf(
91
-					__( 'Could not create temporary file for job %1$s, because: %2$s ', 'event_espresso' ),
91
+					__('Could not create temporary file for job %1$s, because: %2$s ', 'event_espresso'),
92 92
 					$job_id,
93 93
 					$e->getMessage()
94 94
 				),
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 	 * @param string $filepath
105 105
 	 * @return string url to file
106 106
 	 */
107
-	public function get_url_to_file( $filepath ) {
108
-		return str_replace( $this->get_base_folder(), $this->get_base_url(), $filepath );
107
+	public function get_url_to_file($filepath) {
108
+		return str_replace($this->get_base_folder(), $this->get_base_url(), $filepath);
109 109
 	}
110 110
 	
111 111
 	/**
Please login to merge, or discard this patch.
espresso_thank_you/templates/thank-you-page-overview.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@  discard block
 block discarded – undo
3 3
 /** @var boolean $revisit */
4 4
 /** @var string $order_conf_desc */
5 5
 
6
-do_action( 'AHEE__thank_you_page_overview_template__top', $transaction );
6
+do_action('AHEE__thank_you_page_overview_template__top', $transaction);
7 7
 
8 8
 ?>
9 9
 
10 10
 <div id="espresso-thank-you-page-overview-dv" class="width-100" >
11 11
 
12
-	<?php if ( ! $revisit ) : ?>
12
+	<?php if ( ! $revisit) : ?>
13 13
 	<div class="ee-attention">
14 14
 		<div class="extra-padding-sides">
15 15
 			<?php echo apply_filters(
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 					'<br />'
22 22
 				)
23 23
 			);
24
-			if ( ! empty( $TXN_receipt_url )) : ?>
24
+			if ( ! empty($TXN_receipt_url)) : ?>
25 25
 			<br/>
26 26
 			<div class="jst-rght">
27
-				<a class="ee-button ee-roundish indented-text big-text" href="<?php echo $TXN_receipt_url;?>"><span class="ee-icon ee-icon-PDF-file-type"></span><?php echo apply_filters( 'FHEE__thank_you_page_overview_template__order_conf_button_text', __( 'View Full Order Confirmation Receipt', 'event_espresso' )); ?></a>
27
+				<a class="ee-button ee-roundish indented-text big-text" href="<?php echo $TXN_receipt_url; ?>"><span class="ee-icon ee-icon-PDF-file-type"></span><?php echo apply_filters('FHEE__thank_you_page_overview_template__order_conf_button_text', __('View Full Order Confirmation Receipt', 'event_espresso')); ?></a>
28 28
 			</div>
29 29
 			<?php endif; ?>
30 30
 		</div>
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	<?php endif; ?>
34 34
 	<br/>
35 35
 
36
-	<?php  do_action( 'AHEE__thank_you_page_overview_template__content', $transaction ); ?>
36
+	<?php  do_action('AHEE__thank_you_page_overview_template__content', $transaction); ?>
37 37
 
38 38
 </div>
39 39
 <!-- end of espresso-thank-you-page-overview-dv -->
40 40
 
41
-<?php  do_action( 'AHEE__thank_you_page_overview_template__bottom', $transaction ); ?>
41
+<?php  do_action('AHEE__thank_you_page_overview_template__bottom', $transaction); ?>
Please login to merge, or discard this patch.
core/db_models/EEM_Question.model.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 * Gets an array for converting between QST_system and QST_IDs for system questions. Eg, if you want to know
311 311
 	 * which system question QST_ID corresponds to the QST_system 'city', use EEM_Question::instance()->get_Question_ID_from_system_string('city');
312 312
 	 * @param $QST_system
313
-	 * @return int of QST_ID for the question that corresponds to that QST_system
313
+	 * @return string of QST_ID for the question that corresponds to that QST_system
314 314
 	 */
315 315
 	public function get_Question_ID_from_system_string( $QST_system ){
316 316
 		 return $this->get_var( array( array( 'QST_system' => $QST_system ) ) );
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
 
371 371
 	/**
372
-	 * @return array
372
+	 * @return EEM_Question
373 373
 	 */
374 374
 	public function question_descriptions() {
375 375
 		return $this->_question_descriptions;
Please login to merge, or discard this patch.
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 	 *
72 72
 	 * @access protected
73 73
 	 * @var array $_question_type_categories {
74
-     * @type string $text
75
-     * @type string $single-answer-enum
76
-     * @type string $multi-answer-enum
77
-     *                    }
74
+	 * @type string $text
75
+	 * @type string $single-answer-enum
76
+	 * @type string $multi-answer-enum
77
+	 *                    }
78 78
 	 */
79 79
 	protected $_question_type_categories = array();
80 80
 
@@ -156,14 +156,14 @@  discard block
 block discarded – undo
156 156
 				'text' => array(
157 157
 					EEM_Question::QST_type_text,
158 158
 					EEM_Question::QST_type_textarea,
159
-                    EEM_Question::QST_type_date,
159
+					EEM_Question::QST_type_date,
160 160
 					EEM_Question::QST_type_html_textarea,
161 161
 					EEM_Question::QST_type_email,
162 162
 					EEM_Question::QST_type_us_phone,
163 163
 					EEM_Question::QST_type_decimal,
164
-                    EEM_Question::QST_type_int,
164
+					EEM_Question::QST_type_int,
165 165
 					EEM_Question::QST_type_url,
166
-                    EEM_Question::QST_type_year
166
+					EEM_Question::QST_type_year
167 167
 					),
168 168
 				'single-answer-enum' => array(
169 169
 					EEM_Question::QST_type_radio,
@@ -251,32 +251,32 @@  discard block
 block discarded – undo
251 251
 
252 252
 
253 253
 
254
-    /**
255
-     * Returns all the question types in the given category
256
-     * @param string $category
257
-     * @return array|mixed
258
-     */
254
+	/**
255
+	 * Returns all the question types in the given category
256
+	 * @param string $category
257
+	 * @return array|mixed
258
+	 */
259 259
 	public function question_types_in_category($category)
260
-    {
261
-        if( isset($this->_question_type_categories[$category])) {
262
-            return $this->_question_type_categories[$category];
263
-        }
264
-        return array();
265
-    }
266
-
267
-
268
-
269
-    /**
270
-     * Returns all the question types that should have question options
271
-     * @return array
272
-     */
273
-    public function question_types_with_options()
274
-    {
275
-        return array_merge(
276
-            $this->question_types_in_category('single-answer-enum'),
277
-            $this->question_types_in_category('multi-answer-enum')
278
-        );
279
-    }
260
+	{
261
+		if( isset($this->_question_type_categories[$category])) {
262
+			return $this->_question_type_categories[$category];
263
+		}
264
+		return array();
265
+	}
266
+
267
+
268
+
269
+	/**
270
+	 * Returns all the question types that should have question options
271
+	 * @return array
272
+	 */
273
+	public function question_types_with_options()
274
+	{
275
+		return array_merge(
276
+			$this->question_types_in_category('single-answer-enum'),
277
+			$this->question_types_in_category('multi-answer-enum')
278
+		);
279
+	}
280 280
 
281 281
 	/**
282 282
 	 * Returns the question type categories 2d array
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
 	exit('No direct script access allowed');
3 3
 }
4
-require_once( EE_MODELS . 'EEM_Soft_Delete_Base.model.php' );
5
-require_once( EE_CLASSES . 'EE_Question.class.php' );
4
+require_once(EE_MODELS.'EEM_Soft_Delete_Base.model.php');
5
+require_once(EE_CLASSES.'EE_Question.class.php');
6 6
 
7 7
 
8 8
 
@@ -105,52 +105,52 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @param null $timezone
107 107
 	 */
108
-	protected function __construct( $timezone = NULL ) {
109
-		$this->singular_item = __('Question','event_espresso');
110
-		$this->plural_item = __('Questions','event_espresso');
111
-		$this->_allowed_question_types=apply_filters(
108
+	protected function __construct($timezone = NULL) {
109
+		$this->singular_item = __('Question', 'event_espresso');
110
+		$this->plural_item = __('Questions', 'event_espresso');
111
+		$this->_allowed_question_types = apply_filters(
112 112
 			'FHEE__EEM_Question__construct__allowed_question_types',
113 113
 			array(
114
-				EEM_Question::QST_type_text =>__('Text','event_espresso'),
115
-				EEM_Question::QST_type_textarea =>__('Textarea','event_espresso'),
116
-				EEM_Question::QST_type_checkbox =>__('Checkboxes','event_espresso'),
117
-				EEM_Question::QST_type_radio =>__('Radio Buttons','event_espresso'),
118
-				EEM_Question::QST_type_dropdown =>__('Dropdown','event_espresso'),
119
-				EEM_Question::QST_type_state =>__('State/Province Dropdown','event_espresso'),
120
-				EEM_Question::QST_type_country =>__('Country Dropdown','event_espresso'),
121
-				EEM_Question::QST_type_date =>__('Date Picker','event_espresso'),
122
-				EEM_Question::QST_type_html_textarea => __( 'HTML Textarea', 'event_espresso' ),
123
-				EEM_Question::QST_type_email => __( 'Email', 'event_espresso' ),
124
-				EEM_Question::QST_type_us_phone => __( 'USA - Format Phone', 'event_espresso' ),
125
-				EEM_Question::QST_type_decimal => __( 'Number', 'event_espresso' ),
126
-				EEM_Question::QST_type_int => __( 'Whole Number', 'event_espresso' ),
127
-				EEM_Question::QST_type_url => __( 'URL', 'event_espresso' ),
128
-				EEM_Question::QST_type_year => __( 'Year', 'event_espresso' ),
129
-				EEM_Question::QST_type_multi_select => __( 'Multi Select', 'event_espresso' )
114
+				EEM_Question::QST_type_text =>__('Text', 'event_espresso'),
115
+				EEM_Question::QST_type_textarea =>__('Textarea', 'event_espresso'),
116
+				EEM_Question::QST_type_checkbox =>__('Checkboxes', 'event_espresso'),
117
+				EEM_Question::QST_type_radio =>__('Radio Buttons', 'event_espresso'),
118
+				EEM_Question::QST_type_dropdown =>__('Dropdown', 'event_espresso'),
119
+				EEM_Question::QST_type_state =>__('State/Province Dropdown', 'event_espresso'),
120
+				EEM_Question::QST_type_country =>__('Country Dropdown', 'event_espresso'),
121
+				EEM_Question::QST_type_date =>__('Date Picker', 'event_espresso'),
122
+				EEM_Question::QST_type_html_textarea => __('HTML Textarea', 'event_espresso'),
123
+				EEM_Question::QST_type_email => __('Email', 'event_espresso'),
124
+				EEM_Question::QST_type_us_phone => __('USA - Format Phone', 'event_espresso'),
125
+				EEM_Question::QST_type_decimal => __('Number', 'event_espresso'),
126
+				EEM_Question::QST_type_int => __('Whole Number', 'event_espresso'),
127
+				EEM_Question::QST_type_url => __('URL', 'event_espresso'),
128
+				EEM_Question::QST_type_year => __('Year', 'event_espresso'),
129
+				EEM_Question::QST_type_multi_select => __('Multi Select', 'event_espresso')
130 130
 			)
131 131
 		);
132 132
 		$this->_question_descriptions = apply_filters(
133 133
 			'FHEE__EEM_Question__construct__allowed_question_types',
134 134
 			array(
135
-				EEM_Question::QST_type_text          => __( 'A single line text input field', 'event_espresso' ),
136
-				EEM_Question::QST_type_textarea      => __( 'A multi line text input field', 'event_espresso' ),
137
-				EEM_Question::QST_type_checkbox      => __( 'Allows multiple preset options to be selected', 'event_espresso' ),
138
-				EEM_Question::QST_type_radio         => __( 'Allows a single preset option to be selected', 'event_espresso' ),
139
-				EEM_Question::QST_type_dropdown      => __( 'A dropdown that allows a single selection', 'event_espresso' ),
140
-				EEM_Question::QST_type_state         => __( 'A dropdown that lists states/provinces', 'event_espresso' ),
141
-				EEM_Question::QST_type_country       => __( 'A dropdown that lists countries', 'event_espresso' ),
142
-				EEM_Question::QST_type_date          => __( 'A popup calendar that allows date selections', 'event_espresso' ),
143
-				EEM_Question::QST_type_html_textarea => __( 'A multi line text input field that allows HTML', 'event_espresso' ),
144
-				EEM_Question::QST_type_email         => __( 'A text field that must contain a valid Email address', 'event_espresso' ),
145
-				EEM_Question::QST_type_us_phone      => __( 'A text field that must contain a valid US phone number', 'event_espresso' ),
146
-				EEM_Question::QST_type_decimal       => __( 'A text field that allows number values with decimals', 'event_espresso' ),
147
-				EEM_Question::QST_type_int           => __( 'A text field that only allows whole numbers (no decimals)', 'event_espresso' ),
148
-				EEM_Question::QST_type_url           => __( 'A text field that must contain a valid URL', 'event_espresso' ),
149
-				EEM_Question::QST_type_year          => __( 'A dropdown that lists the last 100 years', 'event_espresso' ),
150
-				EEM_Question::QST_type_multi_select  => __( 'A dropdown that allows multiple selections', 'event_espresso' )
135
+				EEM_Question::QST_type_text          => __('A single line text input field', 'event_espresso'),
136
+				EEM_Question::QST_type_textarea      => __('A multi line text input field', 'event_espresso'),
137
+				EEM_Question::QST_type_checkbox      => __('Allows multiple preset options to be selected', 'event_espresso'),
138
+				EEM_Question::QST_type_radio         => __('Allows a single preset option to be selected', 'event_espresso'),
139
+				EEM_Question::QST_type_dropdown      => __('A dropdown that allows a single selection', 'event_espresso'),
140
+				EEM_Question::QST_type_state         => __('A dropdown that lists states/provinces', 'event_espresso'),
141
+				EEM_Question::QST_type_country       => __('A dropdown that lists countries', 'event_espresso'),
142
+				EEM_Question::QST_type_date          => __('A popup calendar that allows date selections', 'event_espresso'),
143
+				EEM_Question::QST_type_html_textarea => __('A multi line text input field that allows HTML', 'event_espresso'),
144
+				EEM_Question::QST_type_email         => __('A text field that must contain a valid Email address', 'event_espresso'),
145
+				EEM_Question::QST_type_us_phone      => __('A text field that must contain a valid US phone number', 'event_espresso'),
146
+				EEM_Question::QST_type_decimal       => __('A text field that allows number values with decimals', 'event_espresso'),
147
+				EEM_Question::QST_type_int           => __('A text field that only allows whole numbers (no decimals)', 'event_espresso'),
148
+				EEM_Question::QST_type_url           => __('A text field that must contain a valid URL', 'event_espresso'),
149
+				EEM_Question::QST_type_year          => __('A dropdown that lists the last 100 years', 'event_espresso'),
150
+				EEM_Question::QST_type_multi_select  => __('A dropdown that allows multiple selections', 'event_espresso')
151 151
 			)
152 152
 		);
153
-		$this->_question_type_categories = (array)apply_filters(
153
+		$this->_question_type_categories = (array) apply_filters(
154 154
 				'FHEE__EEM_Question__construct__question_type_categories',
155 155
 				array(
156 156
 				'text' => array(
@@ -177,22 +177,22 @@  discard block
 block discarded – undo
177 177
 		);
178 178
 
179 179
 		$this->_tables = array(
180
-			'Question'=>new EE_Primary_Table('esp_question','QST_ID')
180
+			'Question'=>new EE_Primary_Table('esp_question', 'QST_ID')
181 181
 		);
182 182
 		$this->_fields = array(
183 183
 			'Question'=>array(
184
-				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID','event_espresso')),
185
-				'QST_display_text'=>new EE_Post_Content_Field('QST_display_text', __('Question Text','event_espresso'), true, ''),
186
-				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)','event_espresso'), true, ''),
187
-				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question','event_espresso'), false, '' ),
188
-				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type','event_espresso'),false, 'TEXT',$this->_allowed_question_types),
189
-				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?','event_espresso'), false, false),
190
-				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided','event_espresso'), true, ''),
191
-				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order','event_espresso'), false, 0),
192
-				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?','event_espresso'), false, false),
193
-				'QST_max' => new EE_Infinite_Integer_Field( 'QST_max', __( 'Max Size', 'event_espresso'	), false, EE_INF ),
194
-				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID','event_espresso'), false ),
195
-				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted','event_espresso'), false, false)
184
+				'QST_ID'=>new EE_Primary_Key_Int_Field('QST_ID', __('Question ID', 'event_espresso')),
185
+				'QST_display_text'=>new EE_Post_Content_Field('QST_display_text', __('Question Text', 'event_espresso'), true, ''),
186
+				'QST_admin_label'=>new EE_Plain_Text_Field('QST_admin_label', __('Question Label (admin-only)', 'event_espresso'), true, ''),
187
+				'QST_system'=>new EE_Plain_Text_Field('QST_system', __('Internal string ID for question', 'event_espresso'), false, ''),
188
+				'QST_type'=>new EE_Enum_Text_Field('QST_type', __('Question Type', 'event_espresso'), false, 'TEXT', $this->_allowed_question_types),
189
+				'QST_required'=>new EE_Boolean_Field('QST_required', __('Required Question?', 'event_espresso'), false, false),
190
+				'QST_required_text'=>new EE_Simple_HTML_Field('QST_required_text', __('Text to Display if Not Provided', 'event_espresso'), true, ''),
191
+				'QST_order'=>new EE_Integer_Field('QST_order', __('Question Order', 'event_espresso'), false, 0),
192
+				'QST_admin_only'=>new EE_Boolean_Field('QST_admin_only', __('Admin-Only Question?', 'event_espresso'), false, false),
193
+				'QST_max' => new EE_Infinite_Integer_Field('QST_max', __('Max Size', 'event_espresso'), false, EE_INF),
194
+				'QST_wp_user'=>new EE_WP_User_Field('QST_wp_user', __('Question Creator ID', 'event_espresso'), false),
195
+				'QST_deleted'=>new EE_Trashed_Flag_Field('QST_deleted', __('Flag Indicating question was deleted', 'event_espresso'), false, false)
196 196
 			)
197 197
 		);
198 198
 		$this->_model_relations = array(
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
 			'Question_Group_Question'=>new EE_Has_Many_Relation()
205 205
 		);
206 206
 		//this model is generally available for reading
207
-		$this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Public();
208
-		$this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Reg_Form('QST_system');
209
-		$this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Reg_Form('QST_system');
210
-		$this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Reg_Form('QST_system');
211
-		parent::__construct( $timezone );
207
+		$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
208
+		$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Reg_Form('QST_system');
209
+		$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Reg_Form('QST_system');
210
+		$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Reg_Form('QST_system');
211
+		parent::__construct($timezone);
212 212
 	}
213 213
 
214 214
 	/**
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * but they can be extended
217 217
 	 * @return string[]
218 218
 	 */
219
-	public function allowed_question_types(){
219
+	public function allowed_question_types() {
220 220
 		return $this->_allowed_question_types;
221 221
 	}
222 222
 	/**
@@ -224,16 +224,16 @@  discard block
 block discarded – undo
224 224
 	 * @param string $question_type one of EEM_Question::allowed_question_types(
225 225
 	 * @return string[] like EEM_Question::allowed_question_types()
226 226
 	 */
227
-	public function question_types_in_same_category( $question_type ) {
228
-		$question_types = array( $question_type );
229
-		foreach( $this->_question_type_categories as $category => $question_types_in_category ) {
230
-			if( in_array( $question_type, $question_types_in_category ) ) {
227
+	public function question_types_in_same_category($question_type) {
228
+		$question_types = array($question_type);
229
+		foreach ($this->_question_type_categories as $category => $question_types_in_category) {
230
+			if (in_array($question_type, $question_types_in_category)) {
231 231
 				$question_types = $question_types_in_category;
232 232
 				break;
233 233
 			}
234 234
 		}
235 235
 
236
-		return array_intersect_key( $this->allowed_question_types(), array_flip( $question_types ) );
236
+		return array_intersect_key($this->allowed_question_types(), array_flip($question_types));
237 237
 	}
238 238
 
239 239
 	/**
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 	 * @param string $category one of the top-level keys of EEM_Question::question_type_categories()
243 243
 	 * @return boolean
244 244
 	 */
245
-	public function question_type_is_in_category( $question_type, $category ) {
246
-		if( ! isset( $this->_question_type_categories[ $category ] ) ) {
245
+	public function question_type_is_in_category($question_type, $category) {
246
+		if ( ! isset($this->_question_type_categories[$category])) {
247 247
 			return false;
248 248
 		}
249
-		return in_array( $question_type, $this->_question_type_categories[ $category ] );
249
+		return in_array($question_type, $this->_question_type_categories[$category]);
250 250
 	}
251 251
 
252 252
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
 	public function question_types_in_category($category)
260 260
     {
261
-        if( isset($this->_question_type_categories[$category])) {
261
+        if (isset($this->_question_type_categories[$category])) {
262 262
             return $this->_question_type_categories[$category];
263 263
         }
264 264
         return array();
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
 	 * @param string $system_question_group_id QSG_system
293 293
 	 * @return array of system question names (QST_system)
294 294
 	 */
295
-	public function allowed_system_questions_in_system_question_group( $system_question_group_id ) {
295
+	public function allowed_system_questions_in_system_question_group($system_question_group_id) {
296 296
 		$question_system_ids = array();
297
-		switch( $system_question_group_id ) {
297
+		switch ($system_question_group_id) {
298 298
 			case EEM_Question_Group::system_personal:
299 299
 				$question_system_ids = array(
300 300
 					EEM_Attendee::system_question_fname,
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 				);
316 316
 				break;
317 317
 		}
318
-		return apply_filters( 'FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id );
318
+		return apply_filters('FHEE__EEM_Question__system_questions_allowed_in_system_question_group__return', $question_system_ids, $system_question_group_id);
319 319
 	}
320 320
 
321 321
 	/**
@@ -324,11 +324,11 @@  discard block
 block discarded – undo
324 324
 	 * @param string $system_question_group_id QSG_system
325 325
 	 * @return array of system question names (QST_system)
326 326
 	 */
327
-	public function required_system_questions_in_system_question_group( $system_question_group_id ) {
327
+	public function required_system_questions_in_system_question_group($system_question_group_id) {
328 328
 		$question_system_ids = null;
329
-		switch( $system_question_group_id ) {
329
+		switch ($system_question_group_id) {
330 330
 			case EEM_Question_Group::system_personal:
331
-				$question_system_ids =  array(
331
+				$question_system_ids = array(
332 332
 					EEM_Attendee::system_question_fname,
333 333
 					EEM_Attendee::system_question_email,
334 334
 				);
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 			default:
337 337
 				$question_system_ids = array();
338 338
 		}
339
-		return apply_filters( 'FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id );
339
+		return apply_filters('FHEE__EEM_Question__system_questions_required_in_system_question_group', $question_system_ids, $system_question_group_id);
340 340
 	}
341 341
 
342 342
 
@@ -347,8 +347,8 @@  discard block
 block discarded – undo
347 347
 	 * @param $QST_system
348 348
 	 * @return int of QST_ID for the question that corresponds to that QST_system
349 349
 	 */
350
-	public function get_Question_ID_from_system_string( $QST_system ){
351
-		 return $this->get_var( array( array( 'QST_system' => $QST_system ) ) );
350
+	public function get_Question_ID_from_system_string($QST_system) {
351
+		 return $this->get_var(array(array('QST_system' => $QST_system)));
352 352
 	}
353 353
 
354 354
 
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 	 */
361 361
 	public function get_latest_question_order() {
362 362
 		$columns_to_select = array(
363
-			'max_order' => array("MAX(QST_order)","%d")
363
+			'max_order' => array("MAX(QST_order)", "%d")
364 364
 		);
365
-		$max = $this->_get_all_wpdb_results( array(), ARRAY_A, $columns_to_select );
366
-		return isset( $max[0], $max[0]['max_order'] ) ? $max[0]['max_order'] : 0;
365
+		$max = $this->_get_all_wpdb_results(array(), ARRAY_A, $columns_to_select);
366
+		return isset($max[0], $max[0]['max_order']) ? $max[0]['max_order'] : 0;
367 367
 	}
368 368
 
369 369
 	/**
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
 	 * @param string $system_question_value
393 393
 	 * @return int|float
394 394
 	 */
395
-	public function absolute_max_for_system_question( $system_question_value ) {
395
+	public function absolute_max_for_system_question($system_question_value) {
396 396
 		$maxes = $this->system_question_maxes();
397
-		if( isset( $maxes[ $system_question_value ] ) ) {
398
-			return $maxes[ $system_question_value ];
397
+		if (isset($maxes[$system_question_value])) {
398
+			return $maxes[$system_question_value];
399 399
 		} else {
400 400
 			return EE_INF;
401 401
 		}
Please login to merge, or discard this patch.
core/business/EE_Transaction_Payments.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
 	 * @param EE_Transaction $transaction
162 162
 	 * @param string         $payment_status One of EEM_Payment's statuses, like 'PAP' (Approved).
163 163
 	 *                                       By default, searches for approved payments
164
-	 * @return float|false   float on success, false on fail
164
+	 * @return double   float on success, false on fail
165 165
 	 * @throws \EE_Error
166 166
 	 */
167 167
 	public function recalculate_total_payments_for_transaction( EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved ) {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,8 +233,8 @@
 block discarded – undo
233 233
 					if ( $registration instanceof EE_Registration ) {
234 234
 						$registration->set_paid( $registration->paid() - $amount_paid );
235 235
 						if ($registration->save() !== false) {
236
-						    $registration_payment->delete_permanently();
237
-                            $save_payment = true;
236
+							$registration_payment->delete_permanently();
237
+							$save_payment = true;
238 238
 						}
239 239
 					} else {
240 240
 						EE_Error::add_error(
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2
-EE_Registry::instance()->load_class( 'Processor_Base' );
2
+EE_Registry::instance()->load_class('Processor_Base');
3 3
 
4 4
 /**
5 5
  * Class EE_Transaction_Payments
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public static function instance() {
44 44
 		// check if class object is instantiated
45
-		if ( ! self::$_instance instanceof EE_Transaction_Payments ) {
45
+		if ( ! self::$_instance instanceof EE_Transaction_Payments) {
46 46
 			self::$_instance = new self();
47 47
 		}
48 48
 		return self::$_instance;
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
 	 * @return bool true if TXN total was updated, false if not
60 60
 	 * @throws \EE_Error
61 61
 	 */
62
-	public function recalculate_transaction_total( EE_Transaction $transaction, $update_txn = true ) {
62
+	public function recalculate_transaction_total(EE_Transaction $transaction, $update_txn = true) {
63 63
 		$total_line_item = $transaction->total_line_item();
64
-		if ( ! $total_line_item instanceof EE_Line_Item ) {
64
+		if ( ! $total_line_item instanceof EE_Line_Item) {
65 65
 			EE_Error::add_error(
66
-				sprintf( __( 'The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso' ), $transaction->ID() ),
66
+				sprintf(__('The Total Line Item for Transaction %1$d\'s was not found or is invalid.', 'event_espresso'), $transaction->ID()),
67 67
 				__FILE__, __FUNCTION__, __LINE__
68 68
 			);
69 69
 			return false;
70 70
 		}
71 71
 		$new_total = $total_line_item->recalculate_total_including_taxes();
72
-		$transaction->set_total( $new_total );
73
-		if ( $update_txn ) {
72
+		$transaction->set_total($new_total);
73
+		if ($update_txn) {
74 74
 			return $transaction->save() ? true : false;
75 75
 		}
76 76
 		return false;
@@ -93,20 +93,20 @@  discard block
 block discarded – undo
93 93
 	 * @return    boolean        whether the TXN was saved
94 94
 	 * @throws \EE_Error
95 95
 	 */
96
-	public function calculate_total_payments_and_update_status( EE_Transaction $transaction, $update_txn = true ){
96
+	public function calculate_total_payments_and_update_status(EE_Transaction $transaction, $update_txn = true) {
97 97
 		// verify transaction
98
-		if ( ! $transaction instanceof EE_Transaction ) {
99
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
98
+		if ( ! $transaction instanceof EE_Transaction) {
99
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
100 100
 			return false;
101 101
 		}
102 102
 		// calculate total paid
103
-		$total_paid = $this->recalculate_total_payments_for_transaction( $transaction );
103
+		$total_paid = $this->recalculate_total_payments_for_transaction($transaction);
104 104
 		// if total paid has changed
105
-		if ( $total_paid !== false && (float)$total_paid !== $transaction->paid() ) {
106
-			$transaction->set_paid( $total_paid );
105
+		if ($total_paid !== false && (float) $total_paid !== $transaction->paid()) {
106
+			$transaction->set_paid($total_paid);
107 107
 			// maybe update status, and make sure to save transaction if not done already
108
-			if ( ! $transaction->update_status_based_on_total_paid( $update_txn ) ) {
109
-				if ( $update_txn ) {
108
+			if ( ! $transaction->update_status_based_on_total_paid($update_txn)) {
109
+				if ($update_txn) {
110 110
 					return $transaction->save() ? true : false;
111 111
 				}
112 112
 			} else {
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 	 * @return float|false   float on success, false on fail
131 131
 	 * @throws \EE_Error
132 132
 	 */
133
-	public function recalculate_total_payments_for_transaction( EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved ) {
133
+	public function recalculate_total_payments_for_transaction(EE_Transaction $transaction, $payment_status = EEM_Payment::status_id_approved) {
134 134
 		// verify transaction
135
-		if ( ! $transaction instanceof EE_Transaction ) {
136
-			EE_Error::add_error( __( 'Please provide a valid EE_Transaction object.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
135
+		if ( ! $transaction instanceof EE_Transaction) {
136
+			EE_Error::add_error(__('Please provide a valid EE_Transaction object.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
137 137
 			return false;
138 138
 		}
139 139
 		// ensure Payment model is loaded
140
-		EE_Registry::instance()->load_model( 'Payment' );
140
+		EE_Registry::instance()->load_model('Payment');
141 141
 		// calls EEM_Base::sum()
142 142
 		return EEM_Payment::instance()->sum(
143 143
 			// query params
144
-			array( array( 'TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status )),
144
+			array(array('TXN_ID' => $transaction->ID(), 'STS_ID' => $payment_status)),
145 145
 			// field to sum
146 146
 			'PAY_amount'
147 147
 		);
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 	 * @return boolean
160 160
 	 * @throws \EE_Error
161 161
 	 */
162
-	public function delete_payment_and_update_transaction( EE_Payment $payment ) {
162
+	public function delete_payment_and_update_transaction(EE_Payment $payment) {
163 163
 		// verify payment
164
-		if ( ! $payment instanceof EE_Payment ) {
165
-			EE_Error::add_error( __( 'A valid Payment object was not received.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
164
+		if ( ! $payment instanceof EE_Payment) {
165
+			EE_Error::add_error(__('A valid Payment object was not received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
166 166
 			return false;
167 167
 		}
168
-		if ( ! $this->delete_registration_payments_and_update_registrations( $payment ) ) {
168
+		if ( ! $this->delete_registration_payments_and_update_registrations($payment)) {
169 169
 			return false;
170 170
 		}
171
-		if ( ! $payment->delete() ) {
172
-			EE_Error::add_error( __( 'The payment could not be deleted.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
171
+		if ( ! $payment->delete()) {
172
+			EE_Error::add_error(__('The payment could not be deleted.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
173 173
 			return false;
174 174
 		}
175 175
 
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
 			|| $TXN_status === EEM_Transaction::failed_status_code
181 181
 			|| $payment->amount() === 0
182 182
 		) {
183
-			EE_Error::add_success( __( 'The Payment was successfully deleted.', 'event_espresso' ) );
183
+			EE_Error::add_success(__('The Payment was successfully deleted.', 'event_espresso'));
184 184
 			return true;
185 185
 		}
186 186
 
187 187
 
188 188
 		//if this fails, that just means that the transaction didn't get its status changed and/or updated.
189 189
 		//however the payment was still deleted.
190
-		if ( ! $this->calculate_total_payments_and_update_status( $transaction ) ) {
190
+		if ( ! $this->calculate_total_payments_and_update_status($transaction)) {
191 191
 
192 192
 			EE_Error::add_attention(
193 193
 				__(
@@ -221,17 +221,17 @@  discard block
 block discarded – undo
221 221
 	 * @return bool
222 222
 	 * @throws \EE_Error
223 223
 	 */
224
-	public function delete_registration_payments_and_update_registrations( EE_Payment $payment, $reg_payment_query_params = array() ) {
224
+	public function delete_registration_payments_and_update_registrations(EE_Payment $payment, $reg_payment_query_params = array()) {
225 225
 		$save_payment = false;
226
-		$reg_payment_query_params = ! empty( $reg_payment_query_params ) ? $reg_payment_query_params : array( array( 'PAY_ID' => $payment->ID() ) );
227
-		$registration_payments = EEM_Registration_Payment::instance()->get_all( $reg_payment_query_params );
228
-		if ( ! empty( $registration_payments )) {
229
-			foreach ( $registration_payments as $registration_payment ) {
230
-				if ( $registration_payment instanceof EE_Registration_Payment ) {
226
+		$reg_payment_query_params = ! empty($reg_payment_query_params) ? $reg_payment_query_params : array(array('PAY_ID' => $payment->ID()));
227
+		$registration_payments = EEM_Registration_Payment::instance()->get_all($reg_payment_query_params);
228
+		if ( ! empty($registration_payments)) {
229
+			foreach ($registration_payments as $registration_payment) {
230
+				if ($registration_payment instanceof EE_Registration_Payment) {
231 231
 					$amount_paid = $registration_payment->amount();
232 232
 					$registration = $registration_payment->registration();
233
-					if ( $registration instanceof EE_Registration ) {
234
-						$registration->set_paid( $registration->paid() - $amount_paid );
233
+					if ($registration instanceof EE_Registration) {
234
+						$registration->set_paid($registration->paid() - $amount_paid);
235 235
 						if ($registration->save() !== false) {
236 236
 						    $registration_payment->delete_permanently();
237 237
                             $save_payment = true;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 					} else {
240 240
 						EE_Error::add_error(
241 241
 							sprintf(
242
-								__( 'An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso' ),
242
+								__('An invalid Registration object was associated with Registration Payment ID# %1$d.', 'event_espresso'),
243 243
 								$registration_payment->ID()
244 244
 							),
245 245
 							__FILE__, __FUNCTION__, __LINE__
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 				} else {
250 250
 					EE_Error::add_error(
251 251
 						sprintf(
252
-							__( 'An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso' ),
252
+							__('An invalid Registration Payment object was associated with payment ID# %1$d.', 'event_espresso'),
253 253
 							$payment->ID()
254 254
 						),
255 255
 						__FILE__, __FUNCTION__, __LINE__
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 				}
259 259
 			}
260 260
 		}
261
-		if ( $save_payment ) {
261
+		if ($save_payment) {
262 262
 			$payment->save();
263 263
 		}
264 264
 		return true;
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	public function update_transaction_status_based_on_total_paid(EE_Transaction $transaction, $update_txn = true)
283 283
 	{
284 284
 		EE_Error::doing_it_wrong(
285
-			__CLASS__ . '::' . __FUNCTION__,
285
+			__CLASS__.'::'.__FUNCTION__,
286 286
 			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'),
287 287
 				'EE_Transaction::update_status_based_on_total_paid()'),
288 288
 			'4.9.1',
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	 * @deprecated 4.9.12
325 325
 	 * @param string $old_txn_status
326 326
 	 */
327
-	public function set_old_txn_status( $old_txn_status ) {
327
+	public function set_old_txn_status($old_txn_status) {
328 328
 		EE_Error::doing_it_wrong(
329 329
 			__METHOD__,
330 330
 			esc_html__(
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			'4.9.12'
335 335
 		);
336 336
 		// only set the first time
337
-		if ( $this->_old_txn_status === null ) {
337
+		if ($this->_old_txn_status === null) {
338 338
 			$this->_old_txn_status = $old_txn_status;
339 339
 		}
340 340
 	}
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 * @deprecated 4.9.12
364 364
 	 * @param string $new_txn_status
365 365
 	 */
366
-	public function set_new_txn_status( $new_txn_status ) {
366
+	public function set_new_txn_status($new_txn_status) {
367 367
 		EE_Error::doing_it_wrong(
368 368
 			__METHOD__,
369 369
 			esc_html__(
Please login to merge, or discard this patch.