Code Duplication    Length = 7-8 lines in 2 locations

src/HTMLForm/Form.php 2 locations

@@ 143-149 (lines=7) @@
140
     *
141
     * @return \Anax\HTMLForm\FormElement
142
     */
143
    public function getElement($name)
144
    {
145
        if (!isset($this->elements[$name])) {
146
            throw new Exception("Form element '$name' is not found.");
147
        }
148
        return $this->elements[$name];
149
    }
150
151
152
@@ 160-167 (lines=8) @@
157
     *
158
     * @return $this
159
     */
160
    public function removeElement($name)
161
    {
162
        if (!isset($this->elements[$name])) {
163
            throw new Exception("Form element '$name' is not found.");
164
        }
165
        unset($this->elements[$name]);
166
        return $this;
167
    }
168
169
170