Code Duplication    Length = 8-8 lines in 3 locations

htdocs/class/xoopsform/formcheckbox.php 1 location

@@ 123-130 (lines=8) @@
120
     * @param string $value
121
     * @param string $name
122
     */
123
    public function addOption($value, $name = '')
124
    {
125
        if ($name != '') {
126
            $this->_options[$value] = $name;
127
        } else {
128
            $this->_options[$value] = $value;
129
        }
130
    }
131
132
    /**
133
     * Add multiple Options at once

htdocs/class/xoopsform/formradio.php 1 location

@@ 102-109 (lines=8) @@
99
     * @param string $value "value" attribute - This gets submitted as form-data.
100
     * @param string $name  "name" attribute - This is displayed. If empty, we use the "value" instead.
101
     */
102
    public function addOption($value, $name = '')
103
    {
104
        if ($name != '') {
105
            $this->_options[$value] = $name;
106
        } else {
107
            $this->_options[$value] = $value;
108
        }
109
    }
110
111
    /**
112
     * Adds multiple options

htdocs/class/xoopsform/formselect.php 1 location

@@ 150-157 (lines=8) @@
147
     * @param string $value "value" attribute
148
     * @param string $name  "name" attribute
149
     */
150
    public function addOption($value, $name = '')
151
    {
152
        if ($name != '') {
153
            $this->_options[$value] = $name;
154
        } else {
155
            $this->_options[$value] = $value;
156
        }
157
    }
158
159
    /**
160
     * Add multiple options