Code Duplication    Length = 24-25 lines in 2 locations

components/select/controller.php 1 location

@@ 8-31 (lines=24) @@
5
/**
6
 * Implements a select UI component.
7
 */
8
class Component_select
9
extends AbstractComponent
10
{
11
    public function default_model() 
12
    {
13
        return array(
14
            'name'      => '',
15
            'disabled'  => false,
16
            'data'      => array(),
17
            'required'  => false,
18
            'readonly'  => false
19
        );
20
    }
21
    
22
    public function required_arguments()
23
    {
24
        return array('name','data');
25
    }
26
    
27
    public function get_template_path() 
28
    {
29
        return __DIR__.'/template.phtml';
30
    }
31
}

components/text/controller.php 1 location

@@ 8-32 (lines=25) @@
5
/**
6
 * Implements a Text UI component.
7
 */
8
class Component_text
9
extends AbstractComponent
10
{
11
    public function default_model() 
12
    {
13
        return array(
14
            'name'          => '',
15
            'disabled'      => false,
16
            'placeholder'   => null,
17
            'size'          => null,
18
            'required'      => false,
19
            'readonly'      => false
20
        );
21
    }
22
    
23
    public function required_arguments()
24
    {
25
        return array('name');
26
    }
27
    
28
    public function get_template_path() 
29
    {
30
        return __DIR__.'/template.phtml';
31
    }
32
}