Completed
Branch BUG-10669-spco-validation-msg (4c1309)
by
unknown
49:56 queued 37:41
created

EE_Integer_Input   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 28 5
1
<?php
2
defined('EVENT_ESPRESSO_VERSION') || exit;
3
4
5
6
/**
7
 * Class EE_Integer_Input
8
 * Generates an HTML5 number input using integer normalization and validation strategies
9
 *
10
 * @package       Event Espresso
11
 * @author        Brent Christensen
12
 * @since         4.9.34
13
 */
14
class EE_Integer_Input extends EE_Form_Input_Base
15
{
16
17
18
    /**
19
     * @param array $input_settings
20
     */
21
    public function __construct($input_settings = array())
22
    {
23
        $this->_set_display_strategy(
24
            new EE_Number_Input_Display_Strategy(
25
                isset($input_settings['min_value'])
26
                    ? $input_settings['min_value']
27
                    : null,
28
                isset($input_settings['max_value'])
29
                    ? $input_settings['max_value']
30
                    : null
31
            )
32
        );
33
        $this->_set_normalization_strategy(
34
            new EE_Int_Normalization(
35
                isset($input_settings['validation_error_message'])
36
                    ? $input_settings['validation_error_message']
37
                    : null
38
            )
39
        );
40
        $this->_add_validation_strategy(
41
            new EE_Int_Validation_Strategy(
42
                isset($input_settings['validation_error_message'])
43
                    ? $input_settings['validation_error_message']
44
                    : null
45
            )
46
        );
47
        parent::__construct($input_settings);
48
    }
49
50
}
51
// End of file EE_Integer_Input.php
52
// Location: core/libraries/form_sections/inputs/EE_Integer_Input.php