Code Duplication    Length = 7-8 lines in 3 locations

class/class.datafieldmanager.php 1 location

@@ 597-603 (lines=7) @@
594
     * @param string $value "value" attribute
595
     * @param string $name  "name" attribute
596
     */
597
    public function addOption($value, $name = '')
598
    {
599
        if ($name != '') {
600
            $this->_options[$value] = $name;
601
        } else {
602
            $this->_options[$value] = $value;
603
        }
604
    }
605
606
    /**

class/class.formimage.php 1 location

@@ 141-148 (lines=8) @@
138
     * @param string $value "value" attribute
139
     * @param string $name  "name" attribute
140
     */
141
    public function addOption($value, $name = '')
142
    {
143
        if ($name !== '') {
144
            $this->_options[$value] = $name;
145
        } else {
146
            $this->_options[$value] = $value;
147
        }
148
    }
149
150
    /**
151
     * Add multiple options

class/class.formradio.php 1 location

@@ 132-139 (lines=8) @@
129
     * @param string $value "value" attribute - This gets submitted as form-data.
130
     * @param string $name  "name" attribute - This is displayed. If empty, we use the "value" instead.
131
     */
132
    public function addOption($value, $name = '')
133
    {
134
        if ($name !== '') {
135
            $this->_options[$value] = $name;
136
        } else {
137
            $this->_options[$value] = $value;
138
        }
139
    }
140
141
    /**
142
     * Adds multiple options