@@ -6,20 +6,20 @@ |
||
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 |
@@ -8,15 +8,15 @@ |
||
8 | 8 | * |
9 | 9 | * This input has a default validation strategy of plaintext (which can be removed after construction) |
10 | 10 | */ |
11 | -class EE_Submit_Input extends EE_Form_Input_Base{ |
|
11 | +class EE_Submit_Input extends EE_Form_Input_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $options |
15 | 15 | */ |
16 | - public function __construct($options = array()){ |
|
16 | + public function __construct($options = array()) { |
|
17 | 17 | $this->_set_display_strategy(new EE_Submit_Input_Display_Strategy()); |
18 | 18 | $this->_set_normalization_strategy(new EE_Text_Normalization()); |
19 | - $this->_add_validation_strategy( new EE_Plaintext_Validation_Strategy() ); |
|
19 | + $this->_add_validation_strategy(new EE_Plaintext_Validation_Strategy()); |
|
20 | 20 | parent::__construct($options); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -9,18 +9,18 @@ |
||
9 | 9 | * @package Event Espresso |
10 | 10 | * @author Mike Nelson |
11 | 11 | */ |
12 | -class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base{ |
|
12 | +class EE_Submit_Input_Display_Strategy extends EE_Display_Strategy_Base { |
|
13 | 13 | /** |
14 | 14 | * |
15 | 15 | * @return string of html to display the input |
16 | 16 | */ |
17 | - public function display(){ |
|
17 | + public function display() { |
|
18 | 18 | $html = '<input type="submit" '; |
19 | - $html .= 'name="' . $this->_input->html_name() . '" '; |
|
20 | - $html .= 'value="' . $this->_input->raw_value_in_form() . '" '; |
|
21 | - $html .= 'id="' . $this->_input->html_id() . '-submit" '; |
|
22 | - $html .= 'class="' . $this->_input->html_class() . ' ' . $this->_input->button_css_attributes() . '" '; |
|
23 | - $html .= 'style="' . $this->_input->html_style() . '" '; |
|
19 | + $html .= 'name="'.$this->_input->html_name().'" '; |
|
20 | + $html .= 'value="'.$this->_input->raw_value_in_form().'" '; |
|
21 | + $html .= 'id="'.$this->_input->html_id().'-submit" '; |
|
22 | + $html .= 'class="'.$this->_input->html_class().' '.$this->_input->button_css_attributes().'" '; |
|
23 | + $html .= 'style="'.$this->_input->html_style().'" '; |
|
24 | 24 | $html .= $this->_input->other_html_attributes(); |
25 | 25 | $html .= '/>'; |
26 | 26 | return $html; |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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'), |
@@ -22,7 +22,7 @@ |
||
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 | /** |
@@ -10,8 +10,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -3,8 +3,8 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
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 | |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | * @param int $code |
26 | 26 | * @param \Exception $previous |
27 | 27 | */ |
28 | - public function __construct( $command_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
29 | - if ( empty( $message ) ) { |
|
28 | + public function __construct($command_name, $message = '', $code = 0, \Exception $previous = null) { |
|
29 | + if (empty($message)) { |
|
30 | 30 | $message = sprintf( |
31 | - __( 'The supplied Command Handler "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', 'event_espresso' ), |
|
31 | + __('The supplied Command Handler "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', 'event_espresso'), |
|
32 | 32 | $command_name |
33 | 33 | ); |
34 | 34 | } |
35 | - parent::__construct( $message, $code, $previous ); |
|
35 | + parent::__construct($message, $code, $previous); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
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 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param \EventEspresso\core\services\commands\CommandInterface $command |
20 | 20 | * @return mixed |
21 | 21 | */ |
22 | - public function handle( CommandInterface $command ); |
|
22 | + public function handle(CommandInterface $command); |
|
23 | 23 | |
24 | 24 | } |
25 | 25 | // End of file CommandHandlerInterface.php |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
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 | |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | * @param int $code |
26 | 26 | * @param \Exception $previous |
27 | 27 | */ |
28 | - public function __construct( $command_handler_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
29 | - if ( empty( $message ) ) { |
|
28 | + public function __construct($command_handler_name, $message = '', $code = 0, \Exception $previous = null) { |
|
29 | + if (empty($message)) { |
|
30 | 30 | $message = sprintf( |
31 | - __( 'The requested Command Handler "%1$s" could not be located or does not exist.', 'event_espresso' ), |
|
31 | + __('The requested Command Handler "%1$s" could not be located or does not exist.', 'event_espresso'), |
|
32 | 32 | $command_handler_name |
33 | 33 | ); |
34 | 34 | } |
35 | - parent::__construct( $message, $code, $previous ); |
|
35 | + parent::__construct($message, $code, $previous); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |