Code Duplication    Length = 16-16 lines in 2 locations

htdocs/xoops_lib/Xoops/Form/Text.php 1 location

@@ 36-51 (lines=16) @@
33
     * @param string       $value       Initial text
34
     * @param string       $placeholder placeholder for this element.
35
     */
36
    public function __construct($caption, $name = null, $size = 10, $maxlength = 64, $value = '', $placeholder = '')
37
    {
38
        if (is_array($caption)) {
39
            parent::__construct($caption);
40
        } else {
41
            parent::__construct([]);
42
            $this->setWithDefaults('caption', $caption, '');
43
            $this->setWithDefaults('name', $name, 'name_error');
44
            $this->setWithDefaults('size', $size, 10);
45
            $this->setWithDefaults('maxlength', $maxlength, 64);
46
            $this->set('value', $value);
47
            $this->setIfNotEmpty('placeholder', $placeholder);
48
        }
49
        $this->setIfNotSet('type', 'text');
50
        $this->setIfNotSet('value', '');
51
    }
52
53
    /**
54
     * Get size

htdocs/xoops_lib/Xoops/Form/TextArea.php 1 location

@@ 36-51 (lines=16) @@
33
     * @param integer      $cols        number of columns
34
     * @param string       $placeholder placeholder for this element.
35
     */
36
    public function __construct($caption, $name = null, $value = "", $rows = 5, $cols = 50, $placeholder = '')
37
    {
38
        if (is_array($caption)) {
39
            parent::__construct($caption);
40
            $this->setIfNotSet('rows', 5);
41
            $this->setIfNotSet('cols', 50);
42
        } else {
43
            parent::__construct([]);
44
            $this->setWithDefaults('caption', $caption, '');
45
            $this->setWithDefaults('name', $name, 'name_error');
46
            $this->setWithDefaults('rows', $rows, 5);
47
            $this->setWithDefaults('cols', $cols, 50);
48
            $this->setWithDefaults('value', $value, '');
49
            $this->setIfNotEmpty('placeholder', $placeholder);
50
        }
51
    }
52
53
    /**
54
     * get number of rows