Completed
Branch BUG/4.10-migrations-fails (c52cc0)
by
unknown
16:08 queued 08:25
created
core/libraries/form_sections/inputs/EE_Credit_Card_Year_Input.input.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@
 block discarded – undo
10 10
 class EE_Credit_Card_Year_Input extends EE_Year_Input
11 11
 {
12 12
 
13
-    /**
14
-     * @param array $input_settings
15
-     * @param bool  $four_digit_year
16
-     * @param int   $years_behind
17
-     * @param int   $years_ahead
18
-     */
19
-    public function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15)
20
-    {
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
-    }
13
+	/**
14
+	 * @param array $input_settings
15
+	 * @param bool  $four_digit_year
16
+	 * @param int   $years_behind
17
+	 * @param int   $years_ahead
18
+	 */
19
+	public function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 0, $years_ahead = 15)
20
+	{
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
+	}
24 24
 }
Please login to merge, or discard this patch.
libraries/form_sections/inputs/EE_Select_Ajax_Model_Rest_Input.input.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         );
68 68
         // make sure limit and caps are always set
69 69
         $query_params = array_merge(
70
-            array( 'limit' => 10, 'caps' => EEM_Base::caps_read_admin ),
70
+            array('limit' => 10, 'caps' => EEM_Base::caps_read_admin),
71 71
             $query_params
72 72
         );
