@@ -1,6 +1,6 @@ |
||
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 | * Class EE_Line_Item_Filter_Collection |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | use EventEspresso\core\services\collections\Collection; |
5 | 5 | |
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 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @throws \EventEspresso\Core\Exceptions\InvalidInterfaceException |
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | - parent::__construct( '\EventEspresso\core\services\progress_steps\ProgressStepInterface' ); |
|
30 | + parent::__construct('\EventEspresso\core\services\progress_steps\ProgressStepInterface'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\progress_steps; |
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,7 +22,7 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @param boolean $is_current |
24 | 24 | */ |
25 | - public function setIsCurrent( $is_current = true ); |
|
25 | + public function setIsCurrent($is_current = true); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @return int|string |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | use EventEspresso\core\services\locators\FqcnLocator; |
9 | 9 | use EventEspresso\core\services\locators\LocatorInterface; |
10 | 10 | |
11 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
12 | - exit( 'No direct script access allowed' ); |
|
11 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
12 | + exit('No direct script access allowed'); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | $identifier_callback = '', |
171 | 171 | LocatorInterface $file_locator = null |
172 | 172 | ) { |
173 | - $this->setCollectionName( $collection_name ); |
|
174 | - $this->setCollectionInterface( $collection_interface ); |
|
175 | - $this->setCollectionFQCNs( $collection_FQCNs ); |
|
176 | - $this->setCollectionPaths( $collection_paths ); |
|
177 | - $this->setFileMasks( $file_mask ); |
|
178 | - $this->setIdentifierType( $identifier_type ); |
|
179 | - $this->setIdentifierCallback( $identifier_callback ); |
|
173 | + $this->setCollectionName($collection_name); |
|
174 | + $this->setCollectionInterface($collection_interface); |
|
175 | + $this->setCollectionFQCNs($collection_FQCNs); |
|
176 | + $this->setCollectionPaths($collection_paths); |
|
177 | + $this->setFileMasks($file_mask); |
|
178 | + $this->setIdentifierType($identifier_type); |
|
179 | + $this->setIdentifierCallback($identifier_callback); |
|
180 | 180 | $this->file_locator = $file_locator; |
181 | 181 | } |
182 | 182 | |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | * @param string $collection_interface |
198 | 198 | * @throws \EventEspresso\Core\Exceptions\InvalidInterfaceException |
199 | 199 | */ |
200 | - protected function setCollectionInterface( $collection_interface ) { |
|
201 | - if ( ! ( interface_exists( $collection_interface ) || class_exists( $collection_interface ) ) ) { |
|
202 | - throw new InvalidInterfaceException( $collection_interface ); |
|
200 | + protected function setCollectionInterface($collection_interface) { |
|
201 | + if ( ! (interface_exists($collection_interface) || class_exists($collection_interface))) { |
|
202 | + throw new InvalidInterfaceException($collection_interface); |
|
203 | 203 | } |
204 | 204 | $this->collection_interface = $collection_interface; |
205 | 205 | } |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | * @param string $collection_name |
226 | 226 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
227 | 227 | */ |
228 | - protected function setCollectionName( $collection_name ) { |
|
229 | - if ( ! is_string( $collection_name ) ) { |
|
230 | - throw new InvalidDataTypeException( '$collection_name', $collection_name, 'string' ); |
|
228 | + protected function setCollectionName($collection_name) { |
|
229 | + if ( ! is_string($collection_name)) { |
|
230 | + throw new InvalidDataTypeException('$collection_name', $collection_name, 'string'); |
|
231 | 231 | } |
232 | 232 | $this->collection_name = str_replace( |
233 | 233 | '-', |
234 | 234 | '_', |
235 | - sanitize_title_with_dashes( $collection_name, '', 'save' ) |
|
235 | + sanitize_title_with_dashes($collection_name, '', 'save') |
|
236 | 236 | ); |
237 | 237 | } |
238 | 238 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @param string $identifier_type |
254 | 254 | * @throws \EventEspresso\Core\Exceptions\InvalidIdentifierException |
255 | 255 | */ |
256 | - protected function setIdentifierType( $identifier_type ) { |
|
256 | + protected function setIdentifierType($identifier_type) { |
|
257 | 257 | if ( |
258 | 258 | ! ( |
259 | 259 | $identifier_type === CollectionDetails::ID_CLASS_NAME |
@@ -286,9 +286,9 @@ discard block |
||
286 | 286 | * @param string $identifier_callback |
287 | 287 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
288 | 288 | */ |
289 | - protected function setIdentifierCallback( $identifier_callback = 'identifier' ) { |
|
290 | - if ( ! is_string( $identifier_callback ) ) { |
|
291 | - throw new InvalidDataTypeException( '$identifier_callback', $identifier_callback, 'string' ); |
|
289 | + protected function setIdentifierCallback($identifier_callback = 'identifier') { |
|
290 | + if ( ! is_string($identifier_callback)) { |
|
291 | + throw new InvalidDataTypeException('$identifier_callback', $identifier_callback, 'string'); |
|
292 | 292 | } |
293 | 293 | $this->identifier_callback = $identifier_callback; |
294 | 294 | } |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | * @param string $file_mask |
314 | 314 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
315 | 315 | */ |
316 | - protected function setFileMasks( $file_mask ) { |
|
317 | - $this->file_mask = ! empty( $file_mask ) ? $file_mask : '*.php'; |
|
316 | + protected function setFileMasks($file_mask) { |
|
317 | + $this->file_mask = ! empty($file_mask) ? $file_mask : '*.php'; |
|
318 | 318 | // we know our default is a string, so if it's not a string now, |
319 | 319 | // then that means the incoming parameter was something else |
320 | - if ( ! is_string( $this->file_mask ) ) { |
|
321 | - throw new InvalidDataTypeException( '$file_mask', $this->file_mask, 'string' ); |
|
320 | + if ( ! is_string($this->file_mask)) { |
|
321 | + throw new InvalidDataTypeException('$file_mask', $this->file_mask, 'string'); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
@@ -340,13 +340,13 @@ discard block |
||
340 | 340 | * @throws \EventEspresso\Core\Exceptions\InvalidClassException |
341 | 341 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
342 | 342 | */ |
343 | - public function setCollectionFQCNs( $collection_FQCNs ) { |
|
344 | - foreach ( (array) $collection_FQCNs as $collection_FQCN ) { |
|
345 | - if ( ! empty( $collection_FQCN ) ) { |
|
346 | - if ( class_exists( $collection_FQCN ) ) { |
|
343 | + public function setCollectionFQCNs($collection_FQCNs) { |
|
344 | + foreach ((array) $collection_FQCNs as $collection_FQCN) { |
|
345 | + if ( ! empty($collection_FQCN)) { |
|
346 | + if (class_exists($collection_FQCN)) { |
|
347 | 347 | $this->collection_FQCNs[] = $collection_FQCN; |
348 | 348 | } else { |
349 | - foreach ( $this->getFQCNsFromPartialNamespace( $collection_FQCN ) as $FQCN ) { |
|
349 | + foreach ($this->getFQCNsFromPartialNamespace($collection_FQCN) as $FQCN) { |
|
350 | 350 | $this->collection_FQCNs[] = $FQCN; |
351 | 351 | } |
352 | 352 | } |
@@ -363,11 +363,11 @@ discard block |
||
363 | 363 | * @throws \EventEspresso\Core\Exceptions\InvalidDataTypeException |
364 | 364 | * @throws \EventEspresso\Core\Exceptions\InvalidClassException |
365 | 365 | */ |
366 | - protected function getFQCNsFromPartialNamespace( $partial_FQCN ) { |
|
367 | - if ( ! $this->file_locator instanceof FqcnLocator ) { |
|
366 | + protected function getFQCNsFromPartialNamespace($partial_FQCN) { |
|
367 | + if ( ! $this->file_locator instanceof FqcnLocator) { |
|
368 | 368 | $this->file_locator = new FqcnLocator(); |
369 | 369 | } |
370 | - $this->file_locator->locate( $partial_FQCN ); |
|
370 | + $this->file_locator->locate($partial_FQCN); |
|
371 | 371 | return $this->file_locator->getFQCNs(); |
372 | 372 | } |
373 | 373 | |
@@ -388,11 +388,11 @@ discard block |
||
388 | 388 | * @param string|array $collection_paths |
389 | 389 | * @throws \EventEspresso\Core\Exceptions\InvalidFilePathException |
390 | 390 | */ |
391 | - public function setCollectionPaths( $collection_paths ) { |
|
392 | - foreach ( (array) $collection_paths as $collection_path ) { |
|
393 | - if ( ! empty( $collection_path ) ) { |
|
394 | - if ( ! is_readable( $collection_path ) ) { |
|
395 | - throw new InvalidFilePathException( $collection_path ); |
|
391 | + public function setCollectionPaths($collection_paths) { |
|
392 | + foreach ((array) $collection_paths as $collection_path) { |
|
393 | + if ( ! empty($collection_path)) { |
|
394 | + if ( ! is_readable($collection_path)) { |
|
395 | + throw new InvalidFilePathException($collection_path); |
|
396 | 396 | } |
397 | 397 | $this->collection_paths[] = $collection_path; |
398 | 398 | } |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use OutOfBoundsException; |
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 | |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | * @param int $code |
29 | 29 | * @param \Exception $previous |
30 | 30 | */ |
31 | - public function __construct( $form_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
32 | - if ( empty( $message ) ) { |
|
31 | + public function __construct($form_name, $message = '', $code = 0, \Exception $previous = null) { |
|
32 | + if (empty($message)) { |
|
33 | 33 | $message = sprintf( |
34 | 34 | __( |
35 | 35 | 'The data for the "%1$s" form, is either missing or was not submitted properly.', |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $form_name |
39 | 39 | ); |
40 | 40 | } |
41 | - parent::__construct( $message, $code, $previous ); |
|
41 | + parent::__construct($message, $code, $previous); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')){ |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | } |
5 | 5 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * ------------------------------------------------------------------------ |
36 | 36 | */ |
37 | -abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base{ |
|
37 | +abstract class EE_Form_Section_Validatable extends EE_Form_Section_Base { |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Array of validation errors in this section. Does not contain validation errors in subsections, however. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * called get_validation_errors_accumulated |
50 | 50 | * @return EE_Validation_Error[] |
51 | 51 | */ |
52 | - public function get_validation_errors(){ |
|
52 | + public function get_validation_errors() { |
|
53 | 53 | return $this->_validation_errors; |
54 | 54 | } |
55 | 55 | /** |
@@ -57,16 +57,16 @@ discard block |
||
57 | 57 | * If we want this to be customizable, we may decide to create a strategy for displaying it. |
58 | 58 | * @return string |
59 | 59 | */ |
60 | - public function get_validation_error_string(){ |
|
60 | + public function get_validation_error_string() { |
|
61 | 61 | $validation_error_messages = array(); |
62 | - if($this->get_validation_errors()){ |
|
63 | - foreach($this->get_validation_errors() as $validation_error){ |
|
64 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
65 | - $validation_error_messages[] =$validation_error->getMessage(); |
|
62 | + if ($this->get_validation_errors()) { |
|
63 | + foreach ($this->get_validation_errors() as $validation_error) { |
|
64 | + if ($validation_error instanceof EE_Validation_Error) { |
|
65 | + $validation_error_messages[] = $validation_error->getMessage(); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | - return implode(", ",$validation_error_messages); |
|
69 | + return implode(", ", $validation_error_messages); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | * @return boolean |
83 | 83 | */ |
84 | 84 | public function is_valid() { |
85 | - if(count($this->_validation_errors)){ |
|
85 | + if (count($this->_validation_errors)) { |
|
86 | 86 | return false; |
87 | - }else{ |
|
87 | + } else { |
|
88 | 88 | return true; |
89 | 89 | } |
90 | 90 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @param Exception $previous_exception if there was an exception that caused the error, that exception |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - public function add_validation_error( $message_or_object, $error_code = NULL, $previous_exception = NULL ){ |
|
113 | - if($message_or_object instanceof EE_Validation_Error){ |
|
114 | - $validation_error= $message_or_object; |
|
112 | + public function add_validation_error($message_or_object, $error_code = NULL, $previous_exception = NULL) { |
|
113 | + if ($message_or_object instanceof EE_Validation_Error) { |
|
114 | + $validation_error = $message_or_object; |
|
115 | 115 | $validation_error->set_form_section($this); |
116 | - }else{ |
|
116 | + } else { |
|
117 | 117 | $validation_error = new EE_Validation_Error($message_or_object, $error_code, $this, $previous_exception); |
118 | 118 | } |
119 | 119 | $this->_validation_errors[] = $validation_error; |
@@ -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 |