Code Duplication    Length = 9-11 lines in 2 locations

Ajax/semantic/html/collections/form/HtmlFormFields.php 1 location

@@ 25-35 (lines=11) @@
22
	}
23
24
	public function addFields($fields=NULL, $label=NULL) {
25
		if (!$fieldsinstanceofHtmlFormFields) {
26
			if (\is_array($fields)===false) {
27
				$fields=\func_get_args();
28
				$end=\end($fields);
29
				if (\is_string($end)) {
30
					$label=$end;
31
					\array_pop($fields);
32
				} else
33
					$label=NULL;
34
			}
35
		}
36
		if (isset($label))
37
			$this->setLabel($label);
38
		foreach ( $fields as $field ) {

Ajax/semantic/html/collections/form/HtmlForm.php 1 location

@@ 65-73 (lines=9) @@
62
	public function addFields($fields=NULL, $label=NULL) {
63
		if (isset($fields)) {
64
			if (!$fields instanceof HtmlFormFields) {
65
				if (\is_array($fields) === false) {
66
					$fields=\func_get_args();
67
					$end=\end($fields);
68
					if (\is_string($end)) {
69
						$label=$end;
70
						\array_pop($fields);
71
					} else
72
						$label=NULL;
73
				}
74
				$this->_fields=\array_merge($this->_fields, $fields);
75
				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
76
			}