Completed
Branch Gutenberg/espresso-cpt-editor (d57906)
by
unknown
47:00 queued 29:56
created
strategies/display/EE_Compound_Input_Display_Strategy.strategy.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * @param bool   $add_pound_sign
28 28
 	 * @return string
29 29
 	 */
30
-	public function get_sub_input_id( $option_value, $add_pound_sign = false ) {
31
-		return $this->_append_chars( $this->_input->html_id( $add_pound_sign ), '-' ) . sanitize_key( $option_value );
30
+	public function get_sub_input_id($option_value, $add_pound_sign = false) {
31
+		return $this->_append_chars($this->_input->html_id($add_pound_sign), '-').sanitize_key($option_value);
32 32
 	}
33 33
 
34 34
 
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	 * @return array
41 41
 	 * @throws \EE_Error
42 42
 	 */
43
-	public function get_html_input_ids( $add_pound_sign = false ) {
43
+	public function get_html_input_ids($add_pound_sign = false) {
44 44
 		$html_input_ids = array();
45
-		foreach( $this->get_input()->options() as $value => $display ) {
46
-			$html_input_ids[] = $this->get_sub_input_id( $value, $add_pound_sign );
45
+		foreach ($this->get_input()->options() as $value => $display) {
46
+			$html_input_ids[] = $this->get_sub_input_id($value, $add_pound_sign);
47 47
 		}
48 48
 		return $html_input_ids;
49 49
 	}
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @throws \EE_Error
59 59
 	 */
60 60
 	public function get_input() {
61
-		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base ){
61
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
62 62
 			throw new EE_Error(
63 63
 				sprintf(
64 64
 					__(
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_To_Generate_From_Queue.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 	 * @param EE_Messages_Queue $queue
26 26
 	 * @param string            $custom_subject  Used if a custom subject is desired for the generated aggregate EE_Message object
27 27
 	 */
28
-	public function __construct( $messenger_name, $message_type_name, EE_Messages_Queue $queue, $custom_subject = '' ) {
28
+	public function __construct($messenger_name, $message_type_name, EE_Messages_Queue $queue, $custom_subject = '') {
29 29
 		$this->queue = $queue;
30
-		parent::__construct( $messenger_name, $message_type_name, array(), '', false, EEM_Message::status_idle );
31
-		if ( $this->valid() ) {
32
-			$this->_message->set_content( $this->_get_content() );
33
-			$this->_message->set_subject( $this->_get_subject( $custom_subject ) );
30
+		parent::__construct($messenger_name, $message_type_name, array(), '', false, EEM_Message::status_idle);
31
+		if ($this->valid()) {
32
+			$this->_message->set_content($this->_get_content());
33
+			$this->_message->set_subject($this->_get_subject($custom_subject));
34 34
 		}
35 35
 	}
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	protected function _get_content() {
45 45
 		$content = '';
46 46
 		$this->queue->get_message_repository()->rewind();
47
-		while ( $this->queue->get_message_repository()->valid() ) {
47
+		while ($this->queue->get_message_repository()->valid()) {
48 48
 			$content .= $this->queue->get_message_repository()->current()->content();
49 49
 			$this->queue->get_message_repository()->next();
50 50
 		}
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return string
60 60
 	 */
61
-	protected function _get_subject( $custom_subject = '' ) {
62
-		if ( ! empty( $custom_subject ) ) {
61
+	protected function _get_subject($custom_subject = '') {
62
+		if ( ! empty($custom_subject)) {
63 63
 			return $custom_subject;
64 64
 		}
65 65
 		$this->queue->get_message_repository()->rewind();
66 66
 		$count_of_items = $this->queue->get_message_repository()->count();
67 67
 
68 68
 		//if $count of items in queue == 1, then let's just return the subject for that item.
69
-		if ( $count_of_items === 1 ) {
69
+		if ($count_of_items === 1) {
70 70
 			return $this->queue->get_message_repository()->current()->subject();
71 71
 		}
72 72
 
Please login to merge, or discard this patch.
display_strategies/number_bubbles/number_bubbles.template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  * This is the template for the "Number Bubbles" Progress Steps
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 <!-- progress step display -->
15 15
 <div class="ee-progress-step-main-container">
16 16
 	<div class="progress-step-container number-bubbles-container">
17
-		<?php foreach ( $progress_steps as $progress_step ) : ?>
18
-		<div data-step-nmbr="<?php echo $progress_step->order();?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
17
+		<?php foreach ($progress_steps as $progress_step) : ?>
18
+		<div data-step-nmbr="<?php echo $progress_step->order(); ?>" id="progress-step-<?php echo $progress_step->id(); ?>" class="progress-step-number <?php echo $progress_step->htmlClass(); ?>">
19 19
 			<div class="progress-step-line"></div>
20 20
 			<div class="progress-step-bubble"><p><?php echo $progress_step->order(); ?></p></div>
21 21
 			<span class="progress-step-text"><?php echo $progress_step->text(); ?></span>
22 22
 		</div>
23
-		<?php endforeach;?>
23
+		<?php endforeach; ?>
24 24
 	</div>
25 25
 </div>
26 26
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Hidden_Input.input.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Hidden_Input extends EE_Form_Input_Base{
9
+class EE_Hidden_Input extends EE_Form_Input_Base {
10 10
 
11 11
 	/**
12 12
 	 * @param array $input_settings
13 13
 	 */
14
-	public function __construct($input_settings = array()){
14
+	public function __construct($input_settings = array()) {
15 15
 		//require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
16 16
 		$this->_set_display_strategy(new EE_Hidden_Display_Strategy());
17
-		if ( isset( $input_settings['normalization_strategy'] ) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base ) {
18
-			$this->_set_normalization_strategy( $input_settings['normalization_strategy'] );
17
+		if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
18
+			$this->_set_normalization_strategy($input_settings['normalization_strategy']);
19 19
 		} else {
20
-			$this->_set_normalization_strategy( new EE_Text_Normalization() );
20
+			$this->_set_normalization_strategy(new EE_Text_Normalization());
21 21
 		}
22
-		parent::__construct( $input_settings );
22
+		parent::__construct($input_settings);
23 23
 	}
24 24
 
25 25
 
Please login to merge, or discard this patch.
caffeinated/payment_methods/Aim/EE_PMT_Aim.pm.php 2 patches
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION')){
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5 5
 }
6 6
 /**
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @subpackage
12 12
  * @author				Mike Nelson
13 13
  */
14
-class EE_PMT_Aim extends EE_PMT_Base{
14
+class EE_PMT_Aim extends EE_PMT_Base {
15 15
 
16 16
 
17 17
 	/**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		require_once($this->file_folder().'EEG_Aim.gateway.php');
35 35
 		$this->_gateway = new EEG_Aim();
36 36
 		$this->_pretty_name = __("Authorize.net AIM", 'event_espresso');
37
-		$this->_default_description = __( 'Please provide the following billing information.', 'event_espresso' );
37
+		$this->_default_description = __('Please provide the following billing information.', 'event_espresso');
38 38
 		$this->_requires_https = true;
39 39
 	}
40 40
 
@@ -47,61 +47,61 @@  discard block
 block discarded – undo
47 47
 	 * @return EE_Billing_Info_Form
48 48
 	 * @throws \EE_Error
49 49
 	 */
50
-	public function generate_new_billing_form( EE_Transaction $transaction = NULL ) {
51
-		$billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance,array(
50
+	public function generate_new_billing_form(EE_Transaction $transaction = NULL) {
51
+		$billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array(
52 52
 			'name'=>'AIM_Form',
53 53
 			'subsections'=>array(
54 54
 				'credit_card'=>new EE_Credit_Card_Input(array(
55 55
 					'required'=>true,
56
-					'html_label_text' => __( 'Card Number', 'event_espresso' )
56
+					'html_label_text' => __('Card Number', 'event_espresso')
57 57
 				)),
58 58
 				'exp_month'=>new EE_Credit_Card_Month_Input(true, array(
59 59
 					'required'=>true,
60
-					'html_label_text' => __( 'Expiry Month', 'event_espresso' )
60
+					'html_label_text' => __('Expiry Month', 'event_espresso')
61 61
 				)),
62
-				'exp_year'=>new EE_Credit_Card_Year_Input( array( 
62
+				'exp_year'=>new EE_Credit_Card_Year_Input(array( 
63 63
 					'required'=>true,
64
-					'html_label_text' => __( 'Expiry Year', 'event_espresso' ) 
64
+					'html_label_text' => __('Expiry Year', 'event_espresso') 
65 65
 				)),
66
-				'cvv'=>new EE_CVV_Input( array(
66
+				'cvv'=>new EE_CVV_Input(array(
67 67
 					'required'=>true,
68
-					'html_label_text' => __( 'CVV', 'event_espresso' ) ) ),
68
+					'html_label_text' => __('CVV', 'event_espresso') )),
69 69
 			)
70 70
 		));
71
-		$billing_form->add_subsections( array(
72
-			'company' => new EE_Text_Input( array(
71
+		$billing_form->add_subsections(array(
72
+			'company' => new EE_Text_Input(array(
73 73
 				'html_label_text' => __('Company', 'event_espresso')
74 74
 			))
75
-		), 'email', false );
75
+		), 'email', false);
76 76
 		$billing_form->add_subsections( 
77 77
 				array(
78
-					'fax' => new EE_Text_Input( array(
78
+					'fax' => new EE_Text_Input(array(
79 79
 						'html_label_text' => __('Fax', 'event_espresso')
80 80
 					))
81 81
 				), 
82 82
 				'phone', 
83 83
 				false );
84 84
 		$settings_form = $this->settings_form();
85
-		if( $settings_form->get_input( 'excluded_billing_inputs' ) instanceof EE_Checkbox_Multi_Input ) {
86
-				$billing_form->exclude( $settings_form->get_input( 'excluded_billing_inputs' )->normalized_value() );
85
+		if ($settings_form->get_input('excluded_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
86
+				$billing_form->exclude($settings_form->get_input('excluded_billing_inputs')->normalized_value());
87 87
 		}
88
-		if( $settings_form->get_input( 'required_billing_inputs' ) instanceof EE_Checkbox_Multi_Input ) {
89
-			$required_inputs = $settings_form->get_input( 'required_billing_inputs' )->normalized_value();
88
+		if ($settings_form->get_input('required_billing_inputs') instanceof EE_Checkbox_Multi_Input) {
89
+			$required_inputs = $settings_form->get_input('required_billing_inputs')->normalized_value();
90 90
 			//only change the requirement of inputs which are allowed to be changed
91 91
 			/** @var EE_Form_Input_Base[] $inputs_to_evaluate */
92 92
 			$inputs_to_evaluate = array_intersect_key( 
93 93
 				$billing_form->inputs(), 
94 94
 				$this->billing_input_names()
95 95
 			);
96
-			foreach( $inputs_to_evaluate as $input_name => $input ) {
97
-				if( in_array( $input_name, $required_inputs ) ) {
98
-					$input->set_required( true );
96
+			foreach ($inputs_to_evaluate as $input_name => $input) {
97
+				if (in_array($input_name, $required_inputs)) {
98
+					$input->set_required(true);
99 99
 				} else {
100
-					$input->set_required( false );
100
+					$input->set_required(false);
101 101
 				}
102 102
 			}
103 103
 		}
104
-		return $this->apply_billing_form_debug_settings( $billing_form );
104
+		return $this->apply_billing_form_debug_settings($billing_form);
105 105
 	}
106 106
 
107 107
 
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 	 * @return \EE_Billing_Info_Form
115 115
 	 * @throws \EE_Error
116 116
 	 */
117
-	public function apply_billing_form_debug_settings( EE_Billing_Info_Form $billing_form ) {
117
+	public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) {
118 118
 		if (
119 119
 			$this->_pm_instance->debug_mode() 
120
-			|| $this->_pm_instance->get_extra_meta( 'test_transactions', TRUE, FALSE )
120
+			|| $this->_pm_instance->get_extra_meta('test_transactions', TRUE, FALSE)
121 121
 		) {
122
-			$billing_form->get_input( 'credit_card' )->set_default( '4007000000027' );
123
-			$billing_form->get_input( 'exp_year' )->set_default( '2020' );
124
-			if( $billing_form->get_subsection( 'cvv' ) instanceof EE_Form_Input_Base ) {
125
-				$billing_form->get_input( 'cvv' )->set_default( '123' );
122
+			$billing_form->get_input('credit_card')->set_default('4007000000027');
123
+			$billing_form->get_input('exp_year')->set_default('2020');
124
+			if ($billing_form->get_subsection('cvv') instanceof EE_Form_Input_Base) {
125
+				$billing_form->get_input('cvv')->set_default('123');
126 126
 			}
127 127
 			$billing_form->add_subsections(
128
-				array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
128
+				array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()),
129 129
 				'credit_card'
130 130
 			);
131 131
 			$billing_form->add_subsections(
@@ -153,17 +153,17 @@  discard block
 block discarded – undo
153 153
 				'extra_meta_inputs'=>array(
154 154
 					'login_id'=>new EE_Text_Input(
155 155
 						array(
156
-							'html_label_text'=>  sprintf( __("Authorize.net API Login ID %s", "event_espresso"),  $this->get_help_tab_link() ),
156
+							'html_label_text'=>  sprintf(__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()),
157 157
 							'required' => true )
158 158
 					),
159 159
 					'transaction_key'=>new EE_Text_Input(
160 160
 						array(
161
-							'html_label_text'=> sprintf( __("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link() ),
161
+							'html_label_text'=> sprintf(__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()),
162 162
 							'required' => true )
163 163
 					),
164 164
 					'test_transactions'=>new EE_Yes_No_Input(
165 165
 						array(
166
-							'html_label_text'=>  sprintf( __("Send test transactions? %s", 'event_espresso'),  $this->get_help_tab_link() ),
166
+							'html_label_text'=>  sprintf(__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()),
167 167
 							'html_help_text'=>  __("Send test transactions, even to live server", 'event_espresso'),
168 168
 							'default' => false,
169 169
 							'required' => true
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 					'excluded_billing_inputs' => new EE_Checkbox_Multi_Input( 
173 173
 							$billing_input_names,
174 174
 					array( 
175
-						'html_label_text' => sprintf( __("Excluded Payment Form Fields %s", 'event_espresso'),  $this->get_help_tab_link() ),
175
+						'html_label_text' => sprintf(__("Excluded Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
176 176
 						'default' => array(
177 177
 							'company',
178 178
 							'fax',
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 					'required_billing_inputs' => new EE_Checkbox_Multi_Input( 
182 182
 						$billing_input_names,
183 183
 						array(
184
-							'html_label_text' => sprintf( __("Required Payment Form Fields %s", 'event_espresso'),  $this->get_help_tab_link() ),
184
+							'html_label_text' => sprintf(__("Required Payment Form Fields %s", 'event_espresso'), $this->get_help_tab_link()),
185 185
 							'default' => array_diff(
186
-										array_keys( $billing_input_names ),
187
-										array( 'address2', 'phone', 'company', 'fax' )
186
+										array_keys($billing_input_names),
187
+										array('address2', 'phone', 'company', 'fax')
188 188
 							),
189 189
 							'html_help_text' => __('Note: if fields are excluded they cannot be required.', 'event_espresso')
190 190
 						)
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
 						apply_filters(
194 194
 							'FHEE__EE_PMT_Aim__generate_new_settings_form__server_select_input__options',
195 195
 							array(
196
-								'akamai' => __( 'Authorize.net/Akamai (default)', 'event_espresso' ),
197
-								'authorize.net' => __( 'Authorize.net (deprecated)', 'event_espresso' ),
196
+								'akamai' => __('Authorize.net/Akamai (default)', 'event_espresso'),
197
+								'authorize.net' => __('Authorize.net (deprecated)', 'event_espresso'),
198 198
 							),
199 199
 							$this
200 200
 						),
201 201
 						array(
202
-							'html_label_text' => __( 'Server', 'event_espresso' ),
203
-							'html_help_text' => __( 'The Gateway Server where payment requests will be sent', 'event_espresso' )
202
+							'html_label_text' => __('Server', 'event_espresso'),
203
+							'html_help_text' => __('The Gateway Server where payment requests will be sent', 'event_espresso')
204 204
 						)
205 205
 					)
206 206
 						
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	public function billing_input_names() {
218 218
 		return array(
219
-			'first_name' => __( 'First Name', 'event_espresso' ),
219
+			'first_name' => __('First Name', 'event_espresso'),
220 220
 			'last_name' => __('Last Name', 'event_espresso'),
221
-			'email' => __( 'Email', 'event_espresso' ),
222
-			'company' => __( 'Company', 'event_espresso' ),
221
+			'email' => __('Email', 'event_espresso'),
222
+			'company' => __('Company', 'event_espresso'),
223 223
 			'address' => __('Address', 'event_espresso'),
224 224
 			'address2' => __('Address2', 'event_espresso'),
225 225
 			'city' => __('City', 'event_espresso'),
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			'country' => __('Country', 'event_espresso'),
228 228
 			'zip' =>  __('Zip', 'event_espresso'),
229 229
 			'phone' => __('Phone', 'event_espresso'),
230
-			'fax' => __( 'Fax', 'event_espresso' ),
230
+			'fax' => __('Fax', 'event_espresso'),
231 231
 			'cvv' => __('CVV', 'event_espresso')
232 232
 		);
233 233
 	}
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 	 * @param EE_Billing_Info_Form $billing_form
240 240
 	 * @return array
241 241
 	 */
242
-	protected function _get_billing_values_from_form( $billing_form ){
242
+	protected function _get_billing_values_from_form($billing_form) {
243 243
 		$all_billing_values_empty = array();
244
-		foreach( array_keys( $this->billing_input_names() ) as $input_name ) {
245
-			$all_billing_values_empty[ $input_name ] = '';
244
+		foreach (array_keys($this->billing_input_names()) as $input_name) {
245
+			$all_billing_values_empty[$input_name] = '';
246 246
 		}
247 247
 		return array_merge(
248 248
 				$all_billing_values_empty,
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 * @see EE_PMT_Base::help_tabs_config()
258 258
 	 * @return array
259 259
 	 */
260
-	public function help_tabs_config(){
260
+	public function help_tabs_config() {
261 261
 		return array(
262 262
 			$this->get_help_tab_name() => array(
263 263
 				'title' => __('Authorize.net AIM Settings', 'event_espresso'),
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 	public function __construct($pm_instance = NULL) {
23 23
 		$this->_setup_properties();
24 24
 		parent::__construct($pm_instance);
25
-        $this->_gateway->set_unsupported_character_remover(new \EventEspresso\core\services\formatters\Windows1252());
25
+		$this->_gateway->set_unsupported_character_remover(new \EventEspresso\core\services\formatters\Windows1252());
26 26
 	}
27 27
 	
28 28
 	/**
Please login to merge, or discard this patch.
core/services/progress_steps/ProgressStepManager.php 2 patches
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 use EventEspresso\core\services\collections\CollectionInterface;
11 11
 use EventEspresso\core\services\progress_steps\display_strategies\ProgressStepsDisplayInterface;
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
 
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
 		CollectionInterface $collection = null,
79 79
 		EE_Request $request = null
80 80
 	) {
81
-		$this->setDisplayStrategy( $display_strategy_name );
82
-		$this->setDefaultStep( $default_step );
83
-		$this->setFormStepUrlKey( $form_step_url_key );
84
-		if ( ! $collection instanceof CollectionInterface ) {
85
-			$collection = new Collection( '\EventEspresso\core\services\progress_steps\ProgressStepInterface' );
81
+		$this->setDisplayStrategy($display_strategy_name);
82
+		$this->setDefaultStep($default_step);
83
+		$this->setFormStepUrlKey($form_step_url_key);
84
+		if ( ! $collection instanceof CollectionInterface) {
85
+			$collection = new Collection('\EventEspresso\core\services\progress_steps\ProgressStepInterface');
86 86
 		}
87 87
 		$this->collection = $collection;
88
-		if ( ! $request instanceof EE_Request ) {
89
-			$request = \EE_Registry::instance()->load_core( 'Request' );
88
+		if ( ! $request instanceof EE_Request) {
89
+			$request = \EE_Registry::instance()->load_core('Request');
90 90
 		}
91 91
 		$this->request = $request;
92 92
 	}
@@ -98,28 +98,28 @@  discard block
 block discarded – undo
98 98
 	 * @throws InvalidDataTypeException
99 99
 	 * @throws InvalidClassException
100 100
 	 */
101
-	protected function setDisplayStrategy( $display_strategy_name = 'number_bubbles' ) {
102
-		if ( ! is_string( $display_strategy_name ) ) {
103
-			throw new InvalidDataTypeException( '$display_strategy_name', $display_strategy_name, 'string' );
101
+	protected function setDisplayStrategy($display_strategy_name = 'number_bubbles') {
102
+		if ( ! is_string($display_strategy_name)) {
103
+			throw new InvalidDataTypeException('$display_strategy_name', $display_strategy_name, 'string');
104 104
 		}
105 105
 		// build up FQCN from incoming display strategy folder name
106 106
 		$display_strategy_class = 'EventEspresso\core\services\progress_steps\display_strategies\\';
107
-		$display_strategy_class .= $display_strategy_name . '\\';
108
-		$display_strategy_class .= str_replace( ' ', '', ucwords( str_replace( '_', ' ', $display_strategy_name ) ) );
107
+		$display_strategy_class .= $display_strategy_name.'\\';
108
+		$display_strategy_class .= str_replace(' ', '', ucwords(str_replace('_', ' ', $display_strategy_name)));
109 109
 		$display_strategy_class .= 'ProgressStepsDisplay';
110 110
 		$display_strategy_class = apply_filters(
111 111
 			'FHEE__ProgressStepManager__setDisplayStrategy__display_strategy_class',
112 112
 			$display_strategy_class
113 113
 		);
114
-		if ( ! class_exists( $display_strategy_class ) ) {
115
-			throw new InvalidClassException( $display_strategy_class );
114
+		if ( ! class_exists($display_strategy_class)) {
115
+			throw new InvalidClassException($display_strategy_class);
116 116
 		}
117 117
 		$display_strategy = new $display_strategy_class();
118
-		if ( ! $display_strategy instanceof ProgressStepsDisplayInterface ) {
118
+		if ( ! $display_strategy instanceof ProgressStepsDisplayInterface) {
119 119
 			throw new InvalidClassException(
120 120
 				$display_strategy_class,
121 121
 				sprintf(
122
-					__( 'The "%1$s" Class needs to be an implementation of the "%1$s" Interface.', 'event_espresso' ),
122
+					__('The "%1$s" Class needs to be an implementation of the "%1$s" Interface.', 'event_espresso'),
123 123
 					$display_strategy_class,
124 124
 					'\EventEspresso\core\services\progress_steps\display_strategies\ProgressStepsDisplayInterface'
125 125
 				)
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 	 * @param string $default_step
135 135
 	 * @throws InvalidDataTypeException
136 136
 	 */
137
-	public function setDefaultStep( $default_step ) {
138
-		if ( ! is_string( $default_step ) ) {
139
-			throw new InvalidDataTypeException( '$default_step', $default_step, 'string' );
137
+	public function setDefaultStep($default_step) {
138
+		if ( ! is_string($default_step)) {
139
+			throw new InvalidDataTypeException('$default_step', $default_step, 'string');
140 140
 		}
141 141
 		$this->default_step = $default_step;
142 142
 	}
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
 	 * @param string $form_step_url_key
148 148
 	 * @throws InvalidDataTypeException
149 149
 	 */
150
-	public function setFormStepUrlKey( $form_step_url_key = 'ee-form-step' ) {
151
-		if ( ! is_string( $form_step_url_key ) ) {
152
-			throw new InvalidDataTypeException( '$form_step_key', $form_step_url_key, 'string' );
150
+	public function setFormStepUrlKey($form_step_url_key = 'ee-form-step') {
151
+		if ( ! is_string($form_step_url_key)) {
152
+			throw new InvalidDataTypeException('$form_step_key', $form_step_url_key, 'string');
153 153
 		}
154
-		$this->form_step_url_key = ! empty( $form_step_url_key ) ? $form_step_url_key : 'ee-form-step';
154
+		$this->form_step_url_key = ! empty($form_step_url_key) ? $form_step_url_key : 'ee-form-step';
155 155
 	}
156 156
 
157 157
 
@@ -160,26 +160,26 @@  discard block
 block discarded – undo
160 160
 	 * @param string $step
161 161
 	 * @throws InvalidIdentifierException
162 162
 	 */
163
-	public function setCurrentStep( $step = '' ) {
163
+	public function setCurrentStep($step = '') {
164 164
 		// use incoming value if it's set, otherwise use request param if it's set, otherwise use default
165
-		$step = ! empty( $step )
165
+		$step = ! empty($step)
166 166
 			? $step
167
-			: $this->request->get( $this->form_step_url_key, $this->default_step );
167
+			: $this->request->get($this->form_step_url_key, $this->default_step);
168 168
 		// grab the step previously known as current, in case we need to revert
169 169
 		$current_current_step = $this->collection->current();
170 170
 		// verify that requested step exists
171
-		if ( ! $this->collection->has( $step ) ) {
172
-			throw new InvalidIdentifierException( $step, $this->default_step );
171
+		if ( ! $this->collection->has($step)) {
172
+			throw new InvalidIdentifierException($step, $this->default_step);
173 173
 		}
174
-		if ( $this->collection->setCurrent( $step ) ) {
174
+		if ($this->collection->setCurrent($step)) {
175 175
 			// if the old boss is the same as the new boss, then nothing changes
176
-			if ( $this->collection->current() !== $current_current_step ) {
177
-				$current_current_step->setIsCurrent( false );
176
+			if ($this->collection->current() !== $current_current_step) {
177
+				$current_current_step->setIsCurrent(false);
178 178
 			}
179 179
 			$this->collection->current()->setIsCurrent();
180 180
 		} else {
181
-			$this->collection->setCurrent( $current_current_step->id() );
182
-			$current_current_step->setIsCurrent( true );
181
+			$this->collection->setCurrent($current_current_step->id());
182
+			$current_current_step->setIsCurrent(true);
183 183
 		}
184 184
 	}
185 185
 
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 	public function setPreviousStepsCompleted() {
192 192
 		$current_current_step = $this->collection->current();
193 193
 		$this->collection->rewind();
194
-		while ( $this->collection->valid() ) {
195
-			if ( $this->collection->current() === $current_current_step ) {
194
+		while ($this->collection->valid()) {
195
+			if ($this->collection->current() === $current_current_step) {
196 196
 				break;
197 197
 			}
198 198
 			$this->setCurrentStepCompleted();
199 199
 			$this->collection->next();
200 200
 		}
201
-		$this->collection->setCurrentUsingObject( $current_current_step );
201
+		$this->collection->setCurrentUsingObject($current_current_step);
202 202
 		return false;
203 203
 	}
204 204
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	public function displaySteps() {
240 240
 		return \EEH_Template::display_template(
241 241
 			$this->display_strategy->getTemplate(),
242
-			array( 'progress_steps' => $this->collection ),
242
+			array('progress_steps' => $this->collection),
243 243
 			true
244 244
 		);
245 245
 	}
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	 * @param bool $completed
251 251
 	 * @return \EventEspresso\core\services\progress_steps\ProgressStepInterface
252 252
 	 */
253
-	public function setCurrentStepCompleted( $completed = true ) {
254
-		return $this->collection->current()->setIsCompleted( $completed );
253
+	public function setCurrentStepCompleted($completed = true) {
254
+		return $this->collection->current()->setIsCompleted($completed);
255 255
 	}
256 256
 
257 257
 
Please login to merge, or discard this patch.
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 namespace EventEspresso\core\services\progress_steps;
3 3
 
4 4
 use EE_Request;
5
-use  EventEspresso\core\exceptions\InvalidClassException;
6
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
7
-use  EventEspresso\core\exceptions\InvalidIdentifierException;
8
-use  EventEspresso\core\exceptions\InvalidInterfaceException;
5
+use EventEspresso\core\exceptions\InvalidClassException;
6
+use EventEspresso\core\exceptions\InvalidDataTypeException;
7
+use EventEspresso\core\exceptions\InvalidIdentifierException;
8
+use EventEspresso\core\exceptions\InvalidInterfaceException;
9 9
 use EventEspresso\core\services\collections\Collection;
10 10
 use EventEspresso\core\services\collections\CollectionInterface;
11 11
 use EventEspresso\core\services\progress_steps\display_strategies\ProgressStepsDisplayInterface;
Please login to merge, or discard this patch.
display_strategies/number_bubbles/NumberBubblesProgressStepsDisplay.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use EventEspresso\core\services\progress_steps\display_strategies\ProgressStepsDisplayInterface;
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
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		// core/services/progress_steps/display_strategies/number_bubbles/number_bubbles.css
30 30
 		wp_enqueue_style(
31 31
 			'ee_progress_steps_display_number_bubbles',
32
-			plugin_dir_url( __FILE__ ) . 'number_bubbles.css'
32
+			plugin_dir_url(__FILE__).'number_bubbles.css'
33 33
 		);
34 34
 	}
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function getTemplate() {
44 44
 		// return plugin_dir_path( __FILE__ ) . 'number_bubbles.template.php';
45
-		return __DIR__ . DS .'number_bubbles.template.php';
45
+		return __DIR__.DS.'number_bubbles.template.php';
46 46
 	}
47 47
 
48 48
 }
Please login to merge, or discard this patch.
core/services/locators/FileLocator.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\locators;
3 3
 
4
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
4
+use EventEspresso\core\exceptions\InvalidDataTypeException;
5 5
 use FilesystemIterator;
6 6
 use GlobIterator;
7 7
 
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
 use FilesystemIterator;
6 6
 use GlobIterator;
7 7
 
8
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
9
-	exit( 'No direct script access allowed' );
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10 10
 }
11 11
 
12 12
 
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 	 * @param string $file_mask
39 39
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
40 40
 	 */
41
-	public function setFileMask( $file_mask ) {
42
-		if ( ! is_string( $file_mask ) ) {
43
-			throw new InvalidDataTypeException( '$file_mask', $file_mask, 'string' );
41
+	public function setFileMask($file_mask) {
42
+		if ( ! is_string($file_mask)) {
43
+			throw new InvalidDataTypeException('$file_mask', $file_mask, 'string');
44 44
 		}
45 45
 		$this->file_mask = $file_mask;
46 46
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return int
64 64
 	 */
65 65
 	public function count() {
66
-		return count( $this->filepaths );
66
+		return count($this->filepaths);
67 67
 	}
68 68
 
69 69
 
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 	 * @return \FilesystemIterator
78 78
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
79 79
 	 */
80
-	public function locate( $directory_paths ) {
81
-		if ( ! ( is_string( $directory_paths ) || is_array( $directory_paths ) ) ) {
82
-			throw new InvalidDataTypeException( '$directory_paths', $directory_paths, 'string or array' );
80
+	public function locate($directory_paths) {
81
+		if ( ! (is_string($directory_paths) || is_array($directory_paths))) {
82
+			throw new InvalidDataTypeException('$directory_paths', $directory_paths, 'string or array');
83 83
 		}
84
-		foreach ( (array) $directory_paths as $directory_path ) {
85
-			foreach ( $this->findFilesByPath( $directory_path ) as $key => $file ) {
86
-				$this->filepaths[ $key ] = \EEH_File::standardise_directory_separators( $file );
84
+		foreach ((array) $directory_paths as $directory_path) {
85
+			foreach ($this->findFilesByPath($directory_path) as $key => $file) {
86
+				$this->filepaths[$key] = \EEH_File::standardise_directory_separators($file);
87 87
 			}
88 88
 		}
89 89
 		return $this->filepaths;
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	 * @param string $directory_path
99 99
 	 * @return \FilesystemIterator
100 100
 	 */
101
-	protected function findFilesByPath( $directory_path = '' ) {
102
-		$iterator = new GlobIterator (
103
-			\EEH_File::end_with_directory_separator( $directory_path ) . $this->file_mask
101
+	protected function findFilesByPath($directory_path = '') {
102
+		$iterator = new GlobIterator(
103
+			\EEH_File::end_with_directory_separator($directory_path).$this->file_mask
104 104
 		);
105
-		foreach ( $this->flags as $flag ) {
106
-			$iterator->setFlags( $flag );
105
+		foreach ($this->flags as $flag) {
106
+			$iterator->setFlags($flag);
107 107
 		}
108 108
 		return $iterator;
109 109
 	}
Please login to merge, or discard this patch.
core/services/locators/FqcnLocator.php 3 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\services\locators;
3 3
 
4
-use  EventEspresso\core\exceptions\InvalidClassException;
5
-use  EventEspresso\core\exceptions\InvalidDataTypeException;
4
+use EventEspresso\core\exceptions\InvalidClassException;
5
+use EventEspresso\core\exceptions\InvalidDataTypeException;
6 6
 use EventEspresso\Core\Psr4Autoloader;
7 7
 use FilesystemIterator;
8 8
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 	 * given a valid namespace, will find all files that match the provided mask
78 78
 	 *
79 79
 	 * @access public
80
-	 * @param string|array $namespaces
80
+	 * @param string $namespaces
81 81
 	 * @return FilesystemIterator
82 82
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
83 83
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 use EventEspresso\Core\Psr4Autoloader;
7 7
 use FilesystemIterator;
8 8
 
9
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
10
-	exit( 'No direct script access allowed' );
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10
+	exit('No direct script access allowed');
11 11
 }
12 12
 
13 13
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 	 * @param string $namespace_base_dir
41 41
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
42 42
 	 */
43
-	protected function setNamespace( $namespace, $namespace_base_dir ) {
44
-		if ( ! is_string( $namespace ) ) {
45
-			throw new InvalidDataTypeException( '$namespace', $namespace, 'string' );
43
+	protected function setNamespace($namespace, $namespace_base_dir) {
44
+		if ( ! is_string($namespace)) {
45
+			throw new InvalidDataTypeException('$namespace', $namespace, 'string');
46 46
 		}
47
-		if ( ! is_string( $namespace_base_dir ) ) {
48
-			throw new InvalidDataTypeException( '$namespace_base_dir', $namespace_base_dir, 'string' );
47
+		if ( ! is_string($namespace_base_dir)) {
48
+			throw new InvalidDataTypeException('$namespace_base_dir', $namespace_base_dir, 'string');
49 49
 		}
50
-		$this->namespaces[ $namespace ] = $namespace_base_dir;
50
+		$this->namespaces[$namespace] = $namespace_base_dir;
51 51
 	}
52 52
 
53 53
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @return int
68 68
 	 */
69 69
 	public function count() {
70
-		return count( $this->FQCNs );
70
+		return count($this->FQCNs);
71 71
 	}
72 72
 
73 73
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
83 83
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
84 84
 	 */
85
-	public function locate( $namespaces ) {
86
-		if ( ! ( is_string( $namespaces ) || is_array( $namespaces ) ) ) {
87
-			throw new InvalidDataTypeException( '$namespaces', $namespaces, 'string or array' );
85
+	public function locate($namespaces) {
86
+		if ( ! (is_string($namespaces) || is_array($namespaces))) {
87
+			throw new InvalidDataTypeException('$namespaces', $namespaces, 'string or array');
88 88
 		}
89
-		foreach ( (array) $namespaces as $namespace ) {
90
-			foreach ( $this->FindFQCNsByNamespace( $namespace ) as $key => $file ) {
91
-				$this->FQCNs[ $key ] = $file;
89
+		foreach ((array) $namespaces as $namespace) {
90
+			foreach ($this->FindFQCNsByNamespace($namespace) as $key => $file) {
91
+				$this->FQCNs[$key] = $file;
92 92
 			}
93 93
 		}
94 94
 		return $this->FQCNs;
@@ -107,24 +107,24 @@  discard block
 block discarded – undo
107 107
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
108 108
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
109 109
 	 */
110
-	protected function FindFQCNsByNamespace( $partial_namespace ) {
110
+	protected function FindFQCNsByNamespace($partial_namespace) {
111 111
 		$iterator = new FilesystemIterator(
112
-			$this->getDirectoryFromPartialNamespace( $partial_namespace )
112
+			$this->getDirectoryFromPartialNamespace($partial_namespace)
113 113
 		);
114
-		foreach ( $this->flags as $flag ) {
115
-			$iterator->setFlags( $flag );
114
+		foreach ($this->flags as $flag) {
115
+			$iterator->setFlags($flag);
116 116
 		}
117
-		if ( iterator_count( $iterator ) === 0 ) {
117
+		if (iterator_count($iterator) === 0) {
118 118
 			return array();
119 119
 		}
120
-		foreach ( $iterator as $file ) {
121
-			$file = \EEH_File::standardise_directory_separators( $file );
122
-			foreach ( $this->namespaces as $namespace => $base_dir ) {
120
+		foreach ($iterator as $file) {
121
+			$file = \EEH_File::standardise_directory_separators($file);
122
+			foreach ($this->namespaces as $namespace => $base_dir) {
123 123
 				$namespace .= Psr4Autoloader::NS;
124
-				if ( strpos( $file, $base_dir ) === 0 ) {
125
-					$this->FQCNs[] = Psr4Autoloader::NS . str_replace(
126
-							array( $base_dir, DS, '.php' ),
127
-							array( $namespace, Psr4Autoloader::NS, '' ),
124
+				if (strpos($file, $base_dir) === 0) {
125
+					$this->FQCNs[] = Psr4Autoloader::NS.str_replace(
126
+							array($base_dir, DS, '.php'),
127
+							array($namespace, Psr4Autoloader::NS, ''),
128 128
 							$file
129 129
 						);
130 130
 				}
@@ -144,25 +144,25 @@  discard block
 block discarded – undo
144 144
 	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
145 145
 	 * @throws \EventEspresso\core\exceptions\InvalidClassException
146 146
 	 */
147
-	protected function getDirectoryFromPartialNamespace( $partial_namespace ) {
148
-		if ( empty( $partial_namespace ) ) {
149
-			throw new InvalidClassException( $partial_namespace );
147
+	protected function getDirectoryFromPartialNamespace($partial_namespace) {
148
+		if (empty($partial_namespace)) {
149
+			throw new InvalidClassException($partial_namespace);
150 150
 		}
151 151
 		// load our PSR-4 Autoloader so we can get the list of registered namespaces from it
152 152
 		$psr4_loader = \EE_Psr4AutoloaderInit::psr4_loader();
153 153
 		// breakup the incoming namespace into segments then loop thru them
154
-		$namespace_segments = explode( Psr4Autoloader::NS, trim( $partial_namespace, Psr4Autoloader::NS ) );
154
+		$namespace_segments = explode(Psr4Autoloader::NS, trim($partial_namespace, Psr4Autoloader::NS));
155 155
 		// we're only interested in the first element, so pull that from the array
156
-		$namespace = array_shift( $namespace_segments );
156
+		$namespace = array_shift($namespace_segments);
157 157
 		// check if there's a base directory registered for that namespace
158
-		$prefix = $psr4_loader->prefixes( $namespace . Psr4Autoloader::NS );
158
+		$prefix = $psr4_loader->prefixes($namespace.Psr4Autoloader::NS);
159 159
 		// nope? then the incoming namespace is invalid
160
-		if ( empty( $prefix ) || empty( $prefix[0] ) ) {
161
-			throw new InvalidClassException( $partial_namespace );
160
+		if (empty($prefix) || empty($prefix[0])) {
161
+			throw new InvalidClassException($partial_namespace);
162 162
 		}
163
-		$this->setNamespace( $namespace, $prefix[0] );
163
+		$this->setNamespace($namespace, $prefix[0]);
164 164
 		// but if it's good, add that base directory to the rest of the path, and return it
165
-		return $prefix[0] . implode( DS, $namespace_segments ) . DS;
165
+		return $prefix[0].implode(DS, $namespace_segments).DS;
166 166
 	}
167 167
 
168 168
 
Please login to merge, or discard this patch.