Completed
Branch BUG-11108-ticket-reserved-coun... (144d27)
by
unknown
14:21 queued 17s
created
core/libraries/form_sections/EE_Sample_Form.form.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-class EE_Sample_Form extends EE_Form_Section_Proper{
3
-	function __construct(){
2
+class EE_Sample_Form extends EE_Form_Section_Proper {
3
+	function __construct() {
4 4
 		$this->_subsections = array(
5 5
 			'h1'=>new EE_Form_Section_HTML('hello wordl'),
6
-			'name'=>new EE_Text_Input(array('required'=>true,'default'=>'your name here')),
6
+			'name'=>new EE_Text_Input(array('required'=>true, 'default'=>'your name here')),
7 7
 			'email'=>new EE_Email_Input(array('required'=>false)),
8
-			'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=>  __("Small", "event_espresso"),'m'=>  __("Medium", "event_espresso"),'l'=>  __("Large", "event_espresso")),array('required'=>true,'default'=>'s')),
8
+			'shirt_size'=>new EE_Select_Input(array(''=>'Please select...', 's'=>  __("Small", "event_espresso"), 'm'=>  __("Medium", "event_espresso"), 'l'=>  __("Large", "event_espresso")), array('required'=>true, 'default'=>'s')),
9 9
 			'month_normal'=>new EE_Month_Input(),
10 10
 			'month_leading_zero'=>new EE_Month_Input(true),
11 11
 			'year_2'=>new EE_Year_Input(false, 1, 1),
12
-			'year_4'=>new EE_Year_Input(true, 0,10,array('default'=>'2017')),
12
+			'year_4'=>new EE_Year_Input(true, 0, 10, array('default'=>'2017')),
13 13
 			'yes_no'=>new EE_Yes_No_Input(array('html_label_text'=>  __("Yes or No", "event_espresso"))),
14 14
 			'credit_card'=>new EE_Credit_Card_Input(),
15 15
 			'image_1'=>new EE_Admin_File_Uploader_Input(),
16 16
 			'image_2'=>new EE_Admin_File_Uploader_Input(),
17
-			'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP','mysql'=>'MYSQL'),array('default'=>array('php'))),
17
+			'skillz'=>new EE_Checkbox_Multi_Input(array('php'=>'PHP', 'mysql'=>'MYSQL'), array('default'=>array('php'))),
18 18
 			'float'=>new EE_Float_Input(),
19 19
 			'essay'=>new EE_Text_Area_Input(),
20 20
 			'amenities'=>new EE_Select_Multiple_Input(
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 	 * Extra validation for the 'name' input.
41 41
 	 * @param EE_Text_Input $form_input
42 42
 	 */
43
-	function _validate_name($form_input){
44
-		if($form_input->raw_value() != 'Mike'){
43
+	function _validate_name($form_input) {
44
+		if ($form_input->raw_value() != 'Mike') {
45 45
 			$form_input->add_validation_error(__("You are not mike. You must be brent or darren. Thats ok, I guess", 'event_espresso'), 'not-mike');
46 46
 		}
47 47
 	}
48 48
 
49
-	function _validate(){
49
+	function _validate() {
50 50
 		parent::_validate();
51
-		if($this->_subsections['shirt_size']->normalized_value() =='s'
52
-				&& $this->_subsections['year_4']->normalized_value() < 2010){
51
+		if ($this->_subsections['shirt_size']->normalized_value() == 's'
52
+				&& $this->_subsections['year_4']->normalized_value() < 2010) {
53 53
 			$this->add_validation_error(__("If you want a small shirt, you should be born after 2010. Otherwise theyre just too big", 'event_espresso'), 'too-old');
54 54
 		}
55 55
 	}
Please login to merge, or discard this patch.
core/libraries/form_sections/base/EE_Form_Section_HTML.form.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@
 block discarded – undo
2 2
 if (!defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5
- * EE_Form_Section_HTML
6
- * HTML to be laid out like a proper subsection
7
- *
8
- *
9
- * @package			Event Espresso
10
- * @subpackage
11
- * @author				Mike Nelson
12
- *
13
- * ------------------------------------------------------------------------
14
- */
5
+	 * EE_Form_Section_HTML
6
+	 * HTML to be laid out like a proper subsection
7
+	 *
8
+	 *
9
+	 * @package			Event Espresso
10
+	 * @subpackage
11
+	 * @author				Mike Nelson
12
+	 *
13
+	 * ------------------------------------------------------------------------
14
+	 */
15 15
 class EE_Form_Section_HTML extends EE_Form_Section_Base{
16 16
 
17 17
 	protected $_html = '';
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 /**
5 5
  * EE_Form_Section_HTML
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  *
13 13
  * ------------------------------------------------------------------------
14 14
  */
15
-class EE_Form_Section_HTML extends EE_Form_Section_Base{
15
+class EE_Form_Section_HTML extends EE_Form_Section_Base {
16 16
 
17 17
 	protected $_html = '';
18 18
 
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 	 * @param string $html
23 23
 	 * @param array $options_array
24 24
 	 */
25
-	public function __construct( $html = '', $options_array = array() ) {
25
+	public function __construct($html = '', $options_array = array()) {
26 26
 		$this->_html = $html;
27
-		parent::__construct( $options_array );
27
+		parent::__construct($options_array);
28 28
 	}
29 29
 
30 30
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 /**
5 6
  * EE_Form_Section_HTML
6 7
  * HTML to be laid out like a proper subsection
Please login to merge, or discard this patch.
core/libraries/form_sections/helpers/EE_Validation_Error.error.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class EE_Validation_Error extends Exception{
3
+class EE_Validation_Error extends Exception {
4 4
 	/**
5 5
 	 * Form Section from which this error originated.
6 6
 	 * @var EE_Form_Section
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * @param EE_Form_Section_Validatable $form_section
21 21
 	 * @param Exception $previous if there was an exception that caused this exception
22 22
 	 */
23
-	function __construct( $message = null, $string_code = null,$form_section = null, $previous = null){
23
+	function __construct($message = null, $string_code = null, $form_section = null, $previous = null) {
24 24
 		$this->_form_section = $form_section;
25 25
 		$this->_string_code = $string_code;
26 26
 		parent::__construct($message, 500, $previous);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * returns teh form section which caused the error.
31 31
 	 * @return EE_Form_Section_Validatable
32 32
 	 */
33
-	public function get_form_section(){
33
+	public function get_form_section() {
34 34
 		return $this->_form_section;
35 35
 	}
36 36
 	/**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @param EE_Form_Section_Validatable $form_section
39 39
 	 * @return void
40 40
 	 */
41
-	public function set_form_section($form_section){
41
+	public function set_form_section($form_section) {
42 42
 		$this->_form_section = $form_section;
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Admin_File_Uploader_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
  * @since                4.6
9 9
  *
10 10
  */
11
-class EE_Admin_File_Uploader_Input extends EE_Form_Input_Base{
11
+class EE_Admin_File_Uploader_Input extends EE_Form_Input_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param array $input_settings
15 15
 	 */
16
-	function __construct($input_settings = array()){
16
+	function __construct($input_settings = array()) {
17 17
 		$this->_set_display_strategy(new EE_Admin_File_Uploader_Display_Strategy());
18 18
 		$this->_set_normalization_strategy(new EE_Text_Normalization());
19
-		$this->_add_validation_strategy(new EE_URL_Validation_Strategy( isset( $input_settings[ 'validation_error_message' ] ) ? $input_settings[ 'validation_error_message' ] : NULL ) );
19
+		$this->_add_validation_strategy(new EE_URL_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : NULL));
20 20
 		parent::__construct($input_settings);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Credit_Card_Year_Input.input.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 
5 5
 /**
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @subpackage
10 10
  * @author				Mike Nelson
11 11
  */
12
-class EE_Credit_Card_Year_Input extends EE_Year_Input{
12
+class EE_Credit_Card_Year_Input extends EE_Year_Input {
13 13
 
14 14
 	/**
15 15
 	 * @param array $input_settings
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	 * @param int   $years_behind
18 18
 	 * @param int   $years_ahead
19 19
 	 */
20
-	function __construct( $input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15 ){
21
-		$this->set_sensitive_data_removal_strategy( new EE_All_Sensitive_Data_Removal() );
22
-		parent::__construct( $input_settings, $four_digit_year, $years_behind, $years_ahead );
20
+	function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15) {
21
+		$this->set_sensitive_data_removal_strategy(new EE_All_Sensitive_Data_Removal());
22
+		parent::__construct($input_settings, $four_digit_year, $years_behind, $years_ahead);
23 23
 	}
24 24
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * EE_Credit_Card_Year_Input
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Currency_Input.input.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@
 block discarded – undo
8 8
  * @author				Mike Nelson
9 9
  *
10 10
  */
11
-class EE_Currency_Input extends EE_Select_Input{
11
+class EE_Currency_Input extends EE_Select_Input {
12 12
 
13 13
 	/**
14 14
 	 *
15 15
 	 * @param array $only_specific_currency_codes numerically-indexed array of allowed currency codes. By default, all are allowed
16 16
 	 * @param array $input_settings
17 17
 	 */
18
-	function __construct( $only_specific_currency_codes = array(), $input_settings = array()){
18
+	function __construct($only_specific_currency_codes = array(), $input_settings = array()) {
19 19
 		$query_params = array('order_by'=>array('CNT_name'=>'asc'));
20
-		if($only_specific_currency_codes){
21
-			$query_params[0]['CNT_cur_code'] = array('IN',$only_specific_currency_codes);
20
+		if ($only_specific_currency_codes) {
21
+			$query_params[0]['CNT_cur_code'] = array('IN', $only_specific_currency_codes);
22 22
 		}
23 23
 		$all_countries = EEM_Country::instance()->get_all($query_params);
24 24
 		$country_options = array();
25
-		foreach($all_countries as $country){
25
+		foreach ($all_countries as $country) {
26 26
 			/* @var $country EE_Country */
27
-			$country_options[$country->currency_code()] = $country->name().": ".$country->currency_name_single() ." (".$country->currency_sign().")";
27
+			$country_options[$country->currency_code()] = $country->name().": ".$country->currency_name_single()." (".$country->currency_sign().")";
28 28
 		}
29
-		parent::__construct($country_options,'int',$input_settings);
29
+		parent::__construct($country_options, 'int', $input_settings);
30 30
 	}
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Fixed_Hidden_Input.input.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Brent Christensen
8 8
  */
9
-class EE_Fixed_Hidden_Input extends EE_Hidden_Input{
9
+class EE_Fixed_Hidden_Input extends EE_Hidden_Input {
10 10
 
11 11
 
12 12
 	/**
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 * @param array $req_data like $_POST
18 18
 	 * @return boolean whether or not there was an error
19 19
 	 */
20
-	protected function _normalize( $req_data ) {
20
+	protected function _normalize($req_data) {
21 21
 	}
22 22
 
23 23
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Password_Input.input.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Password_Input extends EE_Form_Input_Base{
9
+class EE_Password_Input extends EE_Form_Input_Base {
10 10
 
11 11
 
12 12
 	/**
13 13
 	 * @param array $input_settings
14 14
 	 */
15
-	function __construct($input_settings = array()){
15
+	function __construct($input_settings = array()) {
16 16
 		$this->_set_display_strategy(new EE_Text_Input_Display_Strategy('password'));
17 17
 		$this->_set_normalization_strategy(new EE_Text_Normalization());
18 18
 		parent::__construct($input_settings);
19
-		$this->set_html_class( $this->html_class() . 'password' );
19
+		$this->set_html_class($this->html_class().'password');
20 20
 	}
21 21
 
22 22
 
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multi_Model_Input.input.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @subpackage
9 9
  * @author				Mike Nelson
10 10
  */
11
-class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input{
11
+class EE_Select_Multi_Model_Input extends EE_Select_Multiple_Input {
12 12
 
13 13
 
14 14
 	protected $_naming_method;
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 	 *     example: 	if the class were an EE_Event, this could be slug(), description(), name() (default)
25 25
 	 * }
26 26
 	 */
27
-	public function __construct( $answer_options = array(), $input_settings = array() ) {
28
-		if( isset( $input_settings['naming_method'] )){
29
-			$this->set_option_naming_method( $input_settings['naming_method'] );
27
+	public function __construct($answer_options = array(), $input_settings = array()) {
28
+		if (isset($input_settings['naming_method'])) {
29
+			$this->set_option_naming_method($input_settings['naming_method']);
30 30
 		}
31
-		parent::__construct( $answer_options, $input_settings );
31
+		parent::__construct($answer_options, $input_settings);
32 32
 	}
33 33
 
34 34
 	/**
35 35
 	 * Sets the method name which will be called when outputting the options list
36 36
 	 * @param string $method
37 37
 	 */
38
-	public function set_option_naming_method($method){
38
+	public function set_option_naming_method($method) {
39 39
 		$this->_naming_method = $method;
40 40
 	}
41 41
 
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 	 * @param EE_Base_Class[] $answer_options
47 47
 	 * @return null|void
48 48
 	 */
49
-	public function set_select_options( $answer_options = array() ) {
49
+	public function set_select_options($answer_options = array()) {
50 50
 		//convert the model objects to select from into normal select options
51 51
 		$select_options = array();
52
-		foreach( $answer_options as $model_obj ){
53
-			if( $this->_naming_method ){
54
-				$display_value = call_user_func( array( $model_obj, $this->_naming_method ));
55
-			}else{
52
+		foreach ($answer_options as $model_obj) {
53
+			if ($this->_naming_method) {
54
+				$display_value = call_user_func(array($model_obj, $this->_naming_method));
55
+			} else {
56 56
 				$display_value = $model_obj->name();
57 57
 			}
58
-			$select_options[ $model_obj->ID() ] = $display_value;
58
+			$select_options[$model_obj->ID()] = $display_value;
59 59
 		}
60 60
 		parent::set_select_options($select_options);
61 61
 	}
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 	 * into the format EE_Select_Multiple expects
68 68
 	 * @param EE_Base_Class[]|array $values
69 69
 	 */
70
-	public function set_default($values){
70
+	public function set_default($values) {
71 71
 		$defaults_as_simple_ids = array();
72
-		foreach($values as $key => $value){
73
-			if($value instanceof EE_Base_Class){
72
+		foreach ($values as $key => $value) {
73
+			if ($value instanceof EE_Base_Class) {
74 74
 				$defaults_as_simple_ids[] = $value->ID();
75
-			}else{
75
+			} else {
76 76
 				$defaults_as_simple_ids[] = $value;
77 77
 			}
78 78
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		foreach( $answer_options as $model_obj ){
53 53
 			if( $this->_naming_method ){
54 54
 				$display_value = call_user_func( array( $model_obj, $this->_naming_method ));
55
-			}else{
55
+			} else{
56 56
 				$display_value = $model_obj->name();
57 57
 			}
58 58
 			$select_options[ $model_obj->ID() ] = $display_value;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		foreach($values as $key => $value){
73 73
 			if($value instanceof EE_Base_Class){
74 74
 				$defaults_as_simple_ids[] = $value->ID();
75
-			}else{
75
+			} else{
76 76
 				$defaults_as_simple_ids[] = $value;
77 77
 			}
78 78
 		}
Please login to merge, or discard this patch.