Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 42-53 (lines=12) @@
39
     * @param string       $joiner  joiner for elements in tray
40
     * @param string       $name    name
41
     */
42
    public function __construct($caption, $joiner = ' ', $name = '')
43
    {
44
        if (is_array($caption)) {
45
            parent::__construct($caption);
46
            $this->setIfNotSet(':joiner', ' ');
47
        } else {
48
            parent::__construct();
49
            $this->setName($name);
50
            $this->setCaption($caption);
51
            $this->set(':joiner', $joiner);
52
        }
53
    }
54
55
    /**
56
     * Are there are required elements?

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

@@ 32-42 (lines=11) @@
29
     * @param string|array $caption Caption or array of all attributes
30
     * @param string       $name    name attribute
31
     */
32
    public function __construct($caption, $name = null)
33
    {
34
        if (is_array($caption)) {
35
            parent::__construct($caption);
36
        } else {
37
            parent::__construct();
38
            $this->setCaption($caption);
39
            $this->set('name', $name);
40
        }
41
        $this->set('type', 'file');
42
    }
43
44
    /**
45
     * prepare HTML for output