Code Duplication    Length = 10-10 lines in 2 locations

htdocs/class/xoopsform/formselect.php 1 location

@@ 133-142 (lines=10) @@
130
     *
131
     * @param  $value mixed
132
     */
133
    public function setValue($value)
134
    {
135
        if (is_array($value)) {
136
            foreach ($value as $v) {
137
                $this->_value[] = $v;
138
            }
139
        } elseif (isset($value)) {
140
            $this->_value[] = $value;
141
        }
142
    }
143
144
    /**
145
     * Add an option

htdocs/class/xoopsform/grouppermform.php 1 location

@@ 233-242 (lines=10) @@
230
     * @param mixed $value A group ID or an array of group IDs
231
     * @access public
232
     */
233
    public function setValue($value)
234
    {
235
        if (is_array($value)) {
236
            foreach ($value as $v) {
237
                $this->setValue($v);
238
            }
239
        } else {
240
            $this->_value[] = $value;
241
        }
242
    }
243
244
    /**
245
     * Sets the tree structure of items