Completed
Branch BUG-8511-spco-revisit-oversell... (0aad32)
by
unknown
34:42 queued 17:09
created
form_sections/strategies/layout/EE_Form_Section_Layout_Base.strategy.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * stating where the proper subsections should be placed (but usually leaving them to layout
9 9
  * their own headers and footers etc).
10 10
  */
11
-abstract class EE_Form_Section_Layout_Base{
11
+abstract class EE_Form_Section_Layout_Base {
12 12
 
13 13
 	/**
14 14
 	 * Form form section to lay out
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	/**
22 22
 	 * 	__construct
23 23
 	 */
24
-	function __construct(){
24
+	function __construct() {
25 25
 	}
26 26
 
27 27
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * The form section on which this strategy is to perform
31 31
 	 * @param EE_Form_Section_Proper $form
32 32
 	 */
33
-	function _construct_finalize(EE_Form_Section_Proper $form){
33
+	function _construct_finalize(EE_Form_Section_Proper $form) {
34 34
 		$this->_form_section = $form;
35 35
 	}
36 36
 
@@ -53,28 +53,28 @@  discard block
 block discarded – undo
53 53
 	 * Returns the HTML
54 54
 	 * @return string HTML for displaying
55 55
 	 */
56
-	function layout_form(){
56
+	function layout_form() {
57 57
 		$html = '';
58 58
 		// layout_form_begin
59 59
 		$html .= apply_filters(
60
-			'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(),
60
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_'.$this->_form_section->name(),
61 61
 			$this->layout_form_begin(),
62 62
 			$this->_form_section
63 63
 		);
64 64
 		// layout_form_loop
65 65
 		$html .= apply_filters(
66
-			'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(),
66
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_'.$this->_form_section->name(),
67 67
 			$this->layout_form_loop(),
68 68
 			$this->_form_section
69 69
 		);
70 70
 		// layout_form_end
71 71
 		$html .= apply_filters(
72
-			'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(),
72
+			'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_'.$this->_form_section->name(),
73 73
 			$this->layout_form_end(),
74 74
 			$this->_form_section
75 75
 		);
76 76
 
77
-		$html = $this->add_form_section_hooks_and_filters( $html );
77
+		$html = $this->add_form_section_hooks_and_filters($html);
78 78
 		return $html;
79 79
 	}
80 80
 
@@ -83,20 +83,20 @@  discard block
 block discarded – undo
83 83
 	/**
84 84
 	 * @return string
85 85
 	 */
86
-	function layout_form_loop(){
86
+	function layout_form_loop() {
87 87
 		$html = '';
88
-		foreach( $this->_form_section->subsections() as $name => $subsection ){
89
-			if ( $subsection instanceof EE_Form_Input_Base ){
88
+		foreach ($this->_form_section->subsections() as $name => $subsection) {
89
+			if ($subsection instanceof EE_Form_Input_Base) {
90 90
 				$html .= apply_filters(
91
-					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_' . $name . '__in_' . $this->_form_section->name(),
92
-					$this->layout_input( $subsection ),
91
+					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'.$name.'__in_'.$this->_form_section->name(),
92
+					$this->layout_input($subsection),
93 93
 					$this->_form_section,
94 94
 					$subsection
95 95
 				);
96
-			} elseif ( $subsection instanceof EE_Form_Section_Base ){
96
+			} elseif ($subsection instanceof EE_Form_Section_Base) {
97 97
 				$html .= apply_filters(
98
-					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_' . $name . '__in_' . $this->_form_section->name(),
99
-					$this->layout_subsection( $subsection ),
98
+					'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'.$name.'__in_'.$this->_form_section->name(),
99
+					$this->layout_subsection($subsection),
100 100
 					$this->_form_section,
101 101
 					$subsection
102 102
 				);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @param EE_Form_Section_Base $subsection
145 145
 	 * @return string html
146 146
 	 */
147
-	abstract function layout_subsection( $subsection );
147
+	abstract function layout_subsection($subsection);
148 148
 
149 149
 
150 150
 
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 	 * @param EE_Form_Input_Base $input
154 154
 	 * @return string
155 155
 	 */
156
-	public function display_label($input){
157
-		$class = $input->required() ? 'ee-required-label ' . $input->html_label_class() : $input->html_label_class();
158
-		$label_text = $input->required() ? $input->html_label_text() . '<span class="ee-asterisk">*</span>' : $input->html_label_text();
159
-		return '<label id="' . $input->html_label_id() . '" class="' . $class . '" style="' . $input->html_label_style() . '" for="' . $input->html_name() . '">' .  $label_text . '</label>';
156
+	public function display_label($input) {
157
+		$class = $input->required() ? 'ee-required-label '.$input->html_label_class() : $input->html_label_class();
158
+		$label_text = $input->required() ? $input->html_label_text().'<span class="ee-asterisk">*</span>' : $input->html_label_text();
159
+		return '<label id="'.$input->html_label_id().'" class="'.$class.'" style="'.$input->html_label_style().'" for="'.$input->html_name().'">'.$label_text.'</label>';
160 160
 	}
161 161
 
162 162
 
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 	 * @param EE_Form_Input_Base $input
170 170
 	 * @return string
171 171
 	 */
172
-	public function display_errors($input){
173
-		if( $input->get_validation_errors() ){
174
-			return  "<label  id='" . $input->html_id() . "-error' class='error' for='{$input->html_name()}'>" . $input->get_validation_error_string() . "</label>";
175
-		}else{
172
+	public function display_errors($input) {
173
+		if ($input->get_validation_errors()) {
174
+			return  "<label  id='".$input->html_id()."-error' class='error' for='{$input->html_name()}'>".$input->get_validation_error_string()."</label>";
175
+		} else {
176 176
 			return '';
177 177
 		}
178 178
 	}
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 	 * @param EE_Form_Input_Base $input
183 183
 	 * @return string
184 184
 	 */
185
-	public function display_help_text( $input ){
186
-		if ( $input->html_help_text() != '' ) {
185
+	public function display_help_text($input) {
186
+		if ($input->html_help_text() != '') {
187 187
 			$tag = is_admin() ? 'p' : 'span';
188
-			return '<' . $tag . ' id="' . $input->html_id() . '-help" class="' . $input->html_help_class() . '" style="' . $input->html_help_style() . '">' . $input->html_help_text() . '</' . $tag . '>';
188
+			return '<'.$tag.' id="'.$input->html_id().'-help" class="'.$input->html_help_class().'" style="'.$input->html_help_style().'">'.$input->html_help_text().'</'.$tag.'>';
189 189
 		}
190 190
 		return '';
191 191
 	}
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 	 * @param string $html
198 198
 	 * @return string
199 199
 	 */
200
-	public function add_form_section_hooks_and_filters( $html ){
200
+	public function add_form_section_hooks_and_filters($html) {
201 201
 		// replace dashes and spaces with underscores
202
-		$hook_name = str_replace( array( '-', ' ' ), '_', $this->_form_section->html_id() );
203
-		do_action( 'AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section );
204
-		$html = apply_filters( 'AFEE__Form_Section_Layout__' . $hook_name . '__html', $html, $this->_form_section );
205
-		$html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->';
206
-		$html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->';
202
+		$hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id());
203
+		do_action('AHEE__Form_Section_Layout__'.$hook_name, $this->_form_section);
204
+		$html = apply_filters('AFEE__Form_Section_Layout__'.$hook_name.'__html', $html, $this->_form_section);
205
+		$html .= EEH_HTML::nl().'<!-- AHEE__Form_Section_Layout__'.$hook_name.'__html -->';
206
+		$html .= EEH_HTML::nl().'<!-- AFEE__Form_Section_Layout__'.$hook_name.' -->';
207 207
 		return $html;
208 208
 	}
209 209
 
Please login to merge, or discard this patch.
admin_pages/registrations/templates/reg_status_change_buttons.template.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <div id="reg-admin-approve-decline-reg-status-dv">
2 2
 
3 3
 	<h2 id="reg-admin-reg-details-reg-status-hdr">
4
-		<?php echo __( 'Current Registration Status : ', 'event_espresso' ); ?>
4
+		<?php echo __('Current Registration Status : ', 'event_espresso'); ?>
5 5
 		<span class="<?php echo $reg_status_class; ?> bigger-text"><?php echo $reg_status_value; ?></span>
6 6
 	</h2>
7
-	<?php do_action( 'AHEE__reg_status_change_buttons__after_header', $REG_ID ); ?>
7
+	<?php do_action('AHEE__reg_status_change_buttons__after_header', $REG_ID); ?>
8 8
 
9 9
 	<h3 id="reg-admin-reg-details-reg-status-hdr">
10
-		<?php echo __( 'Change Registration Status to :', 'event_espresso' ); ?>
10
+		<?php echo __('Change Registration Status to :', 'event_espresso'); ?>
11 11
 	</h3>
12 12
 
13 13
 	<form id="reg_status_change_form" method="POST" action="<?php echo $form_url; ?>">
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
 		<input type="hidden" name="return" value="view_registration">
17 17
 		<?php echo $nonce; ?>
18 18
 		<?php echo $status_buttons; ?>
19
-		<?php if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'registration_message_type' ) ) : ?>
19
+		<?php if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'registration_message_type')) : ?>
20 20
 			<span id="send-related-messages-dv">
21
-			<label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e( '...and send related messages ?', 'event_espresso' ); ?>
21
+			<label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e('...and send related messages ?', 'event_espresso'); ?>
22 22
 				<input type="checkbox" value="1" id="txn-reg-status-send-notifications-inp" name="txn_reg_status_change[send_notifications]">
23 23
 			</label>
24 24
 			<br/>
25 25
 		</span>
26 26
 			<br/>
27
-			<p class="description"><?php _e( 'If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso' ); ?></p>
27
+			<p class="description"><?php _e('If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso'); ?></p>
28 28
 		<?php endif; ?>
29 29
 	</form>
30 30
 </div>
Please login to merge, or discard this patch.
core/helpers/EEH_Array.helper.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('NO direct script access allowed'); }
3 3
 
4
-require_once( EE_HELPERS . 'EEH_Base.helper.php' );
4
+require_once(EE_HELPERS.'EEH_Base.helper.php');
5 5
 
6 6
 /**
7 7
  * EE_Array
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param  array $array2 an array of objects
27 27
 	 * @return array         an array of objects found in array 1 that aren't found in array 2.
28 28
 	 */
29
-	public static function object_array_diff( $array1, $array2 ) {
30
-		return array_udiff( $array1, $array2, array('self', '_compare_objects' ));
29
+	public static function object_array_diff($array1, $array2) {
30
+		return array_udiff($array1, $array2, array('self', '_compare_objects'));
31 31
 	}
32 32
 
33 33
 	/**
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 	 * @param array $array
37 37
 	 * @return boolean
38 38
 	 */
39
-	public static function is_associative_array( array $array ) {
40
-		return array_keys( $array ) !== range( 0, count( $array ) - 1 );
39
+	public static function is_associative_array(array $array) {
40
+		return array_keys($array) !== range(0, count($array) - 1);
41 41
 	}
42 42
 
43 43
 	/**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * @param array $arr
47 47
 	 * @return mixed what ever is in the array
48 48
 	 */
49
-	public static function get_one_item_from_array($arr){
49
+	public static function get_one_item_from_array($arr) {
50 50
 		$item = end($arr);
51 51
 		reset($arr);
52 52
 		return $item;
@@ -57,16 +57,16 @@  discard block
 block discarded – undo
57 57
 	 * @param mixed $arr
58 58
 	 * @return boolean
59 59
 	 */
60
-	public static function is_multi_dimensional_array($arr){
61
-		if(is_array($arr)){
60
+	public static function is_multi_dimensional_array($arr) {
61
+		if (is_array($arr)) {
62 62
 			$first_item = reset($arr);
63
-			if(is_array($first_item)){
64
-				return true;//yep, there's at least 2 levels to this array
65
-			}else{
66
-				return false;//nope, only 1 level
63
+			if (is_array($first_item)) {
64
+				return true; //yep, there's at least 2 levels to this array
65
+			} else {
66
+				return false; //nope, only 1 level
67 67
 			}
68
-		}else{
69
-			return false;//its not an array at all!
68
+		} else {
69
+			return false; //its not an array at all!
70 70
 		}
71 71
 	}
72 72
 
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 * @param mixed $default
78 78
 	 * @return mixed
79 79
 	 */
80
-	public static function is_set( $arr, $index, $default ) {
81
-		return isset( $arr[ $index ] ) ? $arr[ $index ] : $default;
80
+	public static function is_set($arr, $index, $default) {
81
+		return isset($arr[$index]) ? $arr[$index] : $default;
82 82
 	}
83 83
 
84 84
 	/**
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	 * @param mixed $value usually a string, but could be an array or object
87 87
 	 * @return mixed the UN-serialized data
88 88
 	 */
89
-	public static function maybe_unserialize( $value ) {
89
+	public static function maybe_unserialize($value) {
90 90
 		$data = maybe_unserialize($value);
91 91
 		//it's possible that this still has serialized data if its the session.  WP has a bug, http://core.trac.wordpress.org/ticket/26118 that doesnt' unserialize this automatically.
92 92
 		$token = 'C';
93 93
 		$data = is_string($data) ? trim($data) : $data;
94
-		if ( is_string($data) && strlen($data) > 1 && $data[0] == $token  && preg_match( "/^{$token}:[0-9]+:/s", $data ) ) {
94
+		if (is_string($data) && strlen($data) > 1 && $data[0] == $token && preg_match("/^{$token}:[0-9]+:/s", $data)) {
95 95
 			return unserialize($data);
96 96
 		} else {
97 97
 			return $data;
@@ -110,30 +110,30 @@  discard block
 block discarded – undo
110 110
 	 * @param bool $preserve_keys 		whether or not to reset numerically indexed arrays
111 111
 	 * @return array
112 112
 	 */
113
-	public static function insert_into_array( $target_array = array(), $array_to_insert = array(), $offset = null, $add_before = true, $preserve_keys = true ) {
113
+	public static function insert_into_array($target_array = array(), $array_to_insert = array(), $offset = null, $add_before = true, $preserve_keys = true) {
114 114
 		// ensure incoming arrays are actually arrays
115
-		$target_array 		= (array)$target_array;
116
-		$array_to_insert	= (array)$array_to_insert;
115
+		$target_array = (array) $target_array;
116
+		$array_to_insert = (array) $array_to_insert;
117 117
 		// if no offset key was supplied
118
-		if ( empty( $offset )) {
118
+		if (empty($offset)) {
119 119
 			// use start or end of $target_array based on whether we are adding before or not
120
-			$offset = $add_before ? 0 : count( $target_array );
120
+			$offset = $add_before ? 0 : count($target_array);
121 121
 		}
122 122
 		// if offset key is a string, then find the corresponding numeric location for that element
123
-		$offset = is_int( $offset ) ? $offset : array_search( $offset, array_keys( $target_array ) );
123
+		$offset = is_int($offset) ? $offset : array_search($offset, array_keys($target_array));
124 124
 		// add one to the offset if adding after
125 125
 		$offset = $add_before ? $offset : $offset + 1;
126 126
 		// but ensure offset does not exceed the length of the array
127
-		$offset = $offset > count( $target_array ) ? count( $target_array ) : $offset;
127
+		$offset = $offset > count($target_array) ? count($target_array) : $offset;
128 128
 		// reindex array ???
129
-		if ( $preserve_keys ) {
129
+		if ($preserve_keys) {
130 130
 			// take a slice of the target array from the beginning till the offset,
131 131
 			// then add the new data
132 132
 			// then add another slice that starts at the offset and goes till the end
133
-			return array_slice( $target_array, 0, $offset, true ) + $array_to_insert + array_slice( $target_array, $offset, null, true );
133
+			return array_slice($target_array, 0, $offset, true) + $array_to_insert + array_slice($target_array, $offset, null, true);
134 134
 		} else {
135 135
 			// since we don't want to preserve keys, we can use array_splice
136
-			array_splice( $target_array, $offset, 0, $array_to_insert );
136
+			array_splice($target_array, $offset, 0, $array_to_insert);
137 137
 			return $target_array;
138 138
 		}
139 139
 	}
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 	 * @param array $array2
152 152
 	 * @return array
153 153
 	 */
154
-	public static function merge_arrays_and_overwrite_keys( array $array1, array $array2 ) {
155
-		foreach ( $array2 as $key => $value ) {
156
-			$array1[ $key ] = $value;
154
+	public static function merge_arrays_and_overwrite_keys(array $array1, array $array2) {
155
+		foreach ($array2 as $key => $value) {
156
+			$array1[$key] = $value;
157 157
 		}
158 158
 		return $array1;
159 159
 	}
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
 	 * @param mixed $final_value
172 172
 	 * @return array
173 173
 	 */
174
-	public static function convert_array_values_to_keys( array $flat_array, $final_value = null ) {
174
+	public static function convert_array_values_to_keys(array $flat_array, $final_value = null) {
175 175
 		$multidimensional = array();
176 176
 		$reference = &$multidimensional;
177
-		foreach ( $flat_array as $key ) {
178
-			$reference[ $key ] = array();
179
-			$reference = &$reference[ $key ];
177
+		foreach ($flat_array as $key) {
178
+			$reference[$key] = array();
179
+			$reference = &$reference[$key];
180 180
 		}
181
-		if ( $final_value !== null ) {
181
+		if ($final_value !== null) {
182 182
 			$reference = $final_value;
183 183
 		}
184 184
 		return $multidimensional;
Please login to merge, or discard this patch.
core/exceptions/ExceptionStackTraceDisplay.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 			// add generic non-identifying messages for non-privileged users
119 119
 			if ( ! WP_DEBUG ) {
120 120
 				$output .= '<span class="ee-error-user-msg-spn">'
121
-				           . trim( $msg )
122
-				           . '</span> &nbsp; <sup>'
123
-				           . $code
124
-				           . '</sup><br />';
121
+						   . trim( $msg )
122
+						   . '</span> &nbsp; <sup>'
123
+						   . $code
124
+						   . '</sup><br />';
125 125
 			} else {
126 126
 				// or helpful developer messages if debugging is on
127 127
 				$output .= '
@@ -130,39 +130,39 @@  discard block
 block discarded – undo
130 130
 				'
131 131
 				. sprintf(
132 132
 					__( '%1$sAn %2$s was thrown!%3$s code: %4$s', 'event_espresso' ),
133
-				    '<strong class="ee-error-dev-msg-str">',
133
+					'<strong class="ee-error-dev-msg-str">',
134 134
 					get_class( $exception ),
135 135
 					'</strong>  &nbsp; <span>',
136 136
 					$code . '</span>'
137 137
 				)
138 138
 				. '<br />
139 139
 				<span class="big-text">"'
140
-				           . trim( $msg )
141
-				           . '"</span><br/>
140
+						   . trim( $msg )
141
+						   . '"</span><br/>
142 142
 				<a id="display-ee-error-trace-1'
143
-				           . $time
144
-				           . '" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-1'
145
-				           . $time
146
-				           . '">
143
+						   . $time
144
+						   . '" class="display-ee-error-trace-lnk small-text" rel="ee-error-trace-1'
145
+						   . $time
146
+						   . '">
147 147
 					'
148
-				           . __( 'click to view backtrace and class/method details', 'event_espresso' )
149
-				           . '
148
+						   . __( 'click to view backtrace and class/method details', 'event_espresso' )
149
+						   . '
150 150
 				</a><br />
151 151
 				'
152
-				           . $exception->getFile()
153
-				           . sprintf(
154
-					           __( '%1$s( line no: %2$s )%3$s', 'event_espresso' ),
155
-					           ' &nbsp; <span class="small-text lt-grey-text">',
156
-					           $exception->getLine(),
157
-					           '</span>'
158
-				           )
159
-				           . '
152
+						   . $exception->getFile()
153
+						   . sprintf(
154
+							   __( '%1$s( line no: %2$s )%3$s', 'event_espresso' ),
155
+							   ' &nbsp; <span class="small-text lt-grey-text">',
156
+							   $exception->getLine(),
157
+							   '</span>'
158
+						   )
159
+						   . '
160 160
 			</p>
161 161
 			<div id="ee-error-trace-1'
162
-				           . $time
163
-				           . '-dv" class="ee-error-trace-dv" style="display: none;">
162
+						   . $time
163
+						   . '-dv" class="ee-error-trace-dv" style="display: none;">
164 164
 				'
165
-				           . $trace_details;
165
+						   . $trace_details;
166 166
 				if ( ! empty( $class ) ) {
167 167
 					$output .= '
168 168
 				<div style="padding:3px; margin:0 0 1em; border:1px solid #999; background:#fff; border-radius:3px;">
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\exceptions;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	/**
23 23
 	 * @param \Exception $exception
24 24
 	 */
25
-	public function __construct( \Exception $exception ) {
26
-		if ( WP_DEBUG ) {
27
-			$this->displayException( $exception );
25
+	public function __construct(\Exception $exception) {
26
+		if (WP_DEBUG) {
27
+			$this->displayException($exception);
28 28
 		}
29 29
 	}
30 30
 
@@ -34,27 +34,27 @@  discard block
 block discarded – undo
34 34
 	 * @access protected
35 35
 	 * @param \Exception $exception
36 36
 	 */
37
-	protected function displayException( \Exception $exception ) {
37
+	protected function displayException(\Exception $exception) {
38 38
 
39 39
 		$error_code = '';
40 40
 		$trace_details = '';
41 41
 		$time = time();
42 42
 		$trace = $exception->getTrace();
43 43
 		// get separate user and developer messages if they exist
44
-		$msg = explode( '||', $exception->getMessage() );
44
+		$msg = explode('||', $exception->getMessage());
45 45
 		$user_msg = $msg[0];
46
-		$dev_msg = isset( $msg[1] ) ? $msg[1] : $msg[0];
46
+		$dev_msg = isset($msg[1]) ? $msg[1] : $msg[0];
47 47
 		$msg = WP_DEBUG ? $dev_msg : $user_msg;
48 48
 		// start gathering output
49 49
 		$output = $this->exceptionStyles();
50 50
 		$output .= '
51 51
 <div id="ee-error-message" class="error">';
52
-		if ( ! WP_DEBUG ) {
52
+		if ( ! WP_DEBUG) {
53 53
 			$output .= '
54 54
 	<p>';
55 55
 		}
56 56
 			// process trace info
57
-			if ( empty( $trace ) ) {
57
+			if (empty($trace)) {
58 58
 				$trace_details .= __(
59 59
 					'Sorry, but no trace information was available for this exception.',
60 60
 					'event_espresso'
@@ -67,47 +67,47 @@  discard block
 block discarded – undo
67 67
 					<th scope="col" align="right" style="width:2.5%;">#</th>
68 68
 					<th scope="col" align="right" style="width:3.5%;">Line</th>
69 69
 					<th scope="col" align="left" style="width:40%;">File</th>
70
-					<th scope="col" align="left">' . __( 'Class', 'event_espresso' ) . '->' . __( 'Method( arguments )', 'event_espresso' ) . '</th>
70
+					<th scope="col" align="left">' . __('Class', 'event_espresso').'->'.__('Method( arguments )', 'event_espresso').'</th>
71 71
 				</tr>';
72
-				$last_on_stack = count( $trace ) - 1;
72
+				$last_on_stack = count($trace) - 1;
73 73
 				// reverse array so that stack is in proper chronological order
74
-				$sorted_trace = array_reverse( $trace );
75
-				foreach ( $sorted_trace as $nmbr => $trace ) {
76
-					$file = isset( $trace['file'] ) ? $trace['file'] : '';
77
-					$class = isset( $trace['class'] ) ? $trace['class'] : '';
78
-					$type = isset( $trace['type'] ) ? $trace['type'] : '';
79
-					$function = isset( $trace['function'] ) ? $trace['function'] : '';
80
-					$args = isset( $trace['args'] ) ? $this->_convert_args_to_string( $trace['args'] ) : '';
81
-					$args = isset( $trace['args'] ) && count( $trace['args'] ) > 4  ? ' <br />' . $args . '<br />' : $args;
82
-					$line = isset( $trace['line'] ) ? $trace['line'] : '';
74
+				$sorted_trace = array_reverse($trace);
75
+				foreach ($sorted_trace as $nmbr => $trace) {
76
+					$file = isset($trace['file']) ? $trace['file'] : '';
77
+					$class = isset($trace['class']) ? $trace['class'] : '';
78
+					$type = isset($trace['type']) ? $trace['type'] : '';
79
+					$function = isset($trace['function']) ? $trace['function'] : '';
80
+					$args = isset($trace['args']) ? $this->_convert_args_to_string($trace['args']) : '';
81
+					$args = isset($trace['args']) && count($trace['args']) > 4 ? ' <br />'.$args.'<br />' : $args;
82
+					$line = isset($trace['line']) ? $trace['line'] : '';
83 83
 					$zebra = $nmbr % 2 !== 0 ? ' odd' : '';
84
-					if ( empty( $file ) && ! empty( $class ) ) {
85
-						$a = new \ReflectionClass( $class );
84
+					if (empty($file) && ! empty($class)) {
85
+						$a = new \ReflectionClass($class);
86 86
 						$file = $a->getFileName();
87
-						if ( empty( $line ) && ! empty( $function ) ) {
88
-							$b = new \ReflectionMethod( $class, $function );
87
+						if (empty($line) && ! empty($function)) {
88
+							$b = new \ReflectionMethod($class, $function);
89 89
 							$line = $b->getStartLine();
90 90
 						}
91 91
 					}
92
-					if ( $nmbr === $last_on_stack ) {
92
+					if ($nmbr === $last_on_stack) {
93 93
 						$file = $exception->getFile() !== '' ? $exception->getFile() : $file;
94 94
 						$line = $exception->getLine() !== '' ? $exception->getLine() : $line;
95
-						$error_code = $this->generate_error_code( $file, $trace['function'], $line );
95
+						$error_code = $this->generate_error_code($file, $trace['function'], $line);
96 96
 					}
97
-					$file = \EEH_File::standardise_directory_separators( $file );
98
-					$nmbr = ! empty( $nmbr ) ? $nmbr : '&nbsp;';
99
-					$line = ! empty( $line ) ? $line : '&nbsp;';
100
-					$file = ! empty( $file ) ? $file : '&nbsp;';
101
-					$class_display = ! empty( $class ) ? $class : '';
102
-					$type = ! empty( $type ) ? $type : '';
103
-					$function = ! empty( $function ) ? $function : '';
104
-					$args = ! empty( $args ) ? '( ' . $args . ' )' : '()';
97
+					$file = \EEH_File::standardise_directory_separators($file);
98
+					$nmbr = ! empty($nmbr) ? $nmbr : '&nbsp;';
99
+					$line = ! empty($line) ? $line : '&nbsp;';
100
+					$file = ! empty($file) ? $file : '&nbsp;';
101
+					$class_display = ! empty($class) ? $class : '';
102
+					$type = ! empty($type) ? $type : '';
103
+					$function = ! empty($function) ? $function : '';
104
+					$args = ! empty($args) ? '( '.$args.' )' : '()';
105 105
 					$trace_details .= '
106 106
 					<tr>
107
-						<td align="right" valign="top" class="' . $zebra . '">' . $nmbr . '</td>
108
-						<td align="right" valign="top" class="' . $zebra . '">' . $line . '</td>
109
-						<td align="left" valign="top" class="' . $zebra . '">' . $file . '</td>
110
-						<td align="left" valign="top" class="' . $zebra . '">' . $class_display . $type . $function . $args . '</td>
107
+						<td align="right" valign="top" class="' . $zebra.'">'.$nmbr.'</td>
108
+						<td align="right" valign="top" class="' . $zebra.'">'.$line.'</td>
109
+						<td align="left" valign="top" class="' . $zebra.'">'.$file.'</td>
110
+						<td align="left" valign="top" class="' . $zebra.'">'.$class_display.$type.$function.$args.'</td>
111 111
 					</tr>';
112 112
 				}
113 113
 				$trace_details .= '
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 			}
117 117
 			$code = $exception->getCode() ? $exception->getCode() : $error_code;
118 118
 			// add generic non-identifying messages for non-privileged users
119
-			if ( ! WP_DEBUG ) {
119
+			if ( ! WP_DEBUG) {
120 120
 				$output .= '<span class="ee-error-user-msg-spn">'
121
-				           . trim( $msg )
121
+				           . trim($msg)
122 122
 				           . '</span> &nbsp; <sup>'
123 123
 				           . $code
124 124
 				           . '</sup><br />';
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 			<p class="ee-error-dev-msg-pg">
130 130
 				'
131 131
 				. sprintf(
132
-					__( '%1$sAn %2$s was thrown!%3$s code: %4$s', 'event_espresso' ),
132
+					__('%1$sAn %2$s was thrown!%3$s code: %4$s', 'event_espresso'),
133 133
 				    '<strong class="ee-error-dev-msg-str">',
134
-					get_class( $exception ),
134
+					get_class($exception),
135 135
 					'</strong>  &nbsp; <span>',
136
-					$code . '</span>'
136
+					$code.'</span>'
137 137
 				)
138 138
 				. '<br />
139 139
 				<span class="big-text">"'
140
-				           . trim( $msg )
140
+				           . trim($msg)
141 141
 				           . '"</span><br/>
142 142
 				<a id="display-ee-error-trace-1'
143 143
 				           . $time
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 				           . $time
146 146
 				           . '">
147 147
 					'
148
-				           . __( 'click to view backtrace and class/method details', 'event_espresso' )
148
+				           . __('click to view backtrace and class/method details', 'event_espresso')
149 149
 				           . '
150 150
 				</a><br />
151 151
 				'
152 152
 				           . $exception->getFile()
153 153
 				           . sprintf(
154
-					           __( '%1$s( line no: %2$s )%3$s', 'event_espresso' ),
154
+					           __('%1$s( line no: %2$s )%3$s', 'event_espresso'),
155 155
 					           ' &nbsp; <span class="small-text lt-grey-text">',
156 156
 					           $exception->getLine(),
157 157
 					           '</span>'
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 				           . '-dv" class="ee-error-trace-dv" style="display: none;">
164 164
 				'
165 165
 				           . $trace_details;
166
-				if ( ! empty( $class ) ) {
166
+				if ( ! empty($class)) {
167 167
 					$output .= '
168 168
 				<div style="padding:3px; margin:0 0 1em; border:1px solid #999; background:#fff; border-radius:3px;">
169 169
 					<div style="padding:1em 2em; border:1px solid #999; background:#fcfcfc;">
170
-						<h3>' . __( 'Class Details', 'event_espresso' ) . '</h3>';
171
-					$a = new \ReflectionClass( $class );
170
+						<h3>' . __('Class Details', 'event_espresso').'</h3>';
171
+					$a = new \ReflectionClass($class);
172 172
 					$output .= '
173
-						<pre>' . $a . '</pre>
173
+						<pre>' . $a.'</pre>
174 174
 					</div>
175 175
 				</div>';
176 176
 				}
@@ -180,16 +180,16 @@  discard block
 block discarded – undo
180 180
 		<br />';
181 181
 			}
182 182
 		// remove last linebreak
183
-		$output = substr( $output, 0, count( $output ) - 7 );
184
-		if ( ! WP_DEBUG ) {
183
+		$output = substr($output, 0, count($output) - 7);
184
+		if ( ! WP_DEBUG) {
185 185
 			$output .= '
186 186
 	</p>';
187 187
 		}
188 188
 		$output .= '
189 189
 </div>';
190
-		$output .= $this->printScripts( true );
191
-		if ( defined( 'DOING_AJAX' ) ) {
192
-			echo json_encode( array( 'error' => $output ) );
190
+		$output .= $this->printScripts(true);
191
+		if (defined('DOING_AJAX')) {
192
+			echo json_encode(array('error' => $output));
193 193
 			exit();
194 194
 		}
195 195
 		echo $output;
@@ -206,56 +206,56 @@  discard block
 block discarded – undo
206 206
 	 * @param bool  $array
207 207
 	 * @return string
208 208
 	 */
209
-	private function _convert_args_to_string( $arguments = array(), $indent = 0, $array = false ) {
209
+	private function _convert_args_to_string($arguments = array(), $indent = 0, $array = false) {
210 210
 		$args = array();
211
-		$args_count = count( $arguments );
212
-		if ( $args_count > 2 ) {
211
+		$args_count = count($arguments);
212
+		if ($args_count > 2) {
213 213
 			$indent++;
214 214
 			$args[] = '<br />';
215 215
 		}
216 216
 		$x = 0;
217
-		foreach ( $arguments as $arg ) {
217
+		foreach ($arguments as $arg) {
218 218
 			$x++;
219
-			for( $i = 0; $i < $indent; $i++ ) {
219
+			for ($i = 0; $i < $indent; $i++) {
220 220
 				$args[] = ' &nbsp;&nbsp; ';
221 221
 			}
222
-			if ( is_string( $arg ) ) {
223
-				if ( ! $array && strlen( $arg ) > 75 ) {
222
+			if (is_string($arg)) {
223
+				if ( ! $array && strlen($arg) > 75) {
224 224
 					$args[] = "<br />";
225
-					for ( $i = 0; $i <= $indent; $i++ ) {
225
+					for ($i = 0; $i <= $indent; $i++) {
226 226
 						$args[] = ' &nbsp;&nbsp; ';
227 227
 					}
228
-					$args[] = "'" . $arg . "'<br />";
228
+					$args[] = "'".$arg."'<br />";
229 229
 				} else {
230
-					$args[] = " '" . $arg . "'";
230
+					$args[] = " '".$arg."'";
231 231
 				}
232
-			} elseif ( is_array( $arg ) ) {
233
-				$arg_count = count( $arg );
234
-				if ( $arg_count > 2 ) {
232
+			} elseif (is_array($arg)) {
233
+				$arg_count = count($arg);
234
+				if ($arg_count > 2) {
235 235
 					$indent++;
236
-					$args[] = " array(" . $this->_convert_args_to_string( $arg, $indent, true ) . ")";
236
+					$args[] = " array(".$this->_convert_args_to_string($arg, $indent, true).")";
237 237
 					$indent--;
238
-				} else if ( $arg_count === 0 ) {
238
+				} else if ($arg_count === 0) {
239 239
 					$args[] = " array()";
240 240
 				} else {
241
-					$args[] = " array( " . $this->_convert_args_to_string( $arg ) . " )";
241
+					$args[] = " array( ".$this->_convert_args_to_string($arg)." )";
242 242
 				}
243
-			} elseif ( $arg === null ) {
243
+			} elseif ($arg === null) {
244 244
 				$args[] = ' null';
245
-			} elseif ( is_bool( $arg ) ) {
245
+			} elseif (is_bool($arg)) {
246 246
 				$args[] = $arg ? ' true' : ' false';
247
-			} elseif ( is_object( $arg ) ) {
248
-				$args[] = get_class( $arg );
249
-			} elseif ( is_resource( $arg ) ) {
250
-				$args[] = get_resource_type( $arg );
247
+			} elseif (is_object($arg)) {
248
+				$args[] = get_class($arg);
249
+			} elseif (is_resource($arg)) {
250
+				$args[] = get_resource_type($arg);
251 251
 			} else {
252 252
 				$args[] = $arg;
253 253
 			}
254
-			if ( $x === $args_count ) {
255
-				if ( $args_count > 2 ) {
254
+			if ($x === $args_count) {
255
+				if ($args_count > 2) {
256 256
 					$args[] = "<br />";
257 257
 					$indent--;
258
-					for ( $i = 1; $i < $indent; $i++ ) {
258
+					for ($i = 1; $i < $indent; $i++) {
259 259
 						$args[] = ' &nbsp;&nbsp; ';
260 260
 					}
261 261
 				}
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 				$args[] = $args_count > 2 ? ",<br />" : ', ';
264 264
 			}
265 265
 		}
266
-		return implode( '', $args );
266
+		return implode('', $args);
267 267
 	}
268 268
 
269 269
 
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
 	 * @param string $line
279 279
 	 * @return string
280 280
 	 */
281
-	protected function generate_error_code( $file = '', $func = '', $line = '' ) {
282
-		$file_bits = explode( '.', basename( $file ) );
283
-		$error_code = ! empty( $file_bits[0] ) ? $file_bits[0] : '';
284
-		$error_code .= ! empty( $func ) ? ' - ' . $func : '';
285
-		$error_code .= ! empty( $line ) ? ' - ' . $line : '';
281
+	protected function generate_error_code($file = '', $func = '', $line = '') {
282
+		$file_bits = explode('.', basename($file));
283
+		$error_code = ! empty($file_bits[0]) ? $file_bits[0] : '';
284
+		$error_code .= ! empty($func) ? ' - '.$func : '';
285
+		$error_code .= ! empty($line) ? ' - '.$line : '';
286 286
 		return $error_code;
287 287
 	}
288 288
 
@@ -366,26 +366,26 @@  discard block
 block discarded – undo
366 366
 	 * @param bool $force_print
367 367
 	 * @return string|void
368 368
 	 */
369
-	private function printScripts( $force_print = false ) {
370
-		if ( ! $force_print  && ( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' ) ) ) {
371
-			if ( wp_script_is( 'ee_error_js', 'enqueued' ) ) {
369
+	private function printScripts($force_print = false) {
370
+		if ( ! $force_print && (did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts'))) {
371
+			if (wp_script_is('ee_error_js', 'enqueued')) {
372 372
 				return '';
373
-			} else if ( wp_script_is( 'ee_error_js', 'registered' ) ) {
374
-				add_filter( 'FHEE_load_css', '__return_true' );
375
-				add_filter( 'FHEE_load_js', '__return_true' );
376
-				wp_enqueue_script( 'ee_error_js' );
377
-				wp_localize_script( 'ee_error_js', 'ee_settings', array( 'wp_debug' => WP_DEBUG ) );
373
+			} else if (wp_script_is('ee_error_js', 'registered')) {
374
+				add_filter('FHEE_load_css', '__return_true');
375
+				add_filter('FHEE_load_js', '__return_true');
376
+				wp_enqueue_script('ee_error_js');
377
+				wp_localize_script('ee_error_js', 'ee_settings', array('wp_debug' => WP_DEBUG));
378 378
 			}
379 379
 		} else {
380 380
 			return '
381 381
 <script>
382 382
 /* <![CDATA[ */
383
-var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
383
+var ee_settings = {"wp_debug":"' . WP_DEBUG.'"};
384 384
 /* ]]> */
385 385
 </script>
386
-<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
387
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
388
-<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
386
+<script src="' . includes_url().'js/jquery/jquery.js" type="text/javascript"></script>
387
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
388
+<script src="' . EE_GLOBAL_ASSETS_URL.'scripts/EE_Error.js'.'?ver='.espresso_version().'" type="text/javascript"></script>
389 389
 ';
390 390
 		}
391 391
 		return '';
Please login to merge, or discard this patch.
core/exceptions/InsufficientPermissionsException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\exceptions;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 	 * @param  int $code
25 25
 	 * @param  \Exception $previous
26 26
 	 */
27
-	public function __construct( $action, $message = '', $code = 0, \Exception $previous = null ) {
28
-		if ( empty( $message ) ) {
27
+	public function __construct($action, $message = '', $code = 0, \Exception $previous = null) {
28
+		if (empty($message)) {
29 29
 			$message = sprintf(
30 30
 				__(
31 31
 					'We\'re sorry, but you do not have the required permissions to perform the following action: ',
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 				$action
35 35
 			);
36 36
 		}
37
-		parent::__construct( $message, $code, $previous );
37
+		parent::__construct($message, $code, $previous);
38 38
 	}
39 39
 
40 40
 
Please login to merge, or discard this patch.
core/libraries/form_sections/form_handlers/InvalidFormHandlerException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\libraries\form_sections\form_handlers;
3 3
 
4
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 * @param int        $code
27 27
 	 * @param \Exception $previous
28 28
 	 */
29
-	public function __construct( $actual, $message = '', $code = 0, \Exception $previous = null ) {
30
-		if ( empty( $message ) ) {
29
+	public function __construct($actual, $message = '', $code = 0, \Exception $previous = null) {
30
+		if (empty($message)) {
31 31
 			$message = sprintf(
32 32
 				__(
33 33
 					'A valid Form Handler was expected but instead "%1$s" was received.',
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				$actual
37 37
 			);
38 38
 		}
39
-		parent::__construct( $message, $code, $previous );
39
+		parent::__construct($message, $code, $previous);
40 40
 	}
41 41
 
42 42
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/form_handlers/FormHandlerInterface.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use EE_Form_Section_Proper;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	/**
37 37
 	 * @param \EE_Form_Section_Proper $form
38 38
 	 */
39
-	public function setForm( \EE_Form_Section_Proper $form );
39
+	public function setForm(\EE_Form_Section_Proper $form);
40 40
 
41 41
 
42 42
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	/**
54 54
 	 * @param boolean $displayable
55 55
 	 */
56
-	public function setDisplayable( $displayable = false );
56
+	public function setDisplayable($displayable = false);
57 57
 
58 58
 
59 59
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	/**
95 95
 	 * @param string $submit_btn_text
96 96
 	 */
97
-	public function setSubmitBtnText( $submit_btn_text );
97
+	public function setSubmitBtnText($submit_btn_text);
98 98
 
99 99
 
100 100
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 	/**
109 109
 	 * @param string $form_action
110 110
 	 */
111
-	public function setFormAction( $form_action );
111
+	public function setFormAction($form_action);
112 112
 
113 113
 
114 114
 
115 115
 	/**
116 116
 	 * @param array $form_args
117 117
 	 */
118
-	public function addFormActionArgs( $form_args = array() );
118
+	public function addFormActionArgs($form_args = array());
119 119
 
120 120
 
121 121
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 *
136 136
 	 * @param string $form_config
137 137
 	 */
138
-	public function setFormConfig( $form_config );
138
+	public function setFormConfig($form_config);
139 139
 
140 140
 
141 141
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @param array $submitted_form_data
188 188
 	 * @return bool
189 189
 	 */
190
-	public function process( $submitted_form_data = array() );
190
+	public function process($submitted_form_data = array());
191 191
 
192 192
 
193 193
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @param string $text
198 198
 	 * @return \EE_Submit_Input
199 199
 	 */
200
-	public function generateSubmitButton( $text = '' );
200
+	public function generateSubmitButton($text = '');
201 201
 
202 202
 
203 203
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * @param string $text
217 217
 	 * @return \EE_Submit_Input
218 218
 	 */
219
-	public function generateCancelButton( $text = '' );
219
+	public function generateCancelButton($text = '');
220 220
 
221 221
 
222 222
 
Please login to merge, or discard this patch.
core/libraries/form_sections/form_handlers/SequentialStepFormInterface.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 use EventEspresso\core\exceptions\InvalidDataTypeException;
5 5
 use InvalidArgumentException;
6 6
 
7
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
8
-	exit( 'No direct script access allowed' );
7
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
8
+	exit('No direct script access allowed');
9 9
 }
10 10
 
11 11
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param int $order
33 33
 	 * @throws InvalidArgumentException
34 34
 	 */
35
-	public function setOrder( $order );
35
+	public function setOrder($order);
36 36
 
37 37
 
38 38
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * @throws InvalidDataTypeException
49 49
 	 * @throws InvalidArgumentException
50 50
 	 */
51
-	public function setRedirectUrl( $redirect_url );
51
+	public function setRedirectUrl($redirect_url);
52 52
 
53 53
 
54 54
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * @throws InvalidDataTypeException
58 58
 	 * @throws InvalidArgumentException
59 59
 	 */
60
-	public function addRedirectArgs( $redirect_args = array() );
60
+	public function addRedirectArgs($redirect_args = array());
61 61
 
62 62
 
63 63
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	/**
72 72
 	 * @param string $redirect_to
73 73
 	 */
74
-	public function setRedirectTo( $redirect_to );
74
+	public function setRedirectTo($redirect_to);
75 75
 
76 76
 
77 77
 
Please login to merge, or discard this patch.
core/libraries/form_sections/form_handlers/FormHandler.php 2 patches
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,6 @@
 block discarded – undo
12 12
   KEY `group_id` (`group_id`),
13 13
   KEY `question_id` (`question_id`)
14 14
 ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8$$
15
-
16
-
17 15
  * 4.1 question group question model's tables and fields:
18 16
  $this->_tables = array(
19 17
 			'Question_Group_Question'=>new EE_Primary_Table('esp_question_group_question','QGQ_ID')
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 use EventEspresso\core\exceptions\InvalidDataTypeException;
11 11
 use EventEspresso\core\exceptions\InvalidFormSubmissionException;
12 12
 
13
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
14
-	exit( 'No direct script access allowed' );
13
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
14
+	exit('No direct script access allowed');
15 15
 }
16 16
 
17 17
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  * @author        Brent Christensen
29 29
  * @since         4.9.0
30 30
  */
31
-abstract class FormHandler implements FormHandlerInterface{
31
+abstract class FormHandler implements FormHandlerInterface {
32 32
 
33 33
 	/**
34 34
 	 * will add opening and closing HTML form tags as well as a submit button
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
 		$form_config = FormHandler::ADD_FORM_TAGS_AND_SUBMIT,
140 140
 		\EE_Registry $registry
141 141
 	) {
142
-		$this->setFormName( $form_name );
143
-		$this->setAdminName( $admin_name );
144
-		$this->setSlug( $slug );
145
-		$this->setFormAction( $form_action );
146
-		$this->setFormConfig( $form_config );
147
-		$this->setSubmitBtnText( __( 'Submit', 'event_espresso' ) );
142
+		$this->setFormName($form_name);
143
+		$this->setAdminName($admin_name);
144
+		$this->setSlug($slug);
145
+		$this->setFormAction($form_action);
146
+		$this->setFormConfig($form_config);
147
+		$this->setSubmitBtnText(__('Submit', 'event_espresso'));
148 148
 		$this->registry = $registry;
149 149
 	}
150 150
 
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
 	 * @throws \EE_Error
171 171
 	 * @throws \LogicException
172 172
 	 */
173
-	public function form( $for_display = false ) {
174
-		if ( ! $this->formIsValid() ) {
173
+	public function form($for_display = false) {
174
+		if ( ! $this->formIsValid()) {
175 175
 			return null;
176 176
 		}
177
-		if ( $for_display ) {
177
+		if ($for_display) {
178 178
 			$form_config = $this->formConfig();
179 179
 			if (
180 180
 				$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 * @throws LogicException
195 195
 	 */
196 196
 	public function formIsValid() {
197
-		if ( ! $this->form instanceof \EE_Form_Section_Proper ) {
197
+		if ( ! $this->form instanceof \EE_Form_Section_Proper) {
198 198
 			static $generated = false;
199
-			if ( ! $generated ) {
199
+			if ( ! $generated) {
200 200
 				$generated = true;
201 201
 				$this->generate();
202 202
 			}
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
 	 * @throws LogicException
213 213
 	 */
214 214
 	public function verifyForm() {
215
-		if ( $this->form instanceof \EE_Form_Section_Proper ) {
215
+		if ($this->form instanceof \EE_Form_Section_Proper) {
216 216
 			return true;
217 217
 		}
218 218
 		throw new LogicException(
219 219
 			sprintf(
220
-				__( 'The "%1$s" form is invalid or missing', 'event_espresso' ),
220
+				__('The "%1$s" form is invalid or missing', 'event_espresso'),
221 221
 				$this->form_name
222 222
 			)
223 223
 		);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	/**
229 229
 	 * @param \EE_Form_Section_Proper $form
230 230
 	 */
231
-	public function setForm( \EE_Form_Section_Proper $form ) {
231
+	public function setForm(\EE_Form_Section_Proper $form) {
232 232
 		$this->form = $form;
233 233
 	}
234 234
 
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 	/**
247 247
 	 * @param boolean $displayable
248 248
 	 */
249
-	public function setDisplayable( $displayable = false ) {
250
-		$this->displayable = filter_var( $displayable, FILTER_VALIDATE_BOOLEAN );
249
+	public function setDisplayable($displayable = false) {
250
+		$this->displayable = filter_var($displayable, FILTER_VALIDATE_BOOLEAN);
251 251
 	}
252 252
 
253 253
 
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 	 * @param string $form_name
268 268
 	 * @throws InvalidDataTypeException
269 269
 	 */
270
-	public function setFormName( $form_name ) {
271
-		if ( ! is_string( $form_name ) ) {
272
-			throw new InvalidDataTypeException( '$form_name', $form_name, 'string' );
270
+	public function setFormName($form_name) {
271
+		if ( ! is_string($form_name)) {
272
+			throw new InvalidDataTypeException('$form_name', $form_name, 'string');
273 273
 		}
274 274
 		$this->form_name = $form_name;
275 275
 	}
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 	 * @param string $admin_name
292 292
 	 * @throws InvalidDataTypeException
293 293
 	 */
294
-	public function setAdminName( $admin_name ) {
295
-		if ( ! is_string( $admin_name ) ) {
296
-			throw new InvalidDataTypeException( '$admin_name', $admin_name, 'string' );
294
+	public function setAdminName($admin_name) {
295
+		if ( ! is_string($admin_name)) {
296
+			throw new InvalidDataTypeException('$admin_name', $admin_name, 'string');
297 297
 		}
298 298
 		$this->admin_name = $admin_name;
299 299
 	}
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
 	 * @param string $slug
316 316
 	 * @throws InvalidDataTypeException
317 317
 	 */
318
-	public function setSlug( $slug ) {
319
-		if ( ! is_string( $slug ) ) {
320
-			throw new InvalidDataTypeException( '$slug', $slug, 'string' );
318
+	public function setSlug($slug) {
319
+		if ( ! is_string($slug)) {
320
+			throw new InvalidDataTypeException('$slug', $slug, 'string');
321 321
 		}
322 322
 		$this->slug = $slug;
323 323
 	}
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 	/**
337 337
 	 * @param string $submit_btn_text
338 338
 	 */
339
-	public function setSubmitBtnText( $submit_btn_text ) {
340
-		if ( ! is_string( $submit_btn_text ) ) {
341
-			throw new InvalidDataTypeException( '$submit_btn_text', $submit_btn_text, 'string' );
339
+	public function setSubmitBtnText($submit_btn_text) {
340
+		if ( ! is_string($submit_btn_text)) {
341
+			throw new InvalidDataTypeException('$submit_btn_text', $submit_btn_text, 'string');
342 342
 		}
343
-		if ( empty( $submit_btn_text ) ) {
343
+		if (empty($submit_btn_text)) {
344 344
 			throw new InvalidArgumentException(
345
-				__( 'Can not set Submit button text because an empty string was provided.', 'event_espresso' )
345
+				__('Can not set Submit button text because an empty string was provided.', 'event_espresso')
346 346
 			);
347 347
 		}
348 348
 		$this->submit_btn_text = $submit_btn_text;
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 	 * @return string
355 355
 	 */
356 356
 	public function formAction() {
357
-		return ! empty( $this->form_args )
358
-			? add_query_arg( $this->form_args, $this->form_action )
357
+		return ! empty($this->form_args)
358
+			? add_query_arg($this->form_args, $this->form_action)
359 359
 			: $this->form_action;
360 360
 	}
361 361
 
@@ -365,9 +365,9 @@  discard block
 block discarded – undo
365 365
 	 * @param string $form_action
366 366
 	 * @throws InvalidDataTypeException
367 367
 	 */
368
-	public function setFormAction( $form_action ) {
369
-		if ( ! is_string( $form_action ) ) {
370
-			throw new InvalidDataTypeException( '$form_action', $form_action, 'string' );
368
+	public function setFormAction($form_action) {
369
+		if ( ! is_string($form_action)) {
370
+			throw new InvalidDataTypeException('$form_action', $form_action, 'string');
371 371
 		}
372 372
 		$this->form_action = $form_action;
373 373
 	}
@@ -379,20 +379,20 @@  discard block
 block discarded – undo
379 379
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
380 380
 	 * @throws \InvalidArgumentException
381 381
 	 */
382
-	public function addFormActionArgs( $form_args = array() ) {
383
-		if ( is_object( $form_args ) ) {
382
+	public function addFormActionArgs($form_args = array()) {
383
+		if (is_object($form_args)) {
384 384
 			throw new InvalidDataTypeException(
385 385
 				'$form_args',
386 386
 				$form_args,
387 387
 				'anything other than an object was expected.'
388 388
 			);
389 389
 		}
390
-		if ( empty( $form_args ) ) {
390
+		if (empty($form_args)) {
391 391
 			throw new InvalidArgumentException(
392
-				__( 'The redirect arguments can not be an empty array.', 'event_espresso' )
392
+				__('The redirect arguments can not be an empty array.', 'event_espresso')
393 393
 			);
394 394
 		}
395
-		$this->form_args = array_merge( $this->form_args, $form_args );
395
+		$this->form_args = array_merge($this->form_args, $form_args);
396 396
 	}
397 397
 
398 398
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 * @param string $form_config
411 411
 	 * @throws DomainException
412 412
 	 */
413
-	public function setFormConfig( $form_config ) {
413
+	public function setFormConfig($form_config) {
414 414
 		if (
415 415
 			! in_array(
416 416
 				$form_config,
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 		) {
425 425
 			throw new DomainException(
426 426
 				sprintf(
427
-					__( '"%1$s" is not a valid value for the form config. Please use one of the class constants on \EventEspresso\core\libraries\form_sections\form_handlers\Form', 'event_espresso' ),
427
+					__('"%1$s" is not a valid value for the form config. Please use one of the class constants on \EventEspresso\core\libraries\form_sections\form_handlers\Form', 'event_espresso'),
428 428
 					$form_config
429 429
 				)
430 430
 			);
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 	 * @return boolean
445 445
 	 */
446 446
 	public function initialize() {
447
-		$this->form_has_errors = \EE_Error::has_error( true );
447
+		$this->form_has_errors = \EE_Error::has_error(true);
448 448
 		return true;
449 449
 	}
450 450
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 	 * @throws \EE_Error
459 459
 	 */
460 460
 	public function enqueueStylesAndScripts() {
461
-		$this->form( false )->enqueue_js();
461
+		$this->form(false)->enqueue_js();
462 462
 
463 463
 	}
464 464
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 *
470 470
 	 * @return EE_Form_Section_Proper
471 471
 	 */
472
-	abstract public function generate() ;
472
+	abstract public function generate();
473 473
 
474 474
 
475 475
 
@@ -479,15 +479,15 @@  discard block
 block discarded – undo
479 479
 	 * @param string $text
480 480
 	 * @return \EE_Submit_Input
481 481
 	 */
482
-	public function generateSubmitButton( $text = '' ) {
483
-		$text = ! empty( $text ) ? $text : $this->submitBtnText();
482
+	public function generateSubmitButton($text = '') {
483
+		$text = ! empty($text) ? $text : $this->submitBtnText();
484 484
 		return new EE_Submit_Input(
485 485
 			array(
486
-				'html_name'             => 'ee-form-submit-' . $this->slug(),
487
-				'html_id'               => 'ee-form-submit-' . $this->slug(),
486
+				'html_name'             => 'ee-form-submit-'.$this->slug(),
487
+				'html_id'               => 'ee-form-submit-'.$this->slug(),
488 488
 				'html_class'            => 'ee-form-submit',
489 489
 				'html_label'            => '&nbsp;',
490
-				'other_html_attributes' => ' rel="' . $this->slug() . '"',
490
+				'other_html_attributes' => ' rel="'.$this->slug().'"',
491 491
 				'default'               => $text
492 492
 			)
493 493
 		);
@@ -503,12 +503,12 @@  discard block
 block discarded – undo
503 503
 	 * @throws \LogicException
504 504
 	 * @throws \EE_Error
505 505
 	 */
506
-	public function appendSubmitButton( $text = '' ) {
507
-		if ( $this->form->subsection_exists( $this->slug() . '-submit-btn' ) ) {
506
+	public function appendSubmitButton($text = '') {
507
+		if ($this->form->subsection_exists($this->slug().'-submit-btn')) {
508 508
 			return;
509 509
 		}
510 510
 		$this->form->add_subsections(
511
-			array( $this->slug() . '-submit-btn' => $this->generateSubmitButton( $text ) ),
511
+			array($this->slug().'-submit-btn' => $this->generateSubmitButton($text)),
512 512
 			null,
513 513
 			false
514 514
 		);
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
 	 * @param string $text
523 523
 	 * @return \EE_Submit_Input
524 524
 	 */
525
-	public function generateCancelButton( $text = '' ) {
525
+	public function generateCancelButton($text = '') {
526 526
 		$cancel_button = new EE_Submit_Input(
527 527
 			array(
528
-				'html_name'             => 'ee-form-submit-' . $this->slug(), // YES! Same name as submit !!!
529
-				'html_id'               => 'ee-cancel-form-' . $this->slug(),
528
+				'html_name'             => 'ee-form-submit-'.$this->slug(), // YES! Same name as submit !!!
529
+				'html_id'               => 'ee-cancel-form-'.$this->slug(),
530 530
 				'html_class'            => 'ee-cancel-form',
531 531
 				'html_label'            => '&nbsp;',
532
-				'other_html_attributes' => ' rel="' . $this->slug() . '"',
533
-				'default'               => ! empty( $text ) ? $text : __( 'Cancel', 'event_espresso' )
532
+				'other_html_attributes' => ' rel="'.$this->slug().'"',
533
+				'default'               => ! empty($text) ? $text : __('Cancel', 'event_espresso')
534 534
 			)
535 535
 		);
536
-		$cancel_button->set_button_css_attributes( false );
536
+		$cancel_button->set_button_css_attributes(false);
537 537
 		return $cancel_button;
538 538
 	}
539 539
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 		$this->form->add_subsections(
550 550
 			array(
551 551
 				'clear-submit-btn-float' => new \EE_Form_Section_HTML(
552
-					EEH_HTML::div( '', '', 'clear-float' ) . EEH_HTML::divx()
552
+					EEH_HTML::div('', '', 'clear-float').EEH_HTML::divx()
553 553
 				)
554 554
 			),
555 555
 			null,
@@ -574,9 +574,9 @@  discard block
 block discarded – undo
574 574
 			$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
575 575
 			|| $form_config === FormHandler::ADD_FORM_TAGS_ONLY
576 576
 		) {
577
-			$form_html .= $this->form()->form_open( $this->formAction() );
577
+			$form_html .= $this->form()->form_open($this->formAction());
578 578
 		}
579
-		$form_html .= $this->form( true )->get_html( $this->form_has_errors );
579
+		$form_html .= $this->form(true)->get_html($this->form_has_errors);
580 580
 		if (
581 581
 			$form_config === FormHandler::ADD_FORM_TAGS_AND_SUBMIT
582 582
 			|| $form_config === FormHandler::ADD_FORM_TAGS_ONLY
@@ -598,12 +598,12 @@  discard block
 block discarded – undo
598 598
 	 * @throws \LogicException
599 599
 	 * @throws InvalidFormSubmissionException
600 600
 	 */
601
-	public function process( $submitted_form_data = array() ) {
602
-		if ( ! $this->form()->was_submitted( $submitted_form_data ) ) {
603
-			throw new InvalidFormSubmissionException( $this->form_name );
601
+	public function process($submitted_form_data = array()) {
602
+		if ( ! $this->form()->was_submitted($submitted_form_data)) {
603
+			throw new InvalidFormSubmissionException($this->form_name);
604 604
 		}
605
-		$this->form( true )->receive_form_submission( $submitted_form_data );
606
-		if ( ! $this->form()->is_valid() ) {
605
+		$this->form(true)->receive_form_submission($submitted_form_data);
606
+		if ( ! $this->form()->is_valid()) {
607 607
 			throw new InvalidFormSubmissionException(
608 608
 				$this->form_name,
609 609
 				sprintf(
Please login to merge, or discard this patch.