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 (!$fields instanceof HtmlFormFields) {
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

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