Completed
Branch FET/10766/extract-activation-d... (f6eee0)
by
unknown
40:52 queued 32:47
created
core/libraries/form_sections/inputs/EE_Year_Input.input.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 
5 5
 /**
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * ------------------------------------------------------------------------
26 26
  */
27
-class EE_Year_Input extends EE_Select_Input{
27
+class EE_Year_Input extends EE_Select_Input {
28 28
 
29
-	function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0 ){
30
-		if($four_digit_year){
29
+	function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0) {
30
+		if ($four_digit_year) {
31 31
 			$current_year_int = intval(date('Y'));
32
-		}else{
32
+		} else {
33 33
 			$current_year_int = intval(date('y'));
34 34
 		}
35 35
 		$answer_options = array();
36
-		for( $start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++){
36
+		for ($start = $current_year_int - $years_behind; $start <= ($current_year_int + $years_ahead); $start++) {
37 37
 			$answer_options[$start] = $start;
38 38
 		}
39
-		parent::__construct( $answer_options, $input_settings );
39
+		parent::__construct($answer_options, $input_settings);
40 40
 	}
41 41
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -29,7 +30,7 @@  discard block
 block discarded – undo
29 30
 	function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 100, $years_ahead = 0 ){
30 31
 		if($four_digit_year){
31 32
 			$current_year_int = intval(date('Y'));
32
-		}else{
33
+		} else{
33 34
 			$current_year_int = intval(date('y'));
34 35
 		}
35 36
 		$answer_options = array();
Please login to merge, or discard this patch.
admin_pages/messages/qtips/EE_Message_List_Table_Tips.lib.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	protected function _set_tips_array() {
19 19
 		$this->_qtipsa = array(
20 20
 			0 => array(
21
-				'content_id' => 'message_status-' . EEM_Message::status_sent,
22
-				'target' => '.msg-status-' . EEM_Message::status_sent,
23
-				'content' => $this->_message_status_legend( EEM_Message::status_sent ),
21
+				'content_id' => 'message_status-'.EEM_Message::status_sent,
22
+				'target' => '.msg-status-'.EEM_Message::status_sent,
23
+				'content' => $this->_message_status_legend(EEM_Message::status_sent),
24 24
 				'options' => array(
25 25
 					'position' => array(
26 26
 						'target' => 'mouse',
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 					)
29 29
 				),
30 30
 			1 => array(
31
-				'content_id' => 'message_status-' . EEM_Message::status_idle,
32
-				'target' => '.msg-status-' . EEM_Message::status_idle,
33
-				'content' => $this->_message_status_legend( EEM_Message::status_idle ),
31
+				'content_id' => 'message_status-'.EEM_Message::status_idle,
32
+				'target' => '.msg-status-'.EEM_Message::status_idle,
33
+				'content' => $this->_message_status_legend(EEM_Message::status_idle),
34 34
 				'options' => array(
35 35
 					'position' => array(
36 36
 						'target' => 'mouse',
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 					)
39 39
 				),
40 40
 			2 => array(
41
-				'content_id' => 'message_status-' . EEM_Message::status_failed,
42
-				'target' => '.msg-status-' . EEM_Message::status_failed,
43
-				'content' => $this->_message_status_legend( EEM_Message::status_failed ),
41
+				'content_id' => 'message_status-'.EEM_Message::status_failed,
42
+				'target' => '.msg-status-'.EEM_Message::status_failed,
43
+				'content' => $this->_message_status_legend(EEM_Message::status_failed),
44 44
 				'options' => array(
45 45
 					'position' => array(
46 46
 						'target' => 'mouse',
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 					)
49 49
 				),
50 50
 			3 => array(
51
-				'content_id' => 'message_status-' . EEM_Message::status_resend,
52
-				'target' => '.msg-status-' . EEM_Message::status_resend,
53
-				'content' => $this->_message_status_legend( EEM_Message::status_resend ),
51
+				'content_id' => 'message_status-'.EEM_Message::status_resend,
52
+				'target' => '.msg-status-'.EEM_Message::status_resend,
53
+				'content' => $this->_message_status_legend(EEM_Message::status_resend),
54 54
 				'options' => array(
55 55
 					'position' => array(
56 56
 						'target' => 'mouse',
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 					)
59 59
 				),
60 60
 			4 => array(
61
-				'content_id' => 'message_status-' . EEM_Message::status_incomplete,
62
-				'target' => '.msg-status-' . EEM_Message::status_incomplete,
63
-				'content' => $this->_message_status_legend( EEM_Message::status_incomplete ),
61
+				'content_id' => 'message_status-'.EEM_Message::status_incomplete,
62
+				'target' => '.msg-status-'.EEM_Message::status_incomplete,
63
+				'content' => $this->_message_status_legend(EEM_Message::status_incomplete),
64 64
 				'options' => array(
65 65
 					'position' => array(
66 66
 						'target' => 'mouse',
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 					)
69 69
 				),
70 70
 			5 => array(
71
-				'content_id' => 'message_status-' . EEM_Message::status_retry,
72
-				'target' => '.msg-status-' . EEM_Message::status_retry,
73
-				'content' => $this->_message_status_legend( EEM_Message::status_retry ),
71
+				'content_id' => 'message_status-'.EEM_Message::status_retry,
72
+				'target' => '.msg-status-'.EEM_Message::status_retry,
73
+				'content' => $this->_message_status_legend(EEM_Message::status_retry),
74 74
 				'options' => array(
75 75
 					'position' => array(
76 76
 						'target' => 'mouse',
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 					)
79 79
 				),
80 80
 			6 => array(
81
-				'content_id' => 'message_status-' . EEM_Message::status_debug_only,
82
-				'target' => '.msg-status-' . EEM_Message::status_debug_only,
83
-				'content' => $this->_message_status_legend( EEM_Message::status_debug_only ),
81
+				'content_id' => 'message_status-'.EEM_Message::status_debug_only,
82
+				'target' => '.msg-status-'.EEM_Message::status_debug_only,
83
+				'content' => $this->_message_status_legend(EEM_Message::status_debug_only),
84 84
 				'options' => array(
85 85
 					'position' => array(
86 86
 						'target' => 'mouse',
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @param  EEM_Message constant $status What status is set (by class)
100 100
 	 * @return string         The status legend with the related status highlighted
101 101
 	 */
102
-	private function _message_status_legend( $status ) {
102
+	private function _message_status_legend($status) {
103 103
 
104 104
 		$status_array = array(
105 105
 			'sent_status' => EEM_Message::status_sent,
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 			'retry_status' => EEM_Message::status_retry,
111 111
 			);
112 112
 
113
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
113
+		if (defined('WP_DEBUG') && WP_DEBUG) {
114 114
 			$status_array['debug_only_status'] = EEM_Message::status_debug_only;
115 115
 		}
116 116
 
117
-		return EEH_Template::status_legend( $status_array, $status );
117
+		return EEH_Template::status_legend($status_array, $status);
118 118
 	}
119 119
 }
120 120
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Text_Area_Input.input.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  *
9 9
  * This input has a default validation strategy of plaintext (which can be removed after construction)
10 10
  */
11
-class EE_Text_Area_Input extends EE_Form_Input_Base{
11
+class EE_Text_Area_Input extends EE_Form_Input_Base {
12 12
 
13 13
 
14 14
 	protected $_rows = 2;
@@ -18,28 +18,28 @@  discard block
 block discarded – undo
18 18
 	 * sets the rows property on this input
19 19
 	 * @param int $rows
20 20
 	 */
21
-	public function set_rows( $rows ) {
21
+	public function set_rows($rows) {
22 22
 		$this->_rows = $rows;
23 23
 	}
24 24
 	/**
25 25
 	 * sets the cols html property on this input
26 26
 	 * @param int $cols
27 27
 	 */
28
-	public function set_cols( $cols ) {
28
+	public function set_cols($cols) {
29 29
 		$this->_cols = $cols;
30 30
 	}
31 31
 	/**
32 32
 	 *
33 33
 	 * @return int
34 34
 	 */
35
-	public function get_rows(){
35
+	public function get_rows() {
36 36
 		return $this->_rows;
37 37
 	}
38 38
 	/**
39 39
 	 *
40 40
 	 * @return int
41 41
 	 */
42
-	public function get_cols(){
42
+	public function get_cols() {
43 43
 		return $this->_cols;
44 44
 	}
45 45
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		
58 58
 		//if the input hasn't specifically mentioned a more lenient validation strategy, 
59 59
 		//apply plaintext validation strategy
60
-		if( ! $this->has_validation_strategy( 
60
+		if ( ! $this->has_validation_strategy( 
61 61
 				array(
62 62
 					'EE_Full_HTML_Validation_Strategy',
63 63
 					'EE_Simple_HTML_Validation_Strategy'
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		) {
67 67
 			//by default we use the plaintext validation. If you want something else,
68 68
 			//just remove it after the input is constructed :P using EE_Form_Input_Base::remove_validation_strategy()
69
-			$this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() );
69
+			$this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy());
70 70
 		}
71 71
 	}
72 72
 }
Please login to merge, or discard this patch.
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.
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/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.
core/db_classes/EE_Question.class.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 	 * Adds an option for this question. Note: if the option were previously associated with a different
370 370
 	 * Question, that relationship will be overwritten.
371 371
 	 * @param EE_Question_Option $option
372
-	 * @return boolean success
372
+	 * @return EE_Base_Class success
373 373
 	 */
374 374
 	public function add_option( EE_Question_Option $option ) {
375 375
 		return $this->_add_relation_to( $option, 'Question_Option' );
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	/**
393 393
 	 * Marks the option as deleted.
394 394
 	 * @param EE_Question_Option $option
395
-	 * @return boolean success
395
+	 * @return EE_Base_Class success
396 396
 	 */
397 397
 	public function remove_option( EE_Question_Option $option ) {
398 398
 		return $this->_remove_relation_to( $option, 'Question_Option' );
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 		$new_question->set_admin_label( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->admin_label() ) );
446 446
 		$new_question->set_system_ID( null );
447 447
 		$new_question->set_wp_user( get_current_user_id() );
448
-                //if we're duplicating a trashed question, assume we don't want the new one to be trashed
449
-                $new_question->set_deleted( false );
448
+				//if we're duplicating a trashed question, assume we don't want the new one to be trashed
449
+				$new_question->set_deleted( false );
450 450
 		$success = $new_question->save();
451 451
 		if( $success ) {
452 452
 			//we don't totally want to duplicate the question options, because we want them to be for the NEW question
@@ -501,8 +501,8 @@  discard block
 block discarded – undo
501 501
 		}
502 502
 		// has this question been answered ?
503 503
 		if ( $answer instanceof EE_Answer
504
-             && $answer->value() !== ''
505
-        ) {
504
+			 && $answer->value() !== ''
505
+		) {
506 506
 			//answer gets htmlspecialchars called on it, undo that please
507 507
 			//because the form input's display strategy may call esc_attr too
508 508
 			//which also does html special characters
@@ -516,10 +516,10 @@  discard block
 block discarded – undo
516 516
 		}
517 517
 		$max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question( $this->system_ID() );
518 518
 		if( in_array(
519
-		    $this->type(),
520
-            EEM_Question::instance()->questionTypesWithMaxLength(),
521
-            true
522
-        ) ) {
519
+			$this->type(),
520
+			EEM_Question::instance()->questionTypesWithMaxLength(),
521
+			true
522
+		) ) {
523 523
 			$input_constructor_args[ 'validation_strategies' ][] = new EE_Max_Length_Validation_Strategy(
524 524
 				null,
525 525
 				min( $max_max_for_question, $this->max() )
@@ -632,17 +632,17 @@  discard block
 block discarded – undo
632 632
 
633 633
 
634 634
 
635
-    /**
636
-     * Returns whether or not this question type should have question option entries
637
-     * @return bool
638
-     */
635
+	/**
636
+	 * Returns whether or not this question type should have question option entries
637
+	 * @return bool
638
+	 */
639 639
 	public function should_have_question_options()
640
-    {
641
-        return in_array(
642
-            $this->type(),
643
-            $this->_model->question_types_with_options(),
644
-            true
645
-        );
646
-    }
640
+	{
641
+		return in_array(
642
+			$this->type(),
643
+			$this->_model->question_types_with_options(),
644
+			true
645
+		);
646
+	}
647 647
 
648 648
 }
Please login to merge, or discard this patch.
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 *                             		    date_format and the second value is the time format
38 38
 	 * @return EE_Question
39 39
 	 */
40
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
41
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
42
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
40
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
41
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
42
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
43 43
 	}
44 44
 
45 45
 
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 *                          		the website will be used.
51 51
 	 * @return EE_Question
52 52
 	 */
53
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
54
-		return new self( $props_n_values, TRUE, $timezone );
53
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
54
+		return new self($props_n_values, TRUE, $timezone);
55 55
 	}
56 56
 
57 57
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 * @access        public
63 63
 	 * @param string $QST_display_text
64 64
 	 */
65
-	public function set_display_text( $QST_display_text = '' ) {
66
-		$this->set( 'QST_display_text', $QST_display_text );
65
+	public function set_display_text($QST_display_text = '') {
66
+		$this->set('QST_display_text', $QST_display_text);
67 67
 	}
68 68
 
69 69
 
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 	 * @access        public
75 75
 	 * @param        string $QST_admin_label
76 76
 	 */
77
-	public function set_admin_label( $QST_admin_label = '' ) {
78
-		$this->set( 'QST_admin_label', $QST_admin_label );
77
+	public function set_admin_label($QST_admin_label = '') {
78
+		$this->set('QST_admin_label', $QST_admin_label);
79 79
 	}
80 80
 
81 81
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @access        public
87 87
 	 * @param        mixed $QST_system
88 88
 	 */
89
-	public function set_system_ID( $QST_system = '' ) {
90
-		$this->set( 'QST_system', $QST_system );
89
+	public function set_system_ID($QST_system = '') {
90
+		$this->set('QST_system', $QST_system);
91 91
 	}
92 92
 
93 93
 
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	 * @access        public
99 99
 	 * @param        string $QST_type
100 100
 	 */
101
-	public function set_question_type( $QST_type = '' ) {
102
-		$this->set( 'QST_type', $QST_type );
101
+	public function set_question_type($QST_type = '') {
102
+		$this->set('QST_type', $QST_type);
103 103
 	}
104 104
 
105 105
 
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	 * @access        public
111 111
 	 * @param        bool $QST_required
112 112
 	 */
113
-	public function set_required( $QST_required = FALSE ) {
114
-		$this->set( 'QST_required', $QST_required );
113
+	public function set_required($QST_required = FALSE) {
114
+		$this->set('QST_required', $QST_required);
115 115
 	}
116 116
 
117 117
 
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	 * @access        public
123 123
 	 * @param        string $QST_required_text
124 124
 	 */
125
-	public function set_required_text( $QST_required_text = '' ) {
126
-		$this->set( 'QST_required_text', $QST_required_text );
125
+	public function set_required_text($QST_required_text = '') {
126
+		$this->set('QST_required_text', $QST_required_text);
127 127
 	}
128 128
 
129 129
 
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	 * @access        public
135 135
 	 * @param        int $QST_order
136 136
 	 */
137
-	public function set_order( $QST_order = 0 ) {
138
-		$this->set( 'QST_order', $QST_order );
137
+	public function set_order($QST_order = 0) {
138
+		$this->set('QST_order', $QST_order);
139 139
 	}
140 140
 
141 141
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 	 * @access        public
147 147
 	 * @param        bool $QST_admin_only
148 148
 	 */
149
-	public function set_admin_only( $QST_admin_only = FALSE ) {
150
-		$this->set( 'QST_admin_only', $QST_admin_only );
149
+	public function set_admin_only($QST_admin_only = FALSE) {
150
+		$this->set('QST_admin_only', $QST_admin_only);
151 151
 	}
152 152
 
153 153
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	 * @access        public
159 159
 	 * @param        int $QST_wp_user
160 160
 	 */
161
-	public function set_wp_user( $QST_wp_user = 1 ) {
162
-		$this->set( 'QST_wp_user', $QST_wp_user );
161
+	public function set_wp_user($QST_wp_user = 1) {
162
+		$this->set('QST_wp_user', $QST_wp_user);
163 163
 	}
164 164
 
165 165
 
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 	 * @access        public
176 176
 	 * @param 	bool $QST_deleted
177 177
 	 */
178
-	public function set_deleted( $QST_deleted = FALSE ) {
179
-		$this->set( 'QST_deleted', $QST_deleted );
178
+	public function set_deleted($QST_deleted = FALSE) {
179
+		$this->set('QST_deleted', $QST_deleted);
180 180
 	}
181 181
 
182 182
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @return string
188 188
 	 */
189 189
 	public function display_text() {
190
-		return $this->get( 'QST_display_text' );
190
+		return $this->get('QST_display_text');
191 191
 	}
192 192
 
193 193
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @return string
199 199
 	 */
200 200
 	public function admin_label() {
201
-		return $this->get( 'QST_admin_label' );
201
+		return $this->get('QST_admin_label');
202 202
 	}
203 203
 
204 204
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @return string
210 210
 	 */
211 211
 	public function system_ID() {
212
-		return $this->get( 'QST_system' );
212
+		return $this->get('QST_system');
213 213
 	}
214 214
 
215 215
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	 * @return boolean
221 221
 	 */
222 222
 	public function required() {
223
-		return $this->get( 'QST_required' );
223
+		return $this->get('QST_required');
224 224
 	}
225 225
 
226 226
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 * @return string
233 233
 	 */
234 234
 	public function required_text() {
235
-		return $this->get( 'QST_required_text' );
235
+		return $this->get('QST_required_text');
236 236
 	}
237 237
 
238 238
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 * @return string
244 244
 	 */
245 245
 	public function type() {
246
-		return $this->get( 'QST_type' );
246
+		return $this->get('QST_type');
247 247
 	}
248 248
 
249 249
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @return int
256 256
 	 */
257 257
 	public function order() {
258
-		return $this->get( 'QST_order' );
258
+		return $this->get('QST_order');
259 259
 	}
260 260
 
261 261
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @return boolean
268 268
 	 */
269 269
 	public function admin_only() {
270
-		return $this->get( 'QST_admin_only' );
270
+		return $this->get('QST_admin_only');
271 271
 	}
272 272
 
273 273
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 * @return int
279 279
 	 */
280 280
 	public function wp_user() {
281
-		return $this->get( 'QST_wp_user' );
281
+		return $this->get('QST_wp_user');
282 282
 	}
283 283
 
284 284
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 	 * @return boolean
290 290
 	 */
291 291
 	public function deleted() {
292
-		return $this->get( 'QST_deleted' );
292
+		return $this->get('QST_deleted');
293 293
 	}
294 294
 
295 295
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @return EE_Answer[]
300 300
 	 */
301 301
 	public function answers() {
302
-		return $this->get_many_related( 'Answer' );
302
+		return $this->get_many_related('Answer');
303 303
 	}
304 304
 
305 305
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	 * @return boolean true = has answers, false = no answers.
310 310
 	 */
311 311
 	public function has_answers() {
312
-		return $this->count_related( 'Answer' ) > 0 ? TRUE : FALSE;
312
+		return $this->count_related('Answer') > 0 ? TRUE : FALSE;
313 313
 	}
314 314
 
315 315
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	 * @return EE_Question_Group[]
320 320
 	 */
321 321
 	public function question_groups() {
322
-		return $this->get_many_related( 'Question_Group' );
322
+		return $this->get_many_related('Question_Group');
323 323
 	}
324 324
 
325 325
 
@@ -333,24 +333,24 @@  discard block
 block discarded – undo
333 333
 	 *                                                       whether it was trashed or not.
334 334
 	 * @return EE_Question_Option[]
335 335
 	 */
336
-	public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) {
337
-		if ( ! $this->ID() ) {
336
+	public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) {
337
+		if ( ! $this->ID()) {
338 338
 			return array();
339 339
 		}
340 340
 		$query_params = array();
341
-		if ( $selected_value_to_always_include ) {
342
-			if ( is_array( $selected_value_to_always_include ) ) {
343
-				$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = array( 'IN', $selected_value_to_always_include );
341
+		if ($selected_value_to_always_include) {
342
+			if (is_array($selected_value_to_always_include)) {
343
+				$query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include);
344 344
 			} else {
345
-				$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = $selected_value_to_always_include;
345
+				$query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include;
346 346
 			}
347 347
 		}
348
-		if ( $notDeletedOptionsOnly ) {
349
-			$query_params[ 0 ][ 'OR*options-query' ][ 'QSO_deleted' ] = FALSE;
348
+		if ($notDeletedOptionsOnly) {
349
+			$query_params[0]['OR*options-query']['QSO_deleted'] = FALSE;
350 350
 		}
351 351
 		//order by QSO_order
352
-		$query_params[ 'order_by' ] = array( 'QSO_order' => 'ASC' );
353
-		return $this->get_many_related( 'Question_Option', $query_params );
352
+		$query_params['order_by'] = array('QSO_order' => 'ASC');
353
+		return $this->get_many_related('Question_Option', $query_params);
354 354
 	}
355 355
 
356 356
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @return \EE_Question_Option[]
361 361
 	 */
362 362
 	public function temp_options() {
363
-		return $this->_model_relations[ 'Question_Option' ];
363
+		return $this->_model_relations['Question_Option'];
364 364
 	}
365 365
 
366 366
 
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
 	 * @param EE_Question_Option $option
372 372
 	 * @return boolean success
373 373
 	 */
374
-	public function add_option( EE_Question_Option $option ) {
375
-		return $this->_add_relation_to( $option, 'Question_Option' );
374
+	public function add_option(EE_Question_Option $option) {
375
+		return $this->_add_relation_to($option, 'Question_Option');
376 376
 	}
377 377
 
378 378
 
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @param EE_Question_Option $option
383 383
 	 * @return boolean success
384 384
 	 */
385
-	public function add_temp_option( EE_Question_Option $option ) {
386
-		$this->_model_relations[ 'Question_Option' ][ ] = $option;
385
+	public function add_temp_option(EE_Question_Option $option) {
386
+		$this->_model_relations['Question_Option'][] = $option;
387 387
 		return TRUE;
388 388
 	}
389 389
 
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
 	 * @param EE_Question_Option $option
395 395
 	 * @return boolean success
396 396
 	 */
397
-	public function remove_option( EE_Question_Option $option ) {
398
-		return $this->_remove_relation_to( $option, 'Question_Option' );
397
+	public function remove_option(EE_Question_Option $option) {
398
+		return $this->_remove_relation_to($option, 'Question_Option');
399 399
 	}
400 400
 
401 401
 
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 	 * @return bool
405 405
 	 */
406 406
 	public function is_system_question() {
407
-		$system_ID = $this->get( 'QST_system' );
408
-		return ! empty( $system_ID ) ? TRUE : FALSE;
407
+		$system_ID = $this->get('QST_system');
408
+		return ! empty($system_ID) ? TRUE : FALSE;
409 409
 	}
410 410
 
411 411
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 	 */
419 419
 	public function set_order_to_latest() {
420 420
 		$latest_order = $this->get_model()->get_latest_question_order();
421
-		$latest_order ++;
422
-		$this->set( 'QST_order', $latest_order );
421
+		$latest_order++;
422
+		$this->set('QST_order', $latest_order);
423 423
 	}
424 424
 
425 425
 
@@ -438,20 +438,20 @@  discard block
 block discarded – undo
438 438
 	 * Duplicates this question and its question options
439 439
 	 * @return \EE_Question
440 440
 	 */
441
-	public function duplicate( $options = array() ) {
441
+	public function duplicate($options = array()) {
442 442
 		$new_question = clone $this;
443
-		$new_question->set( 'QST_ID', null );
444
-		$new_question->set_display_text( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->display_text() ) );
445
-		$new_question->set_admin_label( sprintf( __( '%s **Duplicate**', 'event_espresso' ), $this->admin_label() ) );
446
-		$new_question->set_system_ID( null );
447
-		$new_question->set_wp_user( get_current_user_id() );
443
+		$new_question->set('QST_ID', null);
444
+		$new_question->set_display_text(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->display_text()));
445
+		$new_question->set_admin_label(sprintf(__('%s **Duplicate**', 'event_espresso'), $this->admin_label()));
446
+		$new_question->set_system_ID(null);
447
+		$new_question->set_wp_user(get_current_user_id());
448 448
                 //if we're duplicating a trashed question, assume we don't want the new one to be trashed
449
-                $new_question->set_deleted( false );
449
+                $new_question->set_deleted(false);
450 450
 		$success = $new_question->save();
451
-		if( $success ) {
451
+		if ($success) {
452 452
 			//we don't totally want to duplicate the question options, because we want them to be for the NEW question
453
-			foreach( $this->options() as $question_option ) {
454
-				$question_option->duplicate( array( 'QST_ID' => $new_question->ID() ) );
453
+			foreach ($this->options() as $question_option) {
454
+				$question_option->duplicate(array('QST_ID' => $new_question->ID()));
455 455
 			}
456 456
 			return $new_question;
457 457
 		} else {
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 * @return int|float
465 465
 	 */
466 466
 	public function max() {
467
-		return $this->get( 'QST_max' );
467
+		return $this->get('QST_max');
468 468
 	}
469 469
 
470 470
 	/**
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 	 * @param int|float $new_max
473 473
 	 * @return void
474 474
 	 */
475
-	public function set_max( $new_max ) {
476
-		$this->set( 'QST_max', $new_max );
475
+	public function set_max($new_max) {
476
+		$this->set('QST_max', $new_max);
477 477
 	}
478 478
 
479 479
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 	 * @param array $input_constructor_args
486 486
 	 * @return EE_Form_Input_Base
487 487
 	 */
488
-	public function generate_form_input( $registration = null, $answer = null, $input_constructor_args = array() ) {
488
+	public function generate_form_input($registration = null, $answer = null, $input_constructor_args = array()) {
489 489
 		$identifier = $this->is_system_question() ? $this->system_ID() : $this->ID();
490 490
 
491 491
 		$input_constructor_args = array_merge(
@@ -496,33 +496,33 @@  discard block
 block discarded – undo
496 496
 				),
497 497
 				$input_constructor_args
498 498
 			);
499
-		if( ! $answer instanceof EE_Answer && $registration instanceof EE_Registration ) {
500
-			$answer = EEM_Answer::instance()->get_registration_question_answer_object( $registration, $this->ID() );
499
+		if ( ! $answer instanceof EE_Answer && $registration instanceof EE_Registration) {
500
+			$answer = EEM_Answer::instance()->get_registration_question_answer_object($registration, $this->ID());
501 501
 		}
502 502
 		// has this question been answered ?
503
-		if ( $answer instanceof EE_Answer
503
+		if ($answer instanceof EE_Answer
504 504
              && $answer->value() !== ''
505 505
         ) {
506 506
 			//answer gets htmlspecialchars called on it, undo that please
507 507
 			//because the form input's display strategy may call esc_attr too
508 508
 			//which also does html special characters
509 509
 			$values_with_html_special_chars = $answer->value();
510
-			if( is_array( $values_with_html_special_chars ) ) {
511
-				$default_value = array_map( 'htmlspecialchars_decode', $values_with_html_special_chars );
510
+			if (is_array($values_with_html_special_chars)) {
511
+				$default_value = array_map('htmlspecialchars_decode', $values_with_html_special_chars);
512 512
 			} else {
513
-				$default_value = htmlspecialchars_decode( $values_with_html_special_chars );
513
+				$default_value = htmlspecialchars_decode($values_with_html_special_chars);
514 514
 			}
515 515
 			$input_constructor_args['default'] = $default_value;
516 516
 		}
517
-		$max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question( $this->system_ID() );
518
-		if( in_array(
517
+		$max_max_for_question = EEM_Question::instance()->absolute_max_for_system_question($this->system_ID());
518
+		if (in_array(
519 519
 		    $this->type(),
520 520
             EEM_Question::instance()->questionTypesWithMaxLength(),
521 521
             true
522
-        ) ) {
523
-			$input_constructor_args[ 'validation_strategies' ][] = new EE_Max_Length_Validation_Strategy(
522
+        )) {
523
+			$input_constructor_args['validation_strategies'][] = new EE_Max_Length_Validation_Strategy(
524 524
 				null,
525
-				min( $max_max_for_question, $this->max() )
525
+				min($max_max_for_question, $this->max())
526 526
 			);
527 527
 		}
528 528
 		$input_constructor_args = apply_filters(
@@ -534,22 +534,22 @@  discard block
 block discarded – undo
534 534
 		);
535 535
 
536 536
 		$result = null;
537
-		switch ( $this->type() ) {
537
+		switch ($this->type()) {
538 538
 			// Text
539 539
 			case EEM_Question::QST_type_text :
540
-				$result = new EE_Text_Input( $input_constructor_args );
540
+				$result = new EE_Text_Input($input_constructor_args);
541 541
 				break;
542 542
 			// Textarea
543 543
 			case EEM_Question::QST_type_textarea :
544
-				$result = new EE_Text_Area_Input( $input_constructor_args );
544
+				$result = new EE_Text_Area_Input($input_constructor_args);
545 545
 				break;
546 546
 			// Radio Buttons
547 547
 			case EEM_Question::QST_type_radio :
548
-				$result = new EE_Radio_Button_Input( $this->options(), $input_constructor_args );
548
+				$result = new EE_Radio_Button_Input($this->options(), $input_constructor_args);
549 549
 				break;
550 550
 			// Dropdown
551 551
 			case EEM_Question::QST_type_dropdown :
552
-				$result = new EE_Select_Input( $this->options(), $input_constructor_args );
552
+				$result = new EE_Select_Input($this->options(), $input_constructor_args);
553 553
 				break;
554 554
 			// State Dropdown
555 555
 			case EEM_Question::QST_type_state :
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 					$registration,
561 561
 					$answer
562 562
 				);				
563
-				$result = new EE_State_Select_Input( $state_options, $input_constructor_args );
563
+				$result = new EE_State_Select_Input($state_options, $input_constructor_args);
564 564
 				break;
565 565
 			// Country Dropdown
566 566
 			case EEM_Question::QST_type_country :
@@ -571,47 +571,47 @@  discard block
 block discarded – undo
571 571
 					$registration,
572 572
 					$answer
573 573
 				);
574
-				$result = new EE_Country_Select_Input( $country_options, $input_constructor_args );
574
+				$result = new EE_Country_Select_Input($country_options, $input_constructor_args);
575 575
 				break;
576 576
 			// Checkboxes
577 577
 			case EEM_Question::QST_type_checkbox :
578
-				$result = new EE_Checkbox_Multi_Input( $this->options(), $input_constructor_args );
578
+				$result = new EE_Checkbox_Multi_Input($this->options(), $input_constructor_args);
579 579
 				break;
580 580
 			// Date
581 581
 			case EEM_Question::QST_type_date :
582
-				$result = new EE_Datepicker_Input( $input_constructor_args );
582
+				$result = new EE_Datepicker_Input($input_constructor_args);
583 583
 				break;
584 584
 			case EEM_Question::QST_type_html_textarea :
585
-				$input_constructor_args[ 'validation_strategies' ][] = new EE_Simple_HTML_Validation_Strategy();
586
-				$result =  new EE_Text_Area_Input( $input_constructor_args );
587
-				$result->remove_validation_strategy( 'EE_Plaintext_Validation_Strategy' );
585
+				$input_constructor_args['validation_strategies'][] = new EE_Simple_HTML_Validation_Strategy();
586
+				$result = new EE_Text_Area_Input($input_constructor_args);
587
+				$result->remove_validation_strategy('EE_Plaintext_Validation_Strategy');
588 588
 				break;
589 589
 			case EEM_Question::QST_type_email :
590
-				$result = new EE_Email_Input( $input_constructor_args );
590
+				$result = new EE_Email_Input($input_constructor_args);
591 591
 				break;
592 592
 			case EEM_Question::QST_type_us_phone :
593
-				$result = new EE_Phone_Input( $input_constructor_args );
593
+				$result = new EE_Phone_Input($input_constructor_args);
594 594
 				break;
595 595
 			case EEM_Question::QST_type_int :
596
-				$result = new EE_Integer_Input( $input_constructor_args );
596
+				$result = new EE_Integer_Input($input_constructor_args);
597 597
 				break;
598 598
 			case EEM_Question::QST_type_decimal :
599
-				$result = new EE_Float_Input( $input_constructor_args );
599
+				$result = new EE_Float_Input($input_constructor_args);
600 600
 				break;
601 601
 			case EEM_Question::QST_type_url :
602
-				$input_constructor_args[ 'validation_strategies' ][] = new EE_URL_Validation_Strategy();
603
-				$result = new EE_Text_Input( $input_constructor_args );
602
+				$input_constructor_args['validation_strategies'][] = new EE_URL_Validation_Strategy();
603
+				$result = new EE_Text_Input($input_constructor_args);
604 604
 				break;
605 605
 			case EEM_Question::QST_type_year :
606 606
 				$result = new EE_Year_Input(
607 607
 						$input_constructor_args,
608
-						apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit', true, $this ),
609
-						apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range', 100, $this ),
610
-						apply_filters( 'FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range', 100, $this )
608
+						apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__four_digit', true, $this),
609
+						apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__early_range', 100, $this),
610
+						apply_filters('FHEE__EE_SPCO_Reg_Step_Attendee_Information___generate_question_input__year_question__end_range', 100, $this)
611 611
 						);
612 612
 				break;
613 613
 			case EEM_Question::QST_type_multi_select :
614
-				$result = new EE_Select_Multiple_Input( $this->options(), $input_constructor_args );
614
+				$result = new EE_Select_Multiple_Input($this->options(), $input_constructor_args);
615 615
 				break;
616 616
 			// fallback
617 617
 			default :
@@ -622,12 +622,12 @@  discard block
 block discarded – undo
622 622
 					$this,
623 623
 					$input_constructor_args
624 624
 				);
625
-				if( ! $default_input ){
626
-					$default_input = new EE_Text_Input( $input_constructor_args );
625
+				if ( ! $default_input) {
626
+					$default_input = new EE_Text_Input($input_constructor_args);
627 627
 				}
628 628
 				$result = $default_input;
629 629
 		}
630
-		return apply_filters( 'FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer );
630
+		return apply_filters('FHEE__EE_Question__generate_form_input__return', $result, $registration, $this, $answer);
631 631
 	}
632 632
 
633 633
 
Please login to merge, or discard this patch.