73 73
         $this->_value_field_name = EEH_Array::is_set(
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
         $values_for_options = (array) $value;
147 147
         $value_field = $this->_get_model()->field_settings_for($this->_value_field_name);
148 148
         $display_field = $this->_get_model()->field_settings_for($this->_display_field_name);
149
-        $this->_extra_select_columns[] = $value_field->get_qualified_column() . ' AS ' . $this->_value_field_name;
150
-        $this->_extra_select_columns[] = $display_field->get_qualified_column() . ' AS ' . $this->_display_field_name;
149
+        $this->_extra_select_columns[] = $value_field->get_qualified_column().' AS '.$this->_value_field_name;
150
+        $this->_extra_select_columns[] = $display_field->get_qualified_column().' AS '.$this->_display_field_name;
151 151
         $display_values = $this->_get_model()->get_all_wpdb_results(
152 152
             array(
153 153
                 array(
154
-                    $this->_value_field_name => array( 'IN', $values_for_options )
154
+                    $this->_value_field_name => array('IN', $values_for_options)
155 155
                 )
156 156
             ),
157 157
             ARRAY_A,
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
         if (is_array($select_options)) {
162 162
             foreach ($display_values as $db_rows) {
163 163
                 $db_rows = (array) $db_rows;
164
-                $select_options[ $db_rows[ $this->_value_field_name ] ] = apply_filters(
164
+                $select_options[$db_rows[$this->_value_field_name]] = apply_filters(
165 165
                     'FHEE__EE_Select_Ajax_Model_Rest_Input___set_raw_value__select_option_value',
166
-                    $db_rows[ $this->_display_field_name ],
166
+                    $db_rows[$this->_display_field_name],
167 167
                     $db_rows
168 168
                 );
169 169
             }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     protected function _get_model()
181 181
     {
182
-        if (! EE_Registry::instance()->is_model_name($this->_model_name)) {
182
+        if ( ! EE_Registry::instance()->is_model_name($this->_model_name)) {
183 183
             throw new EE_Error(
184 184
                 sprintf(
185 185
                     __(
Please login to merge, or discard this patch.
Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -17,189 +17,189 @@
 block discarded – undo
17 17
 class EE_Select_Ajax_Model_Rest_Input extends EE_Form_Input_With_Options_Base
18 18
 {
19 19
 
20
-    /**
21
-     * @var string $_model_name
22
-     */
23
-    protected $_model_name;
20
+	/**
21
+	 * @var string $_model_name
22
+	 */
23
+	protected $_model_name;
24 24
 
25
-    /**
26
-     * @var string $_display_field_name
27
-     */
28
-    protected $_display_field_name;
25
+	/**
26
+	 * @var string $_display_field_name
27
+	 */
28
+	protected $_display_field_name;
29 29
 
30
-    /**
31
-     * @var string $_value_field_name
32
-     */
33
-    protected $_value_field_name;
30
+	/**
31
+	 * @var string $_value_field_name
32
+	 */
33
+	protected $_value_field_name;
34 34
 
35
-    /**
36
-     * @var array $_extra_select_columns
37
-     */
38
-    protected $_extra_select_columns = array();
35
+	/**
36
+	 * @var array $_extra_select_columns
37
+	 */
38
+	protected $_extra_select_columns = array();
39 39
 
40 40
 
41
-    /**
42
-     * @param array $input_settings     {
43
-     * @type string $model_name         the name of model to be used for searching, both via the REST API and server-side model queries
44
-     * @type array  $query_params       default query parameters which will apply to both REST API queries and server-side queries. This should be
45
-     *                                  in the exact format that will be used for server-side model usage (eg use index 0 for where conditions, not
46
-     *                                  the string "where")
47
-     * @type string $value_field_name   the name of the model field on this model to
48
-     *                                  be used for the HTML select's option's values
49
-     * @type string $display_field_name the name of the model field on this model
50
-     *                                  to be used for the HTML select's option's display text
51
-     * @type array  $select2_args       arguments to be passed directly into the select2's JS constructor
52
-     *                                  }
53
-     *                                  And the arguments accepted by EE_Form_Input_With_Options_Base
54
-     * }
55
-     * @throws EE_Error
56
-     * @throws InvalidArgumentException
57
-     * @throws InvalidDataTypeException
58
-     * @throws InvalidInterfaceException
59
-     */
60
-    public function __construct($input_settings = array())
61
-    {
62
-        // needed input settings:
63
-        // select2_args
64
-        $this->_model_name = EEH_Array::is_set(
65
-            $input_settings,
66
-            'model_name',
67
-            null
68
-        );
69
-        $model = $this->_get_model();
70
-        $query_params = EEH_Array::is_set(
71
-            $input_settings,
72
-            'query_params',
73
-            array()
74
-        );
75
-        // make sure limit and caps are always set
76
-        $query_params = array_merge(
77
-            array( 'limit' => 10, 'caps' => EEM_Base::caps_read_admin ),
78
-            $query_params
79
-        );
80
-        $this->_value_field_name = EEH_Array::is_set(
81
-            $input_settings,
82
-            'value_field_name',
83
-            $model->primary_key_name()
84
-        );
85
-        $this->_display_field_name = EEH_Array::is_set(
86
-            $input_settings,
87
-            'display_field_name',
88
-            $model->get_a_field_of_type('EE_Text_Field_Base')->get_name()
89
-        );
90
-        $this->_extra_select_columns = EEH_Array::is_set(
91
-            $input_settings,
92
-            'extra_select_columns',
93
-            array()
94
-        );
95
-        $this->_add_validation_strategy(
96
-            new EE_Model_Matching_Query_Validation_Strategy(
97
-                '',
98
-                $this->_model_name,
99
-                $query_params,
100
-                $this->_value_field_name
101
-            )
102
-        );
103
-        // get resource endpoint
104
-        $rest_controller = LoaderFactory::getLoader()->getNew(
105
-            'EventEspresso\core\libraries\rest_api\controllers\model\Read'
106
-        );
107
-        $rest_controller->setRequestedVersion(EED_Core_Rest_Api::latest_rest_api_version());
108
-        $default_select2_args = array(
109
-            'ajax' => array(
110
-                'url' => $rest_controller->getVersionedLinkTo(
111
-                    EEH_Inflector::pluralize_and_lower($this->_model_name)
112
-                ),
113
-                'dataType' => 'json',
114
-                'delay' => '250',
115
-                'data_interface' => 'EE_Select2_REST_API_Interface',
116
-                'data_interface_args' => array(
117
-                    'default_query_params' => (object) ModelDataTranslator::prepareQueryParamsForRestApi(
118
-                        $query_params,
119
-                        $model
120
-                    ),
121
-                    'display_field' => $this->_display_field_name,
122
-                    'value_field' => $this->_value_field_name,
123
-                    'nonce' => wp_create_nonce('wp_rest'),
124
-                    'locale' => str_replace('_', '-', strtolower(get_locale()))
125
-                ),
126
-            ),
127
-            'cache' => true,
128
-            'width' => 'resolve'
129
-        );
130
-        $select2_args = array_replace_recursive(
131
-            $default_select2_args,
132
-            (array) EEH_Array::is_set($input_settings, 'select2_args', array())
133
-        );
134
-        $this->set_display_strategy(new EE_Select2_Display_Strategy($select2_args));
135
-        parent::__construct(array(), $input_settings);
136
-    }
41
+	/**
42
+	 * @param array $input_settings     {
43
+	 * @type string $model_name         the name of model to be used for searching, both via the REST API and server-side model queries
44
+	 * @type array  $query_params       default query parameters which will apply to both REST API queries and server-side queries. This should be
45
+	 *                                  in the exact format that will be used for server-side model usage (eg use index 0 for where conditions, not
46
+	 *                                  the string "where")
47
+	 * @type string $value_field_name   the name of the model field on this model to
48
+	 *                                  be used for the HTML select's option's values
49
+	 * @type string $display_field_name the name of the model field on this model
50
+	 *                                  to be used for the HTML select's option's display text
51
+	 * @type array  $select2_args       arguments to be passed directly into the select2's JS constructor
52
+	 *                                  }
53
+	 *                                  And the arguments accepted by EE_Form_Input_With_Options_Base
54
+	 * }
55
+	 * @throws EE_Error
56
+	 * @throws InvalidArgumentException
57
+	 * @throws InvalidDataTypeException
58
+	 * @throws InvalidInterfaceException
59
+	 */
60
+	public function __construct($input_settings = array())
61
+	{
62
+		// needed input settings:
63
+		// select2_args
64
+		$this->_model_name = EEH_Array::is_set(
65
+			$input_settings,
66
+			'model_name',
67
+			null
68
+		);
69
+		$model = $this->_get_model();
70
+		$query_params = EEH_Array::is_set(
71
+			$input_settings,
72
+			'query_params',
73
+			array()
74
+		);
75
+		// make sure limit and caps are always set
76
+		$query_params = array_merge(
77
+			array( 'limit' => 10, 'caps' => EEM_Base::caps_read_admin ),
78
+			$query_params
79
+		);
80
+		$this->_value_field_name = EEH_Array::is_set(
81
+			$input_settings,
82
+			'value_field_name',
83
+			$model->primary_key_name()
84
+		);
85
+		$this->_display_field_name = EEH_Array::is_set(
86
+			$input_settings,
87
+			'display_field_name',
88
+			$model->get_a_field_of_type('EE_Text_Field_Base')->get_name()
89
+		);
90
+		$this->_extra_select_columns = EEH_Array::is_set(
91
+			$input_settings,
92
+			'extra_select_columns',
93
+			array()
94
+		);
95
+		$this->_add_validation_strategy(
96
+			new EE_Model_Matching_Query_Validation_Strategy(
97
+				'',
98
+				$this->_model_name,
99
+				$query_params,
100
+				$this->_value_field_name
101
+			)
102
+		);
103
+		// get resource endpoint
104
+		$rest_controller = LoaderFactory::getLoader()->getNew(
105
+			'EventEspresso\core\libraries\rest_api\controllers\model\Read'
106
+		);
107
+		$rest_controller->setRequestedVersion(EED_Core_Rest_Api::latest_rest_api_version());
108
+		$default_select2_args = array(
109
+			'ajax' => array(
110
+				'url' => $rest_controller->getVersionedLinkTo(
111
+					EEH_Inflector::pluralize_and_lower($this->_model_name)
112
+				),
113
+				'dataType' => 'json',
114
+				'delay' => '250',
115
+				'data_interface' => 'EE_Select2_REST_API_Interface',
116
+				'data_interface_args' => array(
117
+					'default_query_params' => (object) ModelDataTranslator::prepareQueryParamsForRestApi(
118
+						$query_params,
119
+						$model
120
+					),
121
+					'display_field' => $this->_display_field_name,
122
+					'value_field' => $this->_value_field_name,
123
+					'nonce' => wp_create_nonce('wp_rest'),
124
+					'locale' => str_replace('_', '-', strtolower(get_locale()))
125
+				),
126
+			),
127
+			'cache' => true,
128
+			'width' => 'resolve'
129
+		);
130
+		$select2_args = array_replace_recursive(
131
+			$default_select2_args,
132
+			(array) EEH_Array::is_set($input_settings, 'select2_args', array())
133
+		);
134
+		$this->set_display_strategy(new EE_Select2_Display_Strategy($select2_args));
135
+		parent::__construct(array(), $input_settings);
136
+	}
137 137
 
138 138
 
139 139
 
140
-    /**
141
-     * Before setting the raw value (usually because we're setting the default,
142
-     * or we've received a form submission and this might be re-displayed to the user),
143
-     * sets the options so that the current selections appear on initial display.
144
-     *
145
-     * Note: because this input uses EE_Model_Matching_Query_Validation_Strategy
146
-     * for validation, this input's options only affect DISPLAY and NOT validation,
147
-     * which is why its ok to just assume the provided $value to be in the list of acceptable values
148
-     *
149
-     * @param mixed $value
150
-     * @return void
151
-     * @throws \EE_Error
152
-     */
153
-    public function _set_raw_value($value)
154
-    {
155
-        $values_for_options = (array) $value;
156
-        $value_field = $this->_get_model()->field_settings_for($this->_value_field_name);
157
-        $display_field = $this->_get_model()->field_settings_for($this->_display_field_name);
158
-        $this->_extra_select_columns[] = $value_field->get_qualified_column() . ' AS ' . $this->_value_field_name;
159
-        $this->_extra_select_columns[] = $display_field->get_qualified_column() . ' AS ' . $this->_display_field_name;
160
-        $display_values = $this->_get_model()->get_all_wpdb_results(
161
-            array(
162
-                array(
163
-                    $this->_value_field_name => array( 'IN', $values_for_options )
164
-                )
165
-            ),
166
-            ARRAY_A,
167
-            implode(',', $this->_extra_select_columns)
168
-        );
169
-        $select_options = array();
170
-        if (is_array($select_options)) {
171
-            foreach ($display_values as $db_rows) {
172
-                $db_rows = (array) $db_rows;
173
-                $select_options[ $db_rows[ $this->_value_field_name ] ] = apply_filters(
174
-                    'FHEE__EE_Select_Ajax_Model_Rest_Input___set_raw_value__select_option_value',
175
-                    $db_rows[ $this->_display_field_name ],
176
-                    $db_rows
177
-                );
178
-            }
179
-        }
180
-        $this->set_select_options($select_options);
181
-        parent::_set_raw_value($value);
182
-    }
140
+	/**
141
+	 * Before setting the raw value (usually because we're setting the default,
142
+	 * or we've received a form submission and this might be re-displayed to the user),
143
+	 * sets the options so that the current selections appear on initial display.
144
+	 *
145
+	 * Note: because this input uses EE_Model_Matching_Query_Validation_Strategy
146
+	 * for validation, this input's options only affect DISPLAY and NOT validation,
147
+	 * which is why its ok to just assume the provided $value to be in the list of acceptable values
148
+	 *
149
+	 * @param mixed $value
150
+	 * @return void
151
+	 * @throws \EE_Error
152
+	 */
153
+	public function _set_raw_value($value)
154
+	{
155
+		$values_for_options = (array) $value;
156
+		$value_field = $this->_get_model()->field_settings_for($this->_value_field_name);
157
+		$display_field = $this->_get_model()->field_settings_for($this->_display_field_name);
158
+		$this->_extra_select_columns[] = $value_field->get_qualified_column() . ' AS ' . $this->_value_field_name;
159
+		$this->_extra_select_columns[] = $display_field->get_qualified_column() . ' AS ' . $this->_display_field_name;
160
+		$display_values = $this->_get_model()->get_all_wpdb_results(
161
+			array(
162
+				array(
163
+					$this->_value_field_name => array( 'IN', $values_for_options )
164
+				)
165
+			),
166
+			ARRAY_A,
167
+			implode(',', $this->_extra_select_columns)
168
+		);
169
+		$select_options = array();
170
+		if (is_array($select_options)) {
171
+			foreach ($display_values as $db_rows) {
172
+				$db_rows = (array) $db_rows;
173
+				$select_options[ $db_rows[ $this->_value_field_name ] ] = apply_filters(
174
+					'FHEE__EE_Select_Ajax_Model_Rest_Input___set_raw_value__select_option_value',
175
+					$db_rows[ $this->_display_field_name ],
176
+					$db_rows
177
+				);
178
+			}
179
+		}
180
+		$this->set_select_options($select_options);
181
+		parent::_set_raw_value($value);
182
+	}
183 183
 
184
-    /**
185
-     * Returns the model, or throws an exception if the model name provided in constructor doesn't exist
186
-     * @return EEM_Base
187
-     * @throws EE_Error
188
-     */
189
-    protected function _get_model()
190
-    {
191
-        if (! EE_Registry::instance()->is_model_name($this->_model_name)) {
192
-            throw new EE_Error(
193
-                sprintf(
194
-                    __(
195
-                        '%1$s is not a proper model name. Please provide a model name in the "model_name" form input argument',
196
-                        'event_espresso'
197
-                    ),
198
-                    $this->_model_name
199
-                )
200
-            );
201
-        } else {
202
-            return EE_Registry::instance()->load_model($this->_model_name);
203
-        }
204
-    }
184
+	/**
185
+	 * Returns the model, or throws an exception if the model name provided in constructor doesn't exist
186
+	 * @return EEM_Base
187
+	 * @throws EE_Error
188
+	 */
189
+	protected function _get_model()
190
+	{
191
+		if (! EE_Registry::instance()->is_model_name($this->_model_name)) {
192
+			throw new EE_Error(
193
+				sprintf(
194
+					__(
195
+						'%1$s is not a proper model name. Please provide a model name in the "model_name" form input argument',
196
+						'event_espresso'
197
+					),
198
+					$this->_model_name
199
+				)
200
+			);
201
+		} else {
202
+			return EE_Registry::instance()->load_model($this->_model_name);
203
+		}
204
+	}
205 205
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Credit_Card_Input.input.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@
 block discarded – undo
10 10
 class EE_Credit_Card_Input extends EE_Form_Input_Base
11 11
 {
12 12
 
13
-    /**
14
-     * @param array $input_settings
15
-     */
16
-    public function __construct($input_settings = array())
17
-    {
18
-        $input_settings['required'] = isset($input_settings['required']) ? $input_settings['required'] : true;
19
-        $this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
20
-        $this->_set_normalization_strategy(new EE_Credit_Card_Normalization());
21
-        $this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null));
22
-        $this->set_sensitive_data_removal_strategy(new EE_Credit_Card_Sensitive_Data_Removal());
23
-        parent::__construct($input_settings);
24
-    }
13
+	/**
14
+	 * @param array $input_settings
15
+	 */
16
+	public function __construct($input_settings = array())
17
+	{
18
+		$input_settings['required'] = isset($input_settings['required']) ? $input_settings['required'] : true;
19
+		$this->_set_display_strategy(new EE_Text_Input_Display_Strategy());
20
+		$this->_set_normalization_strategy(new EE_Credit_Card_Normalization());
21
+		$this->_add_validation_strategy(new EE_Credit_Card_Validation_Strategy(isset($input_settings['validation_error_message']) ? $input_settings['validation_error_message'] : null));
22
+		$this->set_sensitive_data_removal_strategy(new EE_Credit_Card_Sensitive_Data_Removal());
23
+		parent::__construct($input_settings);
24
+	}
25 25
 }
Please login to merge, or discard this patch.
libraries/form_sections/inputs/EE_Form_Input_With_Options_Base.input.php 2 patches
Indentation   +317 added lines, -317 removed lines patch added patch discarded remove patch
@@ -11,321 +11,321 @@
 block discarded – undo
11 11
 class EE_Form_Input_With_Options_Base extends EE_Form_Input_Base
12 12
 {
13 13
 
14
-    /**
15
-     * array of available options to choose as an answer
16
-     *
17
-     * @var array
18
-     */
19
-    protected $_options = array();
20
-
21
-    /**
22
-     * whether to display the html_label_text above the checkbox/radio button options
23
-     *
24
-     * @var boolean
25
-     */
26
-    protected $_display_html_label_text = true;
27
-
28
-    /**
29
-     * whether to display an question option description as part of the input label
30
-     *
31
-     * @var boolean
32
-     */
33
-    protected $_use_desc_in_label = true;
34
-
35
-    /**
36
-     * strlen() result for the longest input value (what gets displayed in the label)
37
-     * this is used to apply a css class to the input label
38
-     *
39
-     * @var int
40
-     */
41
-    protected $_label_size = 0;
42
-
43
-    /**
44
-     * whether to enforce the label size value passed in the constructor
45
-     *
46
-     * @var boolean
47
-     */
48
-    protected $_enforce_label_size = false;
49
-
50
-    /**
51
-     * whether to allow multiple selections (ie, the value of this input should be an array)
52
-     * or not (ie, the value should be a simple int, string, etc)
53
-     *
54
-     * @var boolean
55
-     */
56
-    protected $_multiple_selections = false;
57
-
58
-
59
-
60
-    /**
61
-     * @param array     $answer_options
62
-     * @param array     $input_settings {
63
-     * @type int|string $label_size
64
-     * @type boolean    $display_html_label_text
65
-     *                                  }
66
-     *                                  And all the options accepted by EE_Form_Input_Base
67
-     */
68
-    public function __construct($answer_options = array(), $input_settings = array())
69
-    {
70
-        if (isset($input_settings['label_size'])) {
71
-            $this->_set_label_size($input_settings['label_size']);
72
-            if (isset($input_settings['enforce_label_size']) && $input_settings['enforce_label_size']) {
73
-                $this->_enforce_label_size = true;
74
-            }
75
-        }
76
-        if (isset($input_settings['display_html_label_text'])) {
77
-            $this->set_display_html_label_text($input_settings['display_html_label_text']);
78
-        }
79
-        $this->set_select_options($answer_options);
80
-        parent::__construct($input_settings);
81
-    }
82
-
83
-
84
-
85
-    /**
86
-     * Sets the allowed options for this input. Also has the side-effect of
87
-     * updating the normalization strategy to match the keys provided in the array
88
-     *
89
-     * @param array $answer_options
90
-     * @return void  just has the side-effect of setting the options for this input
91
-     */
92
-    public function set_select_options($answer_options = array())
93
-    {
94
-        $answer_options = is_array($answer_options) ? $answer_options : array($answer_options);
95
-        // get the first item in the select options and check it's type
96
-        $this->_options = reset($answer_options) instanceof EE_Question_Option
97
-            ? $this->_process_question_options($answer_options)
98
-            : $answer_options;
99
-        // d( $this->_options );
100
-        $select_option_keys = array_keys($this->_options);
101
-        // attempt to determine data type for values in order to set normalization type
102
-        // purposefully only
103
-        if (count($this->_options) === 2
104
-            && (
105
-                (in_array(true, $select_option_keys, true) && in_array(false, $select_option_keys, true))
106
-                || (in_array(1, $select_option_keys, true) && in_array(0, $select_option_keys, true))
107
-            )
108
-        ) {
109
-            // values appear to be boolean, like TRUE, FALSE, 1, 0
110
-            $normalization = new EE_Boolean_Normalization();
111
-        } else {
112
-            // are ALL the options ints (even if we're using a multi-dimensional array)? If so use int validation
113
-            $all_ints = true;
114
-            array_walk_recursive(
115
-                $this->_options,
116
-                function ($value, $key) use (&$all_ints) {
117
-                    // is this a top-level key? ignore it
118
-                    if (! is_array($value)
119
-                        && ! is_int($key)
120
-                       && $key !== ''
121
-                       && $key !== null) {
122
-                        $all_ints = false;
123
-                    }
124
-                }
125
-            );
126
-            if ($all_ints) {
127
-                $normalization = new EE_Int_Normalization();
128
-            } else {
129
-                $normalization = new EE_Text_Normalization();
130
-            }
131
-        }
132
-        // does input type have multiple options ?
133
-        if ($this->_multiple_selections) {
134
-            $this->_set_normalization_strategy(new EE_Many_Valued_Normalization($normalization));
135
-        } else {
136
-            $this->_set_normalization_strategy($normalization);
137
-        }
138
-    }
139
-
140
-
141
-
142
-    /**
143
-     * @return array
144
-     */
145
-    public function options()
146
-    {
147
-        return $this->_options;
148
-    }
149
-
150
-
151
-
152
-    /**
153
-     * Returns an array which is guaranteed to not be multidimensional
154
-     *
155
-     * @return array
156
-     */
157
-    public function flat_options()
158
-    {
159
-        return $this->_flatten_select_options($this->options());
160
-    }
161
-
162
-
163
-
164
-    /**
165
-     * Makes sure $arr is a flat array, not a multidimensional one
166
-     *
167
-     * @param array $arr
168
-     * @return array
169
-     */
170
-    protected function _flatten_select_options($arr)
171
-    {
172
-        $flat_array = array();
173
-        if (EEH_Array::is_multi_dimensional_array($arr)) {
174
-            foreach ($arr as $sub_array) {
175
-                foreach ((array) $sub_array as $key => $value) {
176
-                    $flat_array[ $key ] = $value;
177
-                    $this->_set_label_size($value);
178
-                }
179
-            }
180
-        } else {
181
-            foreach ($arr as $key => $value) {
182
-                $flat_array[ $key ] = $value;
183
-                $this->_set_label_size($value);
184
-            }
185
-        }
186
-        return $flat_array;
187
-    }
188
-
189
-
190
-
191
-    /**
192
-     * @param EE_Question_Option[] $question_options_array
193
-     * @return array
194
-     */
195
-    protected function _process_question_options($question_options_array = array())
196
-    {
197
-        $flat_array = array();
198
-        foreach ($question_options_array as $question_option) {
199
-            if ($question_option instanceof EE_Question_Option) {
200
-                $desc = '';
201
-                if ($this->_use_desc_in_label) {
202
-                    $desc = $question_option->desc();
203
-                    $desc = ! empty($desc) ? '<span class="ee-question-option-desc">' . $desc . '</span>' : '';
204
-                }
205
-                $value = $question_option->value();
206
-                // add value even if it's empty
207
-                $flat_array[ $value ] = $value;
208
-                // if both value and desc are not empty, then separate with a dash
209
-                if (! empty($value) && ! empty($desc)) {
210
-                    $flat_array[ $value ] .= ' - ' . $desc;
211
-                } else {
212
-                    // otherwise, just add desc, since either or both of the vars is empty, and no dash is necessary
213
-                    $flat_array[ $value ] .= $desc;
214
-                }
215
-            } elseif (is_array($question_option)) {
216
-                $flat_array += $this->_flatten_select_options($question_option);
217
-            }
218
-        }
219
-        return $flat_array;
220
-    }
221
-
222
-
223
-
224
-    /**
225
-     *    set_label_sizes
226
-     *
227
-     * @return void
228
-     */
229
-    public function set_label_sizes()
230
-    {
231
-        // did the input settings specifically say to NOT set the label size dynamically ?
232
-        if (! $this->_enforce_label_size) {
233
-            foreach ($this->_options as $option) {
234
-                // calculate the strlen of the label
235
-                $this->_set_label_size($option);
236
-            }
237
-        }
238
-    }
239
-
240
-
241
-
242
-    /**
243
-     *    _set_label_size_class
244
-     *
245
-     * @param int|string $value
246
-     * @return void
247
-     */
248
-    private function _set_label_size($value = '')
249
-    {
250
-        // don't change label size if it has already been set and is being enforced
251
-        if ($this->_enforce_label_size && $this->_label_size >  0) {
252
-            return;
253
-        }
254
-        // determine length of option value
255
-        $val_size = is_int($value) ? $value : strlen($value);
256
-        // use new value if bigger than existing
257
-        $this->_label_size = $val_size > $this->_label_size ? $val_size : $this->_label_size;
258
-    }
259
-
260
-
261
-
262
-    /**
263
-     *    get_label_size_class
264
-     *
265
-     * @return string
266
-     */
267
-    public function get_label_size_class()
268
-    {
269
-        $size = ' medium-lbl';
270
-        // use maximum option value length to determine label size
271
-        if ($this->_label_size < 3) {
272
-            $size = ' nano-lbl';
273
-        } elseif ($this->_label_size < 6) {
274
-            $size = ' micro-lbl';
275
-        } elseif ($this->_label_size < 12) {
276
-            $size = ' tiny-lbl';
277
-        } elseif ($this->_label_size < 25) {
278
-            $size = ' small-lbl';
279
-        } elseif ($this->_label_size < 50) {
280
-            $size = ' medium-lbl';
281
-        } elseif ($this->_label_size >= 100) {
282
-            $size = ' big-lbl';
283
-        }
284
-        return $size;
285
-    }
286
-
287
-
288
-
289
-    /**
290
-     * Returns the pretty value for the normalized value
291
-     *
292
-     * @return string
293
-     */
294
-    public function pretty_value()
295
-    {
296
-        $options = $this->flat_options();
297
-        $unnormalized_value_choices = $this->get_normalization_strategy()->unnormalize($this->_normalized_value);
298
-        if (! $this->_multiple_selections) {
299
-            $unnormalized_value_choices = array($unnormalized_value_choices);
300
-        }
301
-        $pretty_strings = array();
302
-        foreach ((array) $unnormalized_value_choices as $unnormalized_value_choice) {
303
-            if (isset($options[ $unnormalized_value_choice ])) {
304
-                $pretty_strings[] = $options[ $unnormalized_value_choice ];
305
-            } else {
306
-                $pretty_strings[] = $this->normalized_value();
307
-            }
308
-        }
309
-        return implode(', ', $pretty_strings);
310
-    }
311
-
312
-
313
-
314
-    /**
315
-     * @return boolean
316
-     */
317
-    public function display_html_label_text()
318
-    {
319
-        return $this->_display_html_label_text;
320
-    }
321
-
322
-
323
-
324
-    /**
325
-     * @param boolean $display_html_label_text
326
-     */
327
-    public function set_display_html_label_text($display_html_label_text)
328
-    {
329
-        $this->_display_html_label_text = filter_var($display_html_label_text, FILTER_VALIDATE_BOOLEAN);
330
-    }
14
+	/**
15
+	 * array of available options to choose as an answer
16
+	 *
17
+	 * @var array
18
+	 */
19
+	protected $_options = array();
20
+
21
+	/**
22
+	 * whether to display the html_label_text above the checkbox/radio button options
23
+	 *
24
+	 * @var boolean
25
+	 */
26
+	protected $_display_html_label_text = true;
27
+
28
+	/**
29
+	 * whether to display an question option description as part of the input label
30
+	 *
31
+	 * @var boolean
32
+	 */
33
+	protected $_use_desc_in_label = true;
34
+
35
+	/**
36
+	 * strlen() result for the longest input value (what gets displayed in the label)
37
+	 * this is used to apply a css class to the input label
38
+	 *
39
+	 * @var int
40
+	 */
41
+	protected $_label_size = 0;
42
+
43
+	/**
44
+	 * whether to enforce the label size value passed in the constructor
45
+	 *
46
+	 * @var boolean
47
+	 */
48
+	protected $_enforce_label_size = false;
49
+
50
+	/**
51
+	 * whether to allow multiple selections (ie, the value of this input should be an array)
52
+	 * or not (ie, the value should be a simple int, string, etc)
53
+	 *
54
+	 * @var boolean
55
+	 */
56
+	protected $_multiple_selections = false;
57
+
58
+
59
+
60
+	/**
61
+	 * @param array     $answer_options
62
+	 * @param array     $input_settings {
63
+	 * @type int|string $label_size
64
+	 * @type boolean    $display_html_label_text
65
+	 *                                  }
66
+	 *                                  And all the options accepted by EE_Form_Input_Base
67
+	 */
68
+	public function __construct($answer_options = array(), $input_settings = array())
69
+	{
70
+		if (isset($input_settings['label_size'])) {
71
+			$this->_set_label_size($input_settings['label_size']);
72
+			if (isset($input_settings['enforce_label_size']) && $input_settings['enforce_label_size']) {
73
+				$this->_enforce_label_size = true;
74
+			}
75
+		}
76
+		if (isset($input_settings['display_html_label_text'])) {
77
+			$this->set_display_html_label_text($input_settings['display_html_label_text']);
78
+		}
79
+		$this->set_select_options($answer_options);
80
+		parent::__construct($input_settings);
81
+	}
82
+
83
+
84
+
85
+	/**
86
+	 * Sets the allowed options for this input. Also has the side-effect of
87
+	 * updating the normalization strategy to match the keys provided in the array
88
+	 *
89
+	 * @param array $answer_options
90
+	 * @return void  just has the side-effect of setting the options for this input
91
+	 */
92
+	public function set_select_options($answer_options = array())
93
+	{
94
+		$answer_options = is_array($answer_options) ? $answer_options : array($answer_options);
95
+		// get the first item in the select options and check it's type
96
+		$this->_options = reset($answer_options) instanceof EE_Question_Option
97
+			? $this->_process_question_options($answer_options)
98
+			: $answer_options;
99
+		// d( $this->_options );
100
+		$select_option_keys = array_keys($this->_options);
101
+		// attempt to determine data type for values in order to set normalization type
102
+		// purposefully only
103
+		if (count($this->_options) === 2
104
+			&& (
105
+				(in_array(true, $select_option_keys, true) && in_array(false, $select_option_keys, true))
106
+				|| (in_array(1, $select_option_keys, true) && in_array(0, $select_option_keys, true))
107
+			)
108
+		) {
109
+			// values appear to be boolean, like TRUE, FALSE, 1, 0
110
+			$normalization = new EE_Boolean_Normalization();
111
+		} else {
112
+			// are ALL the options ints (even if we're using a multi-dimensional array)? If so use int validation
113
+			$all_ints = true;
114
+			array_walk_recursive(
115
+				$this->_options,
116
+				function ($value, $key) use (&$all_ints) {
117
+					// is this a top-level key? ignore it
118
+					if (! is_array($value)
119
+						&& ! is_int($key)
120
+					   && $key !== ''
121
+					   && $key !== null) {
122
+						$all_ints = false;
123
+					}
124
+				}
125
+			);
126
+			if ($all_ints) {
127
+				$normalization = new EE_Int_Normalization();
128
+			} else {
129
+				$normalization = new EE_Text_Normalization();
130
+			}
131
+		}
132
+		// does input type have multiple options ?
133
+		if ($this->_multiple_selections) {
134
+			$this->_set_normalization_strategy(new EE_Many_Valued_Normalization($normalization));
135
+		} else {
136
+			$this->_set_normalization_strategy($normalization);
137
+		}
138
+	}
139
+
140
+
141
+
142
+	/**
143
+	 * @return array
144
+	 */
145
+	public function options()
146
+	{
147
+		return $this->_options;
148
+	}
149
+
150
+
151
+
152
+	/**
153
+	 * Returns an array which is guaranteed to not be multidimensional
154
+	 *
155
+	 * @return array
156
+	 */
157
+	public function flat_options()
158
+	{
159
+		return $this->_flatten_select_options($this->options());
160
+	}
161
+
162
+
163
+
164
+	/**
165
+	 * Makes sure $arr is a flat array, not a multidimensional one
166
+	 *
167
+	 * @param array $arr
168
+	 * @return array
169
+	 */
170
+	protected function _flatten_select_options($arr)
171
+	{
172
+		$flat_array = array();
173
+		if (EEH_Array::is_multi_dimensional_array($arr)) {
174
+			foreach ($arr as $sub_array) {
175
+				foreach ((array) $sub_array as $key => $value) {
176
+					$flat_array[ $key ] = $value;
177
+					$this->_set_label_size($value);
178
+				}
179
+			}
180
+		} else {
181
+			foreach ($arr as $key => $value) {
182
+				$flat_array[ $key ] = $value;
183
+				$this->_set_label_size($value);
184
+			}
185
+		}
186
+		return $flat_array;
187
+	}
188
+
189
+
190
+
191
+	/**
192
+	 * @param EE_Question_Option[] $question_options_array
193
+	 * @return array
194
+	 */
195
+	protected function _process_question_options($question_options_array = array())
196
+	{
197
+		$flat_array = array();
198
+		foreach ($question_options_array as $question_option) {
199
+			if ($question_option instanceof EE_Question_Option) {
200
+				$desc = '';
201
+				if ($this->_use_desc_in_label) {
202
+					$desc = $question_option->desc();
203
+					$desc = ! empty($desc) ? '<span class="ee-question-option-desc">' . $desc . '</span>' : '';
204
+				}
205
+				$value = $question_option->value();
206
+				// add value even if it's empty
207
+				$flat_array[ $value ] = $value;
208
+				// if both value and desc are not empty, then separate with a dash
209
+				if (! empty($value) && ! empty($desc)) {
210
+					$flat_array[ $value ] .= ' - ' . $desc;
211
+				} else {
212
+					// otherwise, just add desc, since either or both of the vars is empty, and no dash is necessary
213
+					$flat_array[ $value ] .= $desc;
214
+				}
215
+			} elseif (is_array($question_option)) {
216
+				$flat_array += $this->_flatten_select_options($question_option);
217
+			}
218
+		}
219
+		return $flat_array;
220
+	}
221
+
222
+
223
+
224
+	/**
225
+	 *    set_label_sizes
226
+	 *
227
+	 * @return void
228
+	 */
229
+	public function set_label_sizes()
230
+	{
231
+		// did the input settings specifically say to NOT set the label size dynamically ?
232
+		if (! $this->_enforce_label_size) {
233
+			foreach ($this->_options as $option) {
234
+				// calculate the strlen of the label
235
+				$this->_set_label_size($option);
236
+			}
237
+		}
238
+	}
239
+
240
+
241
+
242
+	/**
243
+	 *    _set_label_size_class
244
+	 *
245
+	 * @param int|string $value
246
+	 * @return void
247
+	 */
248
+	private function _set_label_size($value = '')
249
+	{
250
+		// don't change label size if it has already been set and is being enforced
251
+		if ($this->_enforce_label_size && $this->_label_size >  0) {
252
+			return;
253
+		}
254
+		// determine length of option value
255
+		$val_size = is_int($value) ? $value : strlen($value);
256
+		// use new value if bigger than existing
257
+		$this->_label_size = $val_size > $this->_label_size ? $val_size : $this->_label_size;
258
+	}
259
+
260
+
261
+
262
+	/**
263
+	 *    get_label_size_class
264
+	 *
265
+	 * @return string
266
+	 */
267
+	public function get_label_size_class()
268
+	{
269
+		$size = ' medium-lbl';
270
+		// use maximum option value length to determine label size
271
+		if ($this->_label_size < 3) {
272
+			$size = ' nano-lbl';
273
+		} elseif ($this->_label_size < 6) {
274
+			$size = ' micro-lbl';
275
+		} elseif ($this->_label_size < 12) {
276
+			$size = ' tiny-lbl';
277
+		} elseif ($this->_label_size < 25) {
278
+			$size = ' small-lbl';
279
+		} elseif ($this->_label_size < 50) {
280
+			$size = ' medium-lbl';
281
+		} elseif ($this->_label_size >= 100) {
282
+			$size = ' big-lbl';
283
+		}
284
+		return $size;
285
+	}
286
+
287
+
288
+
289
+	/**
290
+	 * Returns the pretty value for the normalized value
291
+	 *
292
+	 * @return string
293
+	 */
294
+	public function pretty_value()
295
+	{
296
+		$options = $this->flat_options();
297
+		$unnormalized_value_choices = $this->get_normalization_strategy()->unnormalize($this->_normalized_value);
298
+		if (! $this->_multiple_selections) {
299
+			$unnormalized_value_choices = array($unnormalized_value_choices);
300
+		}
301
+		$pretty_strings = array();
302
+		foreach ((array) $unnormalized_value_choices as $unnormalized_value_choice) {
303
+			if (isset($options[ $unnormalized_value_choice ])) {
304
+				$pretty_strings[] = $options[ $unnormalized_value_choice ];
305
+			} else {
306
+				$pretty_strings[] = $this->normalized_value();
307
+			}
308
+		}
309
+		return implode(', ', $pretty_strings);
310
+	}
311
+
312
+
313
+
314
+	/**
315
+	 * @return boolean
316
+	 */
317
+	public function display_html_label_text()
318
+	{
319
+		return $this->_display_html_label_text;
320
+	}
321
+
322
+
323
+
324
+	/**
325
+	 * @param boolean $display_html_label_text
326
+	 */
327
+	public function set_display_html_label_text($display_html_label_text)
328
+	{
329
+		$this->_display_html_label_text = filter_var($display_html_label_text, FILTER_VALIDATE_BOOLEAN);
330
+	}
331 331
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
             $all_ints = true;
114 114
             array_walk_recursive(
115 115
                 $this->_options,
116
-                function ($value, $key) use (&$all_ints) {
116
+                function($value, $key) use (&$all_ints) {
117 117
                     // is this a top-level key? ignore it
118
-                    if (! is_array($value)
118
+                    if ( ! is_array($value)
119 119
                         && ! is_int($key)
120 120
                        && $key !== ''
121 121
                        && $key !== null) {
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
         if (EEH_Array::is_multi_dimensional_array($arr)) {
174 174
             foreach ($arr as $sub_array) {
175 175
                 foreach ((array) $sub_array as $key => $value) {
176
-                    $flat_array[ $key ] = $value;
176
+                    $flat_array[$key] = $value;
177 177
                     $this->_set_label_size($value);
178 178
                 }
179 179
             }
180 180
         } else {
181 181
             foreach ($arr as $key => $value) {
182
-                $flat_array[ $key ] = $value;
182
+                $flat_array[$key] = $value;
183 183
                 $this->_set_label_size($value);
184 184
             }
185 185
         }
@@ -200,17 +200,17 @@  discard block
 block discarded – undo
200 200
                 $desc = '';
201 201
                 if ($this->_use_desc_in_label) {
202 202
                     $desc = $question_option->desc();
203
-                    $desc = ! empty($desc) ? '<span class="ee-question-option-desc">' . $desc . '</span>' : '';
203
+                    $desc = ! empty($desc) ? '<span class="ee-question-option-desc">'.$desc.'</span>' : '';
204 204
                 }
205 205
                 $value = $question_option->value();
206 206
                 // add value even if it's empty
207
-                $flat_array[ $value ] = $value;
207
+                $flat_array[$value] = $value;
208 208
                 // if both value and desc are not empty, then separate with a dash
209
-                if (! empty($value) && ! empty($desc)) {
210
-                    $flat_array[ $value ] .= ' - ' . $desc;
209
+                if ( ! empty($value) && ! empty($desc)) {
210
+                    $flat_array[$value] .= ' - '.$desc;
211 211
                 } else {
212 212
                     // otherwise, just add desc, since either or both of the vars is empty, and no dash is necessary
213
-                    $flat_array[ $value ] .= $desc;
213
+                    $flat_array[$value] .= $desc;
214 214
                 }
215 215
             } elseif (is_array($question_option)) {
216 216
                 $flat_array += $this->_flatten_select_options($question_option);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     public function set_label_sizes()
230 230
     {
231 231
         // did the input settings specifically say to NOT set the label size dynamically ?
232
-        if (! $this->_enforce_label_size) {
232
+        if ( ! $this->_enforce_label_size) {
233 233
             foreach ($this->_options as $option) {
234 234
                 // calculate the strlen of the label
235 235
                 $this->_set_label_size($option);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     private function _set_label_size($value = '')
249 249
     {
250 250
         // don't change label size if it has already been set and is being enforced
251
-        if ($this->_enforce_label_size && $this->_label_size >  0) {
251
+        if ($this->_enforce_label_size && $this->_label_size > 0) {
252 252
             return;
253 253
         }
254 254
         // determine length of option value
@@ -295,13 +295,13 @@  discard block
 block discarded – undo
295 295
     {
296 296
         $options = $this->flat_options();
297 297
         $unnormalized_value_choices = $this->get_normalization_strategy()->unnormalize($this->_normalized_value);
298
-        if (! $this->_multiple_selections) {
298
+        if ( ! $this->_multiple_selections) {
299 299
             $unnormalized_value_choices = array($unnormalized_value_choices);
300 300
         }
301 301
         $pretty_strings = array();
302 302
         foreach ((array) $unnormalized_value_choices as $unnormalized_value_choice) {
303
-            if (isset($options[ $unnormalized_value_choice ])) {
304
-                $pretty_strings[] = $options[ $unnormalized_value_choice ];
303
+            if (isset($options[$unnormalized_value_choice])) {
304
+                $pretty_strings[] = $options[$unnormalized_value_choice];
305 305
             } else {
306 306
                 $pretty_strings[] = $this->normalized_value();
307 307
             }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Integer_Input.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -12,35 +12,35 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    /**
16
-     * @param array $input_settings
17
-     */
18
-    public function __construct($input_settings = array())
19
-    {
20
-        $this->_set_display_strategy(
21
-            new EE_Number_Input_Display_Strategy(
22
-                isset($input_settings['min_value'])
23
-                    ? $input_settings['min_value']
24
-                    : null,
25
-                isset($input_settings['max_value'])
26
-                    ? $input_settings['max_value']
27
-                    : null
28
-            )
29
-        );
30
-        $this->_set_normalization_strategy(
31
-            new EE_Int_Normalization(
32
-                isset($input_settings['validation_error_message'])
33
-                    ? $input_settings['validation_error_message']
34
-                    : null
35
-            )
36
-        );
37
-        $this->_add_validation_strategy(
38
-            new EE_Int_Validation_Strategy(
39
-                isset($input_settings['validation_error_message'])
40
-                    ? $input_settings['validation_error_message']
41
-                    : null
42
-            )
43
-        );
44
-        parent::__construct($input_settings);
45
-    }
15
+	/**
16
+	 * @param array $input_settings
17
+	 */
18
+	public function __construct($input_settings = array())
19
+	{
20
+		$this->_set_display_strategy(
21
+			new EE_Number_Input_Display_Strategy(
22
+				isset($input_settings['min_value'])
23
+					? $input_settings['min_value']
24
+					: null,
25
+				isset($input_settings['max_value'])
26
+					? $input_settings['max_value']
27
+					: null
28
+			)
29
+		);
30
+		$this->_set_normalization_strategy(
31
+			new EE_Int_Normalization(
32
+				isset($input_settings['validation_error_message'])
33
+					? $input_settings['validation_error_message']
34
+					: null
35
+			)
36
+		);
37
+		$this->_add_validation_strategy(
38
+			new EE_Int_Validation_Strategy(
39
+				isset($input_settings['validation_error_message'])
40
+					? $input_settings['validation_error_message']
41
+					: null
42
+			)
43
+		);
44
+		parent::__construct($input_settings);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Hidden_Input.input.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -9,28 +9,28 @@
 block discarded – undo
9 9
 class EE_Hidden_Input extends EE_Form_Input_Base
10 10
 {
11 11
 
12
-    /**
13
-     * @param array $input_settings
14
-     */
15
-    public function __construct($input_settings = array())
16
-    {
17
-        // require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
18
-        $this->_set_display_strategy(new EE_Hidden_Display_Strategy());
19
-        if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
20
-            $this->_set_normalization_strategy($input_settings['normalization_strategy']);
21
-        } else {
22
-            $this->_set_normalization_strategy(new EE_Text_Normalization());
23
-        }
24
-        parent::__construct($input_settings);
25
-    }
12
+	/**
13
+	 * @param array $input_settings
14
+	 */
15
+	public function __construct($input_settings = array())
16
+	{
17
+		// require_once('strategies/display_strategies/EE_Text_Input_Display_Strategy.strategy.php');
18
+		$this->_set_display_strategy(new EE_Hidden_Display_Strategy());
19
+		if (isset($input_settings['normalization_strategy']) && $input_settings['normalization_strategy'] instanceof EE_Normalization_Strategy_Base) {
20
+			$this->_set_normalization_strategy($input_settings['normalization_strategy']);
21
+		} else {
22
+			$this->_set_normalization_strategy(new EE_Text_Normalization());
23
+		}
24
+		parent::__construct($input_settings);
25
+	}
26 26
 
27 27
 
28 28
 
29
-    /**
30
-     * @return string
31
-     */
32
-    public function get_html_for_label()
33
-    {
34
-        return '';
35
-    }
29
+	/**
30
+	 * @return string
31
+	 */
32
+	public function get_html_for_label()
33
+	{
34
+		return '';
35
+	}
36 36
 }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Select_Multi_Model_Input.input.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -12,75 +12,75 @@
 block discarded – undo
12 12
 {
13 13
 
14 14
 
15
-    protected $_naming_method;
15
+	protected $_naming_method;
16 16
 
17 17
 
18 18
 
19
-    /**
20
-     *
21
-     * @param EE_Base_Class[] $answer_options
22
-     * @param array $input_settings {
23
-     *      @var EE_Base_Class[] or array $default
24
-     *      @var string $naming_method function name on the class which will be used for getting the displayed-name.
25
-     *     example:     if the class were an EE_Event, this could be slug(), description(), name() (default)
26
-     * }
27
-     */
28
-    public function __construct($answer_options = array(), $input_settings = array())
29
-    {
30
-        if (isset($input_settings['naming_method'])) {
31
-            $this->set_option_naming_method($input_settings['naming_method']);
32
-        }
33
-        parent::__construct($answer_options, $input_settings);
34
-    }
19
+	/**
20
+	 *
21
+	 * @param EE_Base_Class[] $answer_options
22
+	 * @param array $input_settings {
23
+	 *      @var EE_Base_Class[] or array $default
24
+	 *      @var string $naming_method function name on the class which will be used for getting the displayed-name.
25
+	 *     example:     if the class were an EE_Event, this could be slug(), description(), name() (default)
26
+	 * }
27
+	 */
28
+	public function __construct($answer_options = array(), $input_settings = array())
29
+	{
30
+		if (isset($input_settings['naming_method'])) {
31
+			$this->set_option_naming_method($input_settings['naming_method']);
32
+		}
33
+		parent::__construct($answer_options, $input_settings);
34
+	}
35 35
 
36
-    /**
37
-     * Sets the method name which will be called when outputting the options list
38
-     * @param string $method
39
-     */
40
-    public function set_option_naming_method($method)
41
-    {
42
-        $this->_naming_method = $method;
43
-    }
36
+	/**
37
+	 * Sets the method name which will be called when outputting the options list
38
+	 * @param string $method
39
+	 */
40
+	public function set_option_naming_method($method)
41
+	{
42
+		$this->_naming_method = $method;
43
+	}
44 44
 
45 45
 
46 46
 
47
-    /**
48
-     * You CAN pass an array of model objects instead of simple values for teh options
49
-     * @param EE_Base_Class[] $answer_options
50
-     * @return null|void
51
-     */
52
-    public function set_select_options($answer_options = array())
53
-    {
54
-        // convert the model objects to select from into normal select options
55
-        $select_options = array();
56
-        foreach ($answer_options as $model_obj) {
57
-            if ($this->_naming_method) {
58
-                $display_value = call_user_func(array( $model_obj, $this->_naming_method ));
59
-            } else {
60
-                $display_value = $model_obj->name();
61
-            }
62
-            $select_options[ $model_obj->ID() ] = $display_value;
63
-        }
64
-        parent::set_select_options($select_options);
65
-    }
47
+	/**
48
+	 * You CAN pass an array of model objects instead of simple values for teh options
49
+	 * @param EE_Base_Class[] $answer_options
50
+	 * @return null|void
51
+	 */
52
+	public function set_select_options($answer_options = array())
53
+	{
54
+		// convert the model objects to select from into normal select options
55
+		$select_options = array();
56
+		foreach ($answer_options as $model_obj) {
57
+			if ($this->_naming_method) {
58
+				$display_value = call_user_func(array( $model_obj, $this->_naming_method ));
59
+			} else {
60
+				$display_value = $model_obj->name();
61
+			}
62
+			$select_options[ $model_obj->ID() ] = $display_value;
63
+		}
64
+		parent::set_select_options($select_options);
65
+	}
66 66
 
67 67
 
68 68
 
69
-    /**
70
-     * if they passed in an array of model objects for the default, convert it
71
-     * into the format EE_Select_Multiple expects
72
-     * @param EE_Base_Class[]|array $values
73
-     */
74
-    public function set_default($values)
75
-    {
76
-        $defaults_as_simple_ids = array();
77
-        foreach ($values as $key => $value) {
78
-            if ($value instanceof EE_Base_Class) {
79
-                $defaults_as_simple_ids[] = $value->ID();
80
-            } else {
81
-                $defaults_as_simple_ids[] = $value;
82
-            }
83
-        }
84
-        parent::set_default($defaults_as_simple_ids);
85
-    }
69
+	/**
70
+	 * if they passed in an array of model objects for the default, convert it
71
+	 * into the format EE_Select_Multiple expects
72
+	 * @param EE_Base_Class[]|array $values
73
+	 */
74
+	public function set_default($values)
75
+	{
76
+		$defaults_as_simple_ids = array();
77
+		foreach ($values as $key => $value) {
78
+			if ($value instanceof EE_Base_Class) {
79
+				$defaults_as_simple_ids[] = $value->ID();
80
+			} else {
81
+				$defaults_as_simple_ids[] = $value;
82
+			}
83
+		}
84
+		parent::set_default($defaults_as_simple_ids);
85
+	}
86 86
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
         $select_options = array();
56 56
         foreach ($answer_options as $model_obj) {
57 57
             if ($this->_naming_method) {
58
-                $display_value = call_user_func(array( $model_obj, $this->_naming_method ));
58
+                $display_value = call_user_func(array($model_obj, $this->_naming_method));
59 59
             } else {
60 60
                 $display_value = $model_obj->name();
61 61
             }
62
-            $select_options[ $model_obj->ID() ] = $display_value;
62
+            $select_options[$model_obj->ID()] = $display_value;
63 63
         }
64 64
         parent::set_select_options($select_options);
65 65
     }
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Invisible_Recaptcha_Input.input.php 2 patches
Indentation   +217 added lines, -217 removed lines patch added patch discarded remove patch
@@ -15,221 +15,221 @@
 block discarded – undo
15 15
 class EE_Invisible_Recaptcha_Input extends EE_Form_Input_Base
16 16
 {
17 17
 
18
-    const SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA   = 'google_invisible_recaptcha';
19
-
20
-    const SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA = 'espresso_invisible_recaptcha';
21
-
22
-    /**
23
-     * @var EE_Registration_Config $config
24
-     */
25
-    private $config;
26
-
27
-    /**
28
-     * @var string $recaptcha_id
29
-     */
30
-    private $recaptcha_id;
31
-
32
-    /**
33
-     * @var string $submit_button_id
34
-     */
35
-    private $submit_button_id;
36
-
37
-
38
-    /**
39
-     * @param array                  $input_settings
40
-     * @param EE_Registration_Config $registration_config
41
-     * @throws InvalidArgumentException
42
-     * @throws InvalidDataTypeException
43
-     * @throws InvalidInterfaceException
44
-     * @throws DomainException
45
-     */
46
-    public function __construct(array $input_settings = array(), EE_Registration_Config $registration_config = null)
47
-    {
48
-        $this->_set_display_strategy(new EE_Invisible_Recaptcha_Display_Strategy());
49
-        parent::__construct($input_settings);
50
-        $registration_config    = $registration_config instanceof EE_Registration_Config
51
-            ? $registration_config
52
-            : EE_Registry::instance()->CFG->registration;
53
-        $this->config           = $registration_config;
54
-        $this->recaptcha_id     = isset($input_settings['recaptcha_id'])
55
-            ? $input_settings['recaptcha_id']
56
-            : substr(spl_object_hash($this), 8, 8);
57
-        $this->submit_button_id = isset($input_settings['submit_button_id'])
58
-            ? $input_settings['submit_button_id']
59
-            : '';
60
-        if (isset($input_settings['localized_vars'])
61
-            && filter_var($input_settings['iframe'], FILTER_VALIDATE_BOOLEAN)
62
-        ) {
63
-            $this->addIframeAssets($input_settings['localized_vars']);
64
-        } else {
65
-            $this->registerScripts();
66
-        }
67
-    }
68
-
69
-
70
-    /**
71
-     * @return bool
72
-     */
73
-    public function useCaptcha()
74
-    {
75
-        return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible';
76
-    }
77
-
78
-
79
-    /**
80
-     * @return string
81
-     */
82
-    public function badge()
83
-    {
84
-        return $this->config->recaptcha_badge;
85
-    }
86
-
87
-
88
-    /**
89
-     * @return string
90
-     */
91
-    public function language()
92
-    {
93
-        return $this->config->recaptcha_language;
94
-    }
95
-
96
-
97
-    /**
98
-     * @return string
99
-     */
100
-    public function siteKey()
101
-    {
102
-        return $this->config->recaptcha_publickey;
103
-    }
104
-
105
-
106
-    /**
107
-     * @return string
108
-     */
109
-    public function secretKey()
110
-    {
111
-        return $this->config->recaptcha_privatekey;
112
-    }
113
-
114
-
115
-    /**
116
-     * @return string
117
-     */
118
-    public function recaptchaId()
119
-    {
120
-        return $this->recaptcha_id;
121
-    }
122
-
123
-
124
-    /**
125
-     * @return string
126
-     */
127
-    public function submitButtonId()
128
-    {
129
-        return $this->submit_button_id;
130
-    }
131
-
132
-
133
-    /**
134
-     * @param array $localized_vars
135
-     * @throws DomainException
136
-     */
137
-    private function addIframeAssets(array $localized_vars)
138
-    {
139
-        if (! $this->useCaptcha()) {
140
-            return;
141
-        }
142
-        add_filter(
143
-            'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
144
-            function (array $iframe_assets) {
145
-                $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] =
146
-                    EED_Recaptcha_Invisible::assetsUrl()
147
-                    . 'espresso_invisible_recaptcha.js?ver='
148
-                    . EVENT_ESPRESSO_VERSION;
149
-                $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] =
150
-                    add_query_arg(
151
-                        array(
152
-                            'onload' => 'espressoLoadRecaptcha',
153
-                            'render' => 'explicit',
154
-                            'hl'     => $this->language(),
155
-                        ),
156
-                        'https://www.google.com/recaptcha/api.js?'
157
-                    );
158
-                return $iframe_assets;
159
-            }
160
-        );
161
-        add_filter(
162
-            'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes',
163
-            function (array $iframe_asset_attributes) {
164
-                $iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ]
165
-                    = ' async="async" defer="defer"';
166
-                return $iframe_asset_attributes;
167
-            }
168
-        );
169
-        add_action(
170
-            'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete',
171
-            function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) {
172
-                $ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha');
173
-            }
174
-        );
175
-    }
176
-
177
-
178
-    /**
179
-     * @return void
180
-     */
181
-    private function registerScripts()
182
-    {
183
-        if (! $this->useCaptcha()) {
184
-            return;
185
-        }
186
-        add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2);
187
-        wp_register_script(
188
-            EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA,
189
-            EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js',
190
-            array('espresso_core'),
191
-            EVENT_ESPRESSO_VERSION,
192
-            true
193
-        );
194
-        wp_register_script(
195
-            EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA,
196
-            add_query_arg(
197
-                array(
198
-                    'onload' => 'espressoLoadRecaptcha',
199
-                    'render' => 'explicit',
200
-                    'hl'     => $this->language(),
201
-                ),
202
-                'https://www.google.com/recaptcha/api.js?'
203
-            ),
204
-            array(EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA),
205
-            false,
206
-            true
207
-        );
208
-    }
209
-
210
-
211
-    /**
212
-     * @param string $tag
213
-     * @param string $handle
214
-     * @return string
215
-     */
216
-    public function addScriptAttributes($tag, $handle)
217
-    {
218
-        if ($handle === EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA) {
219
-            $tag = str_replace('></script>', ' async="async" defer="defer"></script>', $tag);
220
-        }
221
-        return $tag;
222
-    }
223
-
224
-
225
-    /**
226
-     * Gets the HTML for displaying the label for this form input
227
-     * according to the form section's layout strategy
228
-     *
229
-     * @return string
230
-     */
231
-    public function get_html_for_label()
232
-    {
233
-        return '';
234
-    }
18
+	const SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA   = 'google_invisible_recaptcha';
19
+
20
+	const SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA = 'espresso_invisible_recaptcha';
21
+
22
+	/**
23
+	 * @var EE_Registration_Config $config
24
+	 */
25
+	private $config;
26
+
27
+	/**
28
+	 * @var string $recaptcha_id
29
+	 */
30
+	private $recaptcha_id;
31
+
32
+	/**
33
+	 * @var string $submit_button_id
34
+	 */
35
+	private $submit_button_id;
36
+
37
+
38
+	/**
39
+	 * @param array                  $input_settings
40
+	 * @param EE_Registration_Config $registration_config
41
+	 * @throws InvalidArgumentException
42
+	 * @throws InvalidDataTypeException
43
+	 * @throws InvalidInterfaceException
44
+	 * @throws DomainException
45
+	 */
46
+	public function __construct(array $input_settings = array(), EE_Registration_Config $registration_config = null)
47
+	{
48
+		$this->_set_display_strategy(new EE_Invisible_Recaptcha_Display_Strategy());
49
+		parent::__construct($input_settings);
50
+		$registration_config    = $registration_config instanceof EE_Registration_Config
51
+			? $registration_config
52
+			: EE_Registry::instance()->CFG->registration;
53
+		$this->config           = $registration_config;
54
+		$this->recaptcha_id     = isset($input_settings['recaptcha_id'])
55
+			? $input_settings['recaptcha_id']
56
+			: substr(spl_object_hash($this), 8, 8);
57
+		$this->submit_button_id = isset($input_settings['submit_button_id'])
58
+			? $input_settings['submit_button_id']
59
+			: '';
60
+		if (isset($input_settings['localized_vars'])
61
+			&& filter_var($input_settings['iframe'], FILTER_VALIDATE_BOOLEAN)
62
+		) {
63
+			$this->addIframeAssets($input_settings['localized_vars']);
64
+		} else {
65
+			$this->registerScripts();
66
+		}
67
+	}
68
+
69
+
70
+	/**
71
+	 * @return bool
72
+	 */
73
+	public function useCaptcha()
74
+	{
75
+		return $this->config->use_captcha && $this->config->recaptcha_theme === 'invisible';
76
+	}
77
+
78
+
79
+	/**
80
+	 * @return string
81
+	 */
82
+	public function badge()
83
+	{
84
+		return $this->config->recaptcha_badge;
85
+	}
86
+
87
+
88
+	/**
89
+	 * @return string
90
+	 */
91
+	public function language()
92
+	{
93
+		return $this->config->recaptcha_language;
94
+	}
95
+
96
+
97
+	/**
98
+	 * @return string
99
+	 */
100
+	public function siteKey()
101
+	{
102
+		return $this->config->recaptcha_publickey;
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return string
108
+	 */
109
+	public function secretKey()
110
+	{
111
+		return $this->config->recaptcha_privatekey;
112
+	}
113
+
114
+
115
+	/**
116
+	 * @return string
117
+	 */
118
+	public function recaptchaId()
119
+	{
120
+		return $this->recaptcha_id;
121
+	}
122
+
123
+
124
+	/**
125
+	 * @return string
126
+	 */
127
+	public function submitButtonId()
128
+	{
129
+		return $this->submit_button_id;
130
+	}
131
+
132
+
133
+	/**
134
+	 * @param array $localized_vars
135
+	 * @throws DomainException
136
+	 */
137
+	private function addIframeAssets(array $localized_vars)
138
+	{
139
+		if (! $this->useCaptcha()) {
140
+			return;
141
+		}
142
+		add_filter(
143
+			'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
144
+			function (array $iframe_assets) {
145
+				$iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] =
146
+					EED_Recaptcha_Invisible::assetsUrl()
147
+					. 'espresso_invisible_recaptcha.js?ver='
148
+					. EVENT_ESPRESSO_VERSION;
149
+				$iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] =
150
+					add_query_arg(
151
+						array(
152
+							'onload' => 'espressoLoadRecaptcha',
153
+							'render' => 'explicit',
154
+							'hl'     => $this->language(),
155
+						),
156
+						'https://www.google.com/recaptcha/api.js?'
157
+					);
158
+				return $iframe_assets;
159
+			}
160
+		);
161
+		add_filter(
162
+			'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes',
163
+			function (array $iframe_asset_attributes) {
164
+				$iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ]
165
+					= ' async="async" defer="defer"';
166
+				return $iframe_asset_attributes;
167
+			}
168
+		);
169
+		add_action(
170
+			'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete',
171
+			function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) {
172
+				$ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha');
173
+			}
174
+		);
175
+	}
176
+
177
+
178
+	/**
179
+	 * @return void
180
+	 */
181
+	private function registerScripts()
182
+	{
183
+		if (! $this->useCaptcha()) {
184
+			return;
185
+		}
186
+		add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2);
187
+		wp_register_script(
188
+			EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA,
189
+			EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js',
190
+			array('espresso_core'),
191
+			EVENT_ESPRESSO_VERSION,
192
+			true
193
+		);
194
+		wp_register_script(
195
+			EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA,
196
+			add_query_arg(
197
+				array(
198
+					'onload' => 'espressoLoadRecaptcha',
199
+					'render' => 'explicit',
200
+					'hl'     => $this->language(),
201
+				),
202
+				'https://www.google.com/recaptcha/api.js?'
203
+			),
204
+			array(EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA),
205
+			false,
206
+			true
207
+		);
208
+	}
209
+
210
+
211
+	/**
212
+	 * @param string $tag
213
+	 * @param string $handle
214
+	 * @return string
215
+	 */
216
+	public function addScriptAttributes($tag, $handle)
217
+	{
218
+		if ($handle === EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA) {
219
+			$tag = str_replace('></script>', ' async="async" defer="defer"></script>', $tag);
220
+		}
221
+		return $tag;
222
+	}
223
+
224
+
225
+	/**
226
+	 * Gets the HTML for displaying the label for this form input
227
+	 * according to the form section's layout strategy
228
+	 *
229
+	 * @return string
230
+	 */
231
+	public function get_html_for_label()
232
+	{
233
+		return '';
234
+	}
235 235
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -136,17 +136,17 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function addIframeAssets(array $localized_vars)
138 138
     {
139
-        if (! $this->useCaptcha()) {
139
+        if ( ! $this->useCaptcha()) {
140 140
             return;
141 141
         }
142 142
         add_filter(
143 143
             'FHEE__EED_Ticket_Selector__ticket_selector_iframe__js',
144
-            function (array $iframe_assets) {
145
-                $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA ] =
144
+            function(array $iframe_assets) {
145
+                $iframe_assets[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA] =
146 146
                     EED_Recaptcha_Invisible::assetsUrl()
147 147
                     . 'espresso_invisible_recaptcha.js?ver='
148 148
                     . EVENT_ESPRESSO_VERSION;
149
-                $iframe_assets[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ] =
149
+                $iframe_assets[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA] =
150 150
                     add_query_arg(
151 151
                         array(
152 152
                             'onload' => 'espressoLoadRecaptcha',
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
         );
161 161
         add_filter(
162 162
             'FHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__js_attributes',
163
-            function (array $iframe_asset_attributes) {
164
-                $iframe_asset_attributes[ EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA ]
163
+            function(array $iframe_asset_attributes) {
164
+                $iframe_asset_attributes[EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_GOOGLE_INVISIBLE_RECAPTCHA]
165 165
                     = ' async="async" defer="defer"';
166 166
                 return $iframe_asset_attributes;
167 167
             }
168 168
         );
169 169
         add_action(
170 170
             'AHEE__EventEspresso_modules_ticket_selector_TicketSelectorIframe__construct__complete',
171
-            function (EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) {
171
+            function(EventEspresso\modules\ticket_selector\TicketSelectorIframe $ticket_selector_iframe) use ($localized_vars) {
172 172
                 $ticket_selector_iframe->addLocalizedVars($localized_vars, 'eeRecaptcha');
173 173
             }
174 174
         );
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
      */
181 181
     private function registerScripts()
182 182
     {
183
-        if (! $this->useCaptcha()) {
183
+        if ( ! $this->useCaptcha()) {
184 184
             return;
185 185
         }
186 186
         add_filter('script_loader_tag', array($this, 'addScriptAttributes'), 10, 2);
187 187
         wp_register_script(
188 188
             EE_Invisible_Recaptcha_Input::SCRIPT_HANDLE_ESPRESSO_INVISIBLE_RECAPTCHA,
189
-            EED_Recaptcha_Invisible::assetsUrl() . 'espresso_invisible_recaptcha.js',
189
+            EED_Recaptcha_Invisible::assetsUrl().'espresso_invisible_recaptcha.js',
190 190
             array('espresso_core'),
191 191
             EVENT_ESPRESSO_VERSION,
192 192
             true
Please login to merge, or discard this patch.
core/libraries/form_sections/inputs/EE_Phone_Input.input.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
  */
15 15
 class EE_Phone_Input extends EE_Text_Input
16 16
 {
17
-    /**
18
-     * @param array $options
19
-     */
20
-    public function __construct($options = array())
21
-    {
22
-        $this->_add_validation_strategy(
23
-            new EE_Text_Validation_Strategy(
24
-                __('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'),
25
-                '~^(([\d]{10})|(^[\d]{3}-[\d]{3}-[\d]{4}))$~'
26
-            )
27
-        );
28
-        parent::__construct($options);
29
-    }
17
+	/**
18
+	 * @param array $options
19
+	 */
20
+	public function __construct($options = array())
21
+	{
22
+		$this->_add_validation_strategy(
23
+			new EE_Text_Validation_Strategy(
24
+				__('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'),
25
+				'~^(([\d]{10})|(^[\d]{3}-[\d]{3}-[\d]{4}))$~'
26
+			)
27
+		);
28
+		parent::__construct($options);
29
+	}
30 30
 }
Please login to merge, or discard this patch